From 41783de54966481dd295aae95a2bfc8f6302a940 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Tue, 14 Jul 2009 21:31:19 +0200 Subject: [PATCH 01/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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/86] 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 1ad5bb1a69656808312efc40ca12c4897f8ea128 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 22 Dec 2009 10:35:56 +0100 Subject: [PATCH 35/86] WL#4738 streamline/simplify @@variable creation process Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies CMakeLists.txt: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled client/mysql.cc: don't crash with --show-warnings when mysqld dies config/ac-macros/plugins.m4: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled include/my_getopt.h: comments include/my_pthread.h: fix double #define mysql-test/mysql-test-run.pl: run sys_vars suite by default properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0 escape gdb command line arguments mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: init_slave+utf8 bug mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: init_slave+utf8 bug mysys/my_getopt.c: Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) mysys/typelib.c: support for flagset sql/ha_ndbcluster.cc: backport from telco tree sql/item_func.cc: Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters sql/sql_builtin.cc.in: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled sql/sql_plugin.cc: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#32902 plugin variables don't know their names Bug#44797 plugins w/o command-line options have no disabling option in --help sql/sys_vars.cc: all server variables are defined here storage/myisam/ft_parser.c: remove unnecessary updates of param->quot storage/myisam/ha_myisam.cc: myisam_* variables belong here strings/my_vsnprintf.c: %o and %llx unittest/mysys/my_vsnprintf-t.c: %o and %llx tests vio/viosocket.c: bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread) --- .bzrignore | 2 + CMakeLists.txt | 10 +- Makefile.am | 4 - client/mysql.cc | 4 +- client/mysqltest.cc | 7 +- config/ac-macros/plugins.m4 | 6 +- configure.in | 6 +- include/config-netware.h | 2 +- include/config-win.h | 6 +- include/ft_global.h | 4 +- include/keycache.h | 8 +- include/m_string.h | 12 +- include/my_base.h | 11 - include/my_getopt.h | 51 +- include/my_global.h | 39 +- include/my_pthread.h | 3 +- include/my_time.h | 6 +- include/myisam.h | 2 +- include/mysql.h.pp | 4 + include/mysql/plugin.h | 1 + include/mysql/plugin.h.pp | 1 + include/mysql/service_my_snprintf.h | 2 +- include/sslopt-longopts.h | 6 +- include/typelib.h | 5 + libmysqld/CMakeLists.txt | 3 +- libmysqld/Makefile.am | 4 +- libmysqld/lib_sql.cc | 5 +- mysql-test/Makefile.am | 3 +- mysql-test/collections/mysql-next-mr.push | 2 +- mysql-test/extra/rpl_tests/rpl_charset.test | 4 +- mysql-test/include/diff_tables.inc | 1 + .../include/have_thread_concurrency.inc | 10 + mysql-test/include/index_merge1.inc | 2 +- mysql-test/include/mysqld--help.inc | 39 + mysql-test/include/query_cache.inc | 2 +- .../include/query_cache_sql_prepare.inc | 10 +- mysql-test/include/show_slave_status2.inc | 2 +- mysql-test/mysql-test-run.pl | 52 +- mysql-test/r/archive.result | 2 +- mysql-test/r/bug46080.result | 2 + mysql-test/r/cache_innodb.result | 2 +- mysql-test/r/change_user.result | 2 +- mysql-test/r/date_formats.result | 65 - mysql-test/r/errors.result | 8 +- mysql-test/r/events_2.result | 6 - mysql-test/r/events_bugs.result | 11 +- mysql-test/r/have_profiling.require | 2 +- mysql-test/r/index_merge_myisam.result | 5 +- mysql-test/r/innodb.result | 4 +- mysql-test/r/innodb_bug42101-nonzero.result | 4 +- mysql-test/r/innodb_bug42101.result | 4 +- mysql-test/r/key_cache.result | 21 +- mysql-test/r/mysqld--help-notwin.result | 947 ++++ mysql-test/r/mysqld--help-win.result | 953 ++++ mysql-test/r/partition_key_cache.result | 4 +- mysql-test/r/plugin.result | 6 +- mysql-test/r/profiling.result | 2 - mysql-test/r/query_cache.result | 12 +- mysql-test/r/query_cache_ps_no_prot.result | 10 +- mysql-test/r/query_cache_ps_ps_prot.result | 10 +- mysql-test/r/select_safe.result | 4 +- mysql-test/r/sp.result | 9 +- mysql-test/r/subselect.result | 2 - mysql-test/r/union.result | 2 + mysql-test/r/user_limits.result | 2 +- mysql-test/r/user_var.result | 2 - mysql-test/r/variables.result | 99 +- mysql-test/suite/binlog/r/binlog_grant.result | 4 - mysql-test/suite/binlog/t/binlog_grant.test | 4 - mysql-test/suite/innodb/r/innodb-zip.result | 12 +- .../suite/innodb/r/innodb_bug47167.result | 8 +- .../suite/innodb/r/innodb_file_format.result | 12 +- mysql-test/suite/innodb/t/innodb-zip.test | 12 +- .../suite/innodb/t/innodb_bug47167.test | 8 +- .../suite/innodb/t/innodb_file_format.test | 12 +- mysql-test/suite/ndb/r/ndb_basic.result | 4 + mysql-test/suite/ndb/r/ndb_dd_ddl.result | 1 + mysql-test/suite/ndb/t/ndb_dd_ddl.test | 1 + mysql-test/suite/rpl/r/rpl_charset.result | 3 +- mysql-test/suite/rpl/r/rpl_heartbeat.result | 2 +- .../suite/rpl/r/rpl_heartbeat_basic.result | 2 +- mysql-test/suite/rpl/r/rpl_idempotency.result | 2 +- .../suite/rpl/r/rpl_row_max_relay_size.result | 2 + .../suite/rpl/r/rpl_stm_max_relay_size.result | 2 + .../rpl/r/rpl_switch_stm_row_mixed.result | 2 +- .../suite/rpl/r/rpl_variables_stm.result | 5 - mysql-test/suite/rpl/t/rpl_idempotency.test | 2 +- .../suite/rpl/t/rpl_sp_effects-master.opt | 2 +- .../suite/rpl/t/rpl_sp_effects-slave.opt | 2 +- mysql-test/suite/rpl/t/rpl_variables_stm.test | 5 - .../suite/rpl_ndb/r/rpl_ndb_2innodb.result | 1 + .../suite/rpl_ndb/r/rpl_ndb_2myisam.result | 1 + .../suite/rpl_ndb/t/rpl_ndb_2innodb.test | 1 + .../suite/rpl_ndb/t/rpl_ndb_2myisam.test | 1 + mysql-test/suite/sys_vars/README | 3 - .../inc/bulk_insert_buffer_size_basic.inc | 1 - .../inc/delayed_insert_limit_basic.inc | 1 - .../sys_vars/inc/delayed_queue_size_basic.inc | 1 - .../sys_vars/inc/join_buffer_size_basic.inc | 59 +- .../inc/key_cache_age_threshold_basic.inc | 7 - .../suite/sys_vars/inc/log_warnings_basic.inc | 9 +- .../sys_vars/inc/max_connect_errors_basic.inc | 4 - .../sys_vars/inc/max_seeks_for_key_basic.inc | 9 +- .../sys_vars/inc/max_tmp_tables_basic.inc | 8 +- .../inc/max_write_lock_count_basic.inc | 4 +- .../inc/min_examined_row_limit_basic.inc | 9 +- .../inc/myisam_max_sort_file_size_basic.inc | 9 +- .../inc/myisam_repair_threads_basic.inc | 9 +- .../inc/myisam_sort_buffer_size_basic.inc | 9 +- .../sys_vars/inc/net_retry_count_basic.inc | 10 +- .../inc/query_alloc_block_size_basic.inc | 17 +- .../sys_vars/inc/query_cache_limit_basic.inc | 1 - .../inc/query_cache_min_res_unit_basic.inc | 3 - .../sys_vars/inc/query_cache_size_basic.inc | 4 - .../inc/range_alloc_block_size_basic.inc | 11 +- .../sys_vars/inc/rpl_recovery_rank_basic.inc | 4 +- .../inc/slave_transaction_retries_basic.inc | 6 +- .../sys_vars/inc/sort_buffer_size_basic.inc | 44 +- .../transaction_alloc_block_size_basic.inc | 6 - .../inc/transaction_prealloc_size_basic.inc | 4 - mysql-test/suite/sys_vars/r/all_vars.result | 12 + .../r/auto_increment_increment_basic.result | 9 +- .../r/auto_increment_increment_func.result | 3 - .../r/auto_increment_offset_basic.result | 1 - .../r/auto_increment_offset_func.result | 6 - ...t_basic.result => autocommit_basic.result} | 17 +- .../suite/sys_vars/r/autocommit_func.result | 1 - .../r/automatic_sp_privileges_basic.result | 1 - .../suite/sys_vars/r/back_log_basic.result | 21 + .../suite/sys_vars/r/big_tables_basic.result | 11 +- .../r/binlog_cache_size_basic_32.result | 6 + .../r/binlog_cache_size_basic_64.result | 8 + .../r/bulk_insert_buffer_size_basic_32.result | 1 - .../r/bulk_insert_buffer_size_basic_64.result | 1 - .../r/character_set_client_basic.result | 10 +- .../r/character_set_client_func.result | 13 +- .../r/character_set_connection_basic.result | 3 - .../r/character_set_database_basic.result | 2 - .../r/character_set_database_func.result | 3 - .../r/character_set_filesystem_basic.result | 2 - .../r/character_set_results_basic.result | Bin 16478 -> 16478 bytes .../r/character_set_server_basic.result | 9 +- .../r/character_sets_dir_basic.result | 21 + .../r/collation_database_basic.result | 5 +- .../sys_vars/r/collation_database_func.result | 2 - .../sys_vars/r/completion_type_basic.result | 69 +- .../sys_vars/r/concurrent_insert_basic.result | 71 +- .../sys_vars/r/concurrent_insert_func.result | 2 +- .../sys_vars/r/connect_timeout_basic.result | 1 - .../suite/sys_vars/r/date_format_basic.result | 21 + .../sys_vars/r/datetime_format_basic.result | 21 + .../suite/sys_vars/r/debug_basic.result | 25 + .../suite/sys_vars/r/debug_sync_basic.result | 21 + .../r/default_storage_engine_basic.result | 117 + .../r/default_week_format_basic.result | 1 - .../sys_vars/r/delay_key_write_basic.result | 10 +- .../r/delayed_insert_limit_basic_32.result | 1 - .../r/delayed_insert_limit_basic_64.result | 1 - .../r/delayed_insert_timeout_basic.result | 1 - .../r/delayed_queue_size_basic_32.result | 1 - .../r/delayed_queue_size_basic_64.result | 1 - .../r/div_precision_increment_basic.result | 1 - .../r/div_precision_increment_func.result | 7 +- .../r/engine_condition_pushdown_basic.result | 24 +- .../sys_vars/r/event_scheduler_basic.result | 5 +- .../sys_vars/r/expire_logs_days_basic.result | 1 - .../suite/sys_vars/r/flush_basic.result | 4 +- .../suite/sys_vars/r/flush_time_basic.result | 41 + .../r/foreign_key_checks_basic.result | 23 +- .../sys_vars/r/foreign_key_checks_func.result | 3 - .../sys_vars/r/ft_boolean_syntax_basic.result | 3 - .../sys_vars/r/ft_boolean_syntax_func.result | 7 +- .../sys_vars/r/ft_max_word_len_basic.result | 21 + .../sys_vars/r/ft_min_word_len_basic.result | 21 + .../r/ft_query_expansion_limit_basic.result | 21 + .../sys_vars/r/ft_stopword_file_basic.result | 21 + .../sys_vars/r/general_log_file_basic.result | 7 +- .../suite/sys_vars/r/general_log_func.result | 13 +- .../r/group_concat_max_len_basic.result | 9 +- .../sys_vars/r/have_profiling_basic.result | 21 + .../suite/sys_vars/r/identity_basic.result | 9 +- .../r/ignore_builtin_innodb_basic.result | 21 + .../sys_vars/r/init_connect_basic.result | Bin 3580 -> 3867 bytes .../suite/sys_vars/r/init_file_basic.result | 21 + .../innodb_autoextend_increment_basic.result | 20 +- .../r/innodb_commit_concurrency_basic.result | 43 +- ...> innodb_concurrency_tickets_basic.result} | 14 +- ...innodb_concurrency_tickets_basic_32.result | 100 - .../r/innodb_fast_shutdown_basic.result | 26 +- ...nnodb_flush_log_at_trx_commit_basic.result | 10 +- .../r/innodb_max_dirty_pages_pct_basic.result | 10 +- ...sult => innodb_max_purge_lag_basic.result} | 8 +- .../r/innodb_max_purge_lag_basic_32.result | 94 - .../sys_vars/r/innodb_support_xa_basic.result | 28 +- ...lt => innodb_sync_spin_loops_basic.result} | 8 +- .../r/innodb_sync_spin_loops_basic_32.result | 94 - .../r/innodb_table_locks_basic.result | 24 +- .../r/innodb_thread_concurrency_basic.result | 10 +- .../suite/sys_vars/r/insert_id_basic.result | 9 +- .../r/interactive_timeout_basic.result | 9 +- .../r/join_buffer_size_basic_32.result | 115 +- .../r/join_buffer_size_basic_64.result | 123 +- .../r/keep_files_on_create_basic.result | 11 +- ...32.result => key_buffer_size_basic.result} | 59 +- .../r/key_buffer_size_basic_64.result | 100 - .../sys_vars/r/key_buffer_size_func.result | 3 +- .../r/key_cache_age_threshold_basic_32.result | 23 +- .../r/key_cache_age_threshold_basic_64.result | 25 +- ...sult => key_cache_block_size_basic.result} | 19 +- .../r/key_cache_block_size_basic_32.result | 142 - ... => key_cache_division_limit_basic.result} | 14 +- .../key_cache_division_limit_basic_32.result | 139 - .../r/large_files_support_basic.result | 21 + .../sys_vars/r/large_page_size_basic.result | 21 + .../suite/sys_vars/r/large_pages_basic.result | 21 + .../sys_vars/r/last_insert_id_basic.result | 27 + .../suite/sys_vars/r/lc_messages_basic.result | 46 + .../sys_vars/r/lc_messages_dir_basic.result | 21 + .../sys_vars/r/lc_time_names_basic.result | 22 +- .../sys_vars/r/locked_in_memory_basic.result | 21 + mysql-test/suite/sys_vars/r/log_basic.result | 10 +- .../suite/sys_vars/r/log_bin_basic.result | 21 + ...g_bin_trust_function_creators_basic.result | 8 +- ...og_bin_trust_routine_creators_basic.result | 121 - .../suite/sys_vars/r/log_error_basic.result | 21 + .../suite/sys_vars/r/log_output_basic.result | 34 +- ...log_queries_not_using_indexes_basic.result | 33 +- .../sys_vars/r/log_slave_updates_basic.result | 21 + .../sys_vars/r/log_slow_queries_basic.result | 112 + .../sys_vars/r/log_warnings_basic_32.result | 9 +- .../sys_vars/r/log_warnings_basic_64.result | 9 +- .../sys_vars/r/long_query_time_basic.result | 24 +- .../r/low_priority_updates_basic.result | 12 +- .../r/lower_case_file_system_basic.result | 21 + .../r/lower_case_table_names_basic.result | 21 + .../r/max_allowed_packet_basic.result | 16 +- ...ult => max_binlog_cache_size_basic.result} | 29 +- .../r/max_binlog_cache_size_basic_64.result | 141 - .../sys_vars/r/max_binlog_size_basic.result | 13 +- .../r/max_connect_errors_basic_32.result | 3 - .../r/max_connect_errors_basic_64.result | 3 - .../sys_vars/r/max_connections_basic.result | 3 - .../r/max_delayed_threads_basic.result | 34 +- .../sys_vars/r/max_error_count_basic.result | 10 +- ...esult => max_heap_table_size_basic.result} | 43 +- .../r/max_heap_table_size_basic_64.result | 196 - .../r/max_insert_delayed_threads_basic.result | 71 +- .../sys_vars/r/max_join_size_basic.result | 51 + .../r/max_length_for_sort_data_basic.result | 8 +- .../r/max_prepared_stmt_count_basic.result | 1 - .../r/max_relay_log_size_basic.result | 15 +- .../r/max_seeks_for_key_basic_32.result | 9 +- .../r/max_seeks_for_key_basic_64.result | 9 +- .../sys_vars/r/max_sort_length_basic.result | 8 +- .../r/max_sp_recursion_depth_basic.result | 8 +- .../sys_vars/r/max_tmp_tables_basic_32.result | 8 +- .../sys_vars/r/max_tmp_tables_basic_64.result | 8 +- .../r/max_user_connections_basic.result | 44 +- .../r/max_write_lock_count_basic_32.result | 4 +- .../r/max_write_lock_count_basic_64.result | 4 +- .../suite/sys_vars/r/maximum_basic.result | 18 + .../r/min_examined_row_limit_basic_32.result | 9 +- .../r/min_examined_row_limit_basic_64.result | 9 +- .../r/myisam_data_pointer_size_basic.result | 5 +- .../r/myisam_data_pointer_size_func.result | 1 + .../myisam_max_sort_file_size_basic_32.result | 20 +- .../myisam_max_sort_file_size_basic_64.result | 20 +- .../sys_vars/r/myisam_mmap_size_basic.result | 21 + .../r/myisam_recover_options_basic.result | 21 + .../r/myisam_repair_threads_basic_32.result | 8 +- .../r/myisam_repair_threads_basic_64.result | 8 +- .../r/myisam_sort_buffer_size_basic.result | 184 - .../r/myisam_sort_buffer_size_basic_32.result | 8 +- .../r/myisam_sort_buffer_size_basic_64.result | 8 +- .../r/myisam_stats_method_basic.result | 30 +- .../suite/sys_vars/r/named_pipe_basic.result | 21 + .../sys_vars/r/net_buffer_length_basic.result | 16 +- .../sys_vars/r/net_read_timeout_basic.result | 9 +- .../r/net_retry_count_basic_32.result | 9 +- .../r/net_retry_count_basic_64.result | 9 +- .../sys_vars/r/net_write_timeout_basic.result | 9 +- mysql-test/suite/sys_vars/r/new_basic.result | 11 +- .../sys_vars/r/old_alter_table_basic.result | 40 + mysql-test/suite/sys_vars/r/old_basic.result | 21 + .../sys_vars/r/old_passwords_basic.result | 11 +- .../sys_vars/r/open_files_limit_basic.result | 21 + .../r/optimizer_prune_level_basic.result | 5 +- .../r/optimizer_search_depth_basic.result | 9 +- .../sys_vars/r/optimizer_switch_basic.result | 54 + .../suite/sys_vars/r/pid_file_basic.result | 21 + .../suite/sys_vars/r/plugin_dir_basic.result | 21 + mysql-test/suite/sys_vars/r/port_basic.result | 21 + .../r/preload_buffer_size_basic.result | 9 +- .../suite/sys_vars/r/profiling_basic.result | 40 + .../r/profiling_history_size_basic.result | 50 + .../sys_vars/r/protocol_version_basic.result | 21 + .../sys_vars/r/pseudo_thread_id_basic.result | 27 + .../r/query_alloc_block_size_basic_32.result | 31 +- .../r/query_alloc_block_size_basic_64.result | 37 +- .../r/query_cache_limit_basic_32.result | 1 - .../r/query_cache_limit_basic_64.result | 1 - .../query_cache_min_res_unit_basic_32.result | 3 - .../query_cache_min_res_unit_basic_64.result | 3 - .../sys_vars/r/query_cache_type_basic.result | 35 +- .../query_cache_wlock_invalidate_basic.result | 24 +- ...esult => query_prealloc_size_basic.result} | 12 +- .../r/query_prealloc_size_basic_32.result | 166 - .../suite/sys_vars/r/rand_seed1_basic.result | 27 + .../suite/sys_vars/r/rand_seed2_basic.result | 27 + .../r/range_alloc_block_size_basic_32.result | 11 +- .../r/range_alloc_block_size_basic_64.result | 21 +- .../sys_vars/r/read_buffer_size_basic.result | 86 +- .../suite/sys_vars/r/read_only_basic.result | 3 +- .../r/read_rnd_buffer_size_basic.result | 117 +- .../suite/sys_vars/r/relay_log_basic.result | 21 + .../sys_vars/r/relay_log_index_basic.result | 21 + .../r/relay_log_info_file_basic.result | 21 + .../r/relay_log_recovery_basic.result | 41 + .../r/relay_log_space_limit_basic.result | 21 + .../suite/sys_vars/r/report_host_basic.result | 21 + .../sys_vars/r/report_password_basic.result | 21 + .../suite/sys_vars/r/report_port_basic.result | 21 + .../suite/sys_vars/r/report_user_basic.result | 21 + .../sys_vars/r/rpl_init_slave_func.result | 12 +- .../r/rpl_recovery_rank_basic_32.result | 32 +- .../r/rpl_recovery_rank_basic_64.result | 35 +- .../sys_vars/r/secure_file_priv_basic.result | 21 + ...basic_64.result => server_id_basic.result} | 5 +- .../sys_vars/r/server_id_basic_32.result | 121 - .../r/shared_memory_base_name_basic.result | 21 + .../sys_vars/r/shared_memory_basic.result | 21 + .../r/skip_external_locking_basic.result | 21 + .../sys_vars/r/skip_networking_basic.result | 21 + .../r/skip_show_database_basic.result | 21 + .../r/slave_allow_batching_basic.result | 4 - .../sys_vars/r/slave_load_tmpdir_basic.result | 21 + .../sys_vars/r/slave_net_timeout_basic.result | 5 +- .../sys_vars/r/slave_skip_errors_basic.result | 21 + .../slave_transaction_retries_basic_32.result | 5 +- .../slave_transaction_retries_basic_64.result | 5 +- .../sys_vars/r/slow_launch_time_basic.result | 1 - .../r/slow_query_log_file_basic.result | 7 +- .../suite/sys_vars/r/socket_basic.result | 21 + .../r/sort_buffer_size_basic_32.result | 98 +- .../r/sort_buffer_size_basic_64.result | 98 +- .../sys_vars/r/sql_auto_is_null_basic.result | 62 +- .../sys_vars/r/sql_big_selects_basic.result | 24 +- .../sys_vars/r/sql_big_selects_func.result | 2 + .../sys_vars/r/sql_big_tables_basic.result | 27 +- .../sys_vars/r/sql_buffer_result_basic.result | 37 +- .../suite/sys_vars/r/sql_log_bin_basic.result | 22 +- .../suite/sys_vars/r/sql_log_off_basic.result | 27 +- .../suite/sys_vars/r/sql_log_off_func.result | 1 - .../sys_vars/r/sql_log_update_basic.result | 46 + .../r/sql_low_priority_updates_basic.result | 26 +- .../sys_vars/r/sql_max_join_size_basic.result | 61 + .../sys_vars/r/sql_max_join_size_func.result | 14 + .../suite/sys_vars/r/sql_mode_basic.result | 76 +- .../suite/sys_vars/r/sql_mode_func.result | 4 +- .../suite/sys_vars/r/sql_notes_basic.result | 27 +- .../r/sql_quote_show_create_basic.result | 27 +- .../sys_vars/r/sql_safe_updates_basic.result | 27 +- .../sys_vars/r/sql_select_limit_basic.result | 40 + .../r/sql_slave_skip_counter_basic.result | 13 +- .../sys_vars/r/sql_warnings_basic.result | 34 +- .../sys_vars/r/storage_engine_basic.result | 14 +- ...sic_32.result => sync_binlog_basic.result} | 1 - .../sys_vars/r/sync_binlog_basic_64.result | 109 - .../sys_vars/r/sync_master_info_basic.result | 47 + .../sys_vars/r/sync_relay_log_basic.result | 47 + .../r/sync_relay_log_info_basic.result | 47 + .../r/table_definition_cache_basic.result | 1 - .../r/table_lock_wait_timeout_basic.result | 1 - .../sys_vars/r/table_open_cache_basic.result | 1 - .../sys_vars/r/thread_cache_size_basic.result | 47 + .../r/thread_concurrency_basic.result | 21 + .../sys_vars/r/thread_stack_basic.result | 21 + .../suite/sys_vars/r/time_format_basic.result | 21 + ...basic_32.result => timestamp_basic.result} | 24 +- .../sys_vars/r/timestamp_basic_64.result | 68 - .../sys_vars/r/tmp_table_size_basic.result | 2 - ...ansaction_alloc_block_size_basic_32.result | 10 +- ...ansaction_alloc_block_size_basic_64.result | 20 +- .../sys_vars/r/tx_isolation_basic.result | 45 +- .../sys_vars/r/unique_checks_basic.result | 7 +- .../r/updatable_views_with_limit_basic.result | 2 +- ...ic_32.result => wait_timeout_basic.result} | 1 - .../sys_vars/r/wait_timeout_basic_64.result | 129 - mysql-test/suite/sys_vars/t/all_vars.test | 35 + .../t/auto_increment_increment_basic.test | 9 +- .../t/auto_increment_increment_func.test | 5 - .../t/auto_increment_offset_basic.test | 1 - .../t/auto_increment_offset_func.test | 7 - ...ommit_basic.test => autocommit_basic.test} | 11 +- .../sys_vars/t/autocommit_func-master.opt | 1 - .../suite/sys_vars/t/autocommit_func.test | 1 - .../t/automatic_sp_privileges_basic.test | 1 - .../suite/sys_vars/t/back_log_basic.test | 19 + .../suite/sys_vars/t/big_tables_basic.test | 8 +- .../t/character_set_client_basic.test | 13 +- .../sys_vars/t/character_set_client_func.test | 6 +- .../t/character_set_connection_basic.test | 3 - .../t/character_set_database_basic.test | 2 - .../t/character_set_database_func.test | 6 - .../t/character_set_filesystem_basic.test | 2 - .../t/character_set_server_basic.test | 9 +- .../sys_vars/t/character_sets_dir_basic.test | 24 + .../t/collation_connection_basic.test | 4 +- .../sys_vars/t/collation_database_basic.test | 5 +- .../sys_vars/t/collation_database_func.test | 3 - .../sys_vars/t/collation_server_basic.test | 4 +- .../sys_vars/t/completion_type_basic.test | 31 +- .../sys_vars/t/completion_type_func.test | 4 +- .../sys_vars/t/concurrent_insert_basic.test | 36 +- .../sys_vars/t/connect_timeout_basic.test | 1 - .../suite/sys_vars/t/date_format_basic.test | 18 + .../sys_vars/t/datetime_format_basic.test | 18 + mysql-test/suite/sys_vars/t/debug_basic.test | 22 + .../suite/sys_vars/t/debug_sync_basic.test | 21 + .../t/default_storage_engine_basic.test | 183 + .../sys_vars/t/default_week_format_basic.test | 1 - .../sys_vars/t/delay_key_write_basic.test | 7 +- .../sys_vars/t/delayed_insert_limit_func.test | 18 +- .../t/delayed_insert_timeout_basic.test | 2 - mysql-test/suite/sys_vars/t/disabled.def | 17 + .../t/div_precision_increment_basic.test | 1 - .../t/div_precision_increment_func.test | 5 +- .../t/engine_condition_pushdown_basic.test | 14 +- .../sys_vars/t/event_scheduler_basic.test | 4 +- .../sys_vars/t/expire_logs_days_basic.test | 1 - mysql-test/suite/sys_vars/t/flush_basic.test | 2 - .../suite/sys_vars/t/flush_time_basic.test | 50 + .../sys_vars/t/foreign_key_checks_basic.test | 11 +- .../sys_vars/t/foreign_key_checks_func.test | 3 - .../sys_vars/t/ft_boolean_syntax_basic.test | 3 - .../sys_vars/t/ft_boolean_syntax_func.test | 8 +- .../sys_vars/t/ft_max_word_len_basic.test | 19 + .../sys_vars/t/ft_min_word_len_basic.test | 19 + .../t/ft_query_expansion_limit_basic.test | 19 + .../sys_vars/t/ft_stopword_file_basic.test | 19 + .../sys_vars/t/general_log_file_basic.test | 3 +- .../suite/sys_vars/t/general_log_func.test | 17 +- .../t/group_concat_max_len_basic.test | 9 +- .../sys_vars/t/have_profiling_basic.test | 23 + .../suite/sys_vars/t/identity_basic.test | 1 - .../t/ignore_builtin_innodb_basic.test | 19 + .../suite/sys_vars/t/init_connect_basic.test | 5 + .../suite/sys_vars/t/init_file_basic.test | 19 + .../t/innodb_commit_concurrency_basic.test | 31 +- .../innodb_concurrency_tickets_basic.test} | 0 .../innodb_concurrency_tickets_basic_32.test | 9 - .../innodb_concurrency_tickets_basic_64.test | 9 - .../innodb_max_purge_lag_basic.test} | 0 .../t/innodb_max_purge_lag_basic_32.test | 9 - .../t/innodb_max_purge_lag_basic_64.test | 9 - .../sys_vars/t/innodb_support_xa_basic.test | 8 +- .../innodb_sync_spin_loops_basic.test} | 0 .../t/innodb_sync_spin_loops_basic_32.test | 9 - .../t/innodb_sync_spin_loops_basic_64.test | 9 - .../sys_vars/t/innodb_table_locks_basic.test | 6 +- .../suite/sys_vars/t/insert_id_basic.test | 2 - .../sys_vars/t/interactive_timeout_basic.test | 9 +- .../t/keep_files_on_create_basic.test | 11 +- .../key_buffer_size_basic.test} | 55 +- .../sys_vars/t/key_buffer_size_basic_32.test | 9 - .../sys_vars/t/key_buffer_size_basic_64.test | 9 - .../sys_vars/t/key_buffer_size_func.test | 5 - .../key_cache_block_size_basic.test} | 7 - .../t/key_cache_block_size_basic_32.test | 9 - .../t/key_cache_block_size_basic_64.test | 9 - .../key_cache_division_limit_basic.test} | 5 - .../t/key_cache_division_limit_basic_32.test | 9 - .../t/key_cache_division_limit_basic_64.test | 9 - .../sys_vars/t/large_files_support_basic.test | 19 + .../sys_vars/t/large_page_size_basic.test | 23 + .../suite/sys_vars/t/large_pages_basic.test | 19 + .../sys_vars/t/last_insert_id_basic.test | 30 + .../suite/sys_vars/t/lc_messages_basic.test | 35 + .../sys_vars/t/lc_messages_dir_basic.test | 23 + .../suite/sys_vars/t/lc_time_names_basic.test | 36 +- .../sys_vars/t/locked_in_memory_basic.test | 20 + mysql-test/suite/sys_vars/t/log_basic.test | 8 +- .../suite/sys_vars/t/log_bin_basic.test | 19 + ...log_bin_trust_function_creators_basic.test | 10 +- .../log_bin_trust_routine_creators_basic.test | 164 - .../suite/sys_vars/t/log_error_basic.test | 18 + .../suite/sys_vars/t/log_output_basic.test | 29 +- .../log_queries_not_using_indexes_basic.test | 25 +- .../sys_vars/t/log_slave_updates_basic.test | 19 + .../sys_vars/t/log_slow_queries_basic.test | 170 + .../sys_vars/t/long_query_time_basic.test | 11 +- .../t/low_priority_updates_basic.test | 12 +- .../t/lower_case_file_system_basic.test | 23 + .../t/lower_case_table_names_basic.test | 23 + .../sys_vars/t/max_allowed_packet_basic.test | 12 +- .../max_binlog_cache_size_basic.test} | 4 - .../t/max_binlog_cache_size_basic_32.test | 9 - .../t/max_binlog_cache_size_basic_64.test | 9 - .../sys_vars/t/max_binlog_size_basic.test | 4 - .../sys_vars/t/max_connections_basic.test | 5 - .../sys_vars/t/max_delayed_threads_basic.test | 14 +- .../sys_vars/t/max_error_count_basic.test | 10 +- .../max_heap_table_size_basic.test} | 13 +- .../t/max_heap_table_size_basic_32.test | 9 - .../t/max_heap_table_size_basic_64.test | 9 - .../t/max_insert_delayed_threads_basic.test | 81 +- .../suite/sys_vars/t/max_join_size_basic.test | 42 + .../t/max_length_for_sort_data_basic.test | 8 +- .../t/max_prepared_stmt_count_basic.test | 2 - .../sys_vars/t/max_relay_log_size_basic.test | 5 - .../sys_vars/t/max_sort_length_basic.test | 8 +- .../t/max_sp_recursion_depth_basic.test | 8 +- .../t/max_user_connections_basic.test | 15 +- .../suite/sys_vars/t/maximum_basic-master.opt | 3 + .../suite/sys_vars/t/maximum_basic.test | 20 + .../t/myisam_data_pointer_size_basic.test | 7 +- .../t/myisam_data_pointer_size_func.test | 2 + .../sys_vars/t/myisam_mmap_size_basic.test | 18 + .../t/myisam_recover_options_basic.test | 18 + .../sys_vars/t/myisam_stats_method_basic.test | 24 +- .../suite/sys_vars/t/named_pipe_basic.test | 19 + .../sys_vars/t/net_buffer_length_basic.test | 18 +- .../sys_vars/t/net_read_timeout_basic.test | 9 +- .../sys_vars/t/net_write_timeout_basic.test | 9 +- mysql-test/suite/sys_vars/t/new_basic.test | 11 +- .../sys_vars/t/old_alter_table_basic.test | 33 + mysql-test/suite/sys_vars/t/old_basic.test | 19 + .../suite/sys_vars/t/old_passwords_basic.test | 11 +- .../sys_vars/t/open_files_limit_basic.test | 24 + .../t/optimizer_prune_level_basic.test | 5 +- .../t/optimizer_search_depth_basic.test | 9 +- .../sys_vars/t/optimizer_switch_basic.test | 41 + .../suite/sys_vars/t/pid_file_basic.test | 23 + .../suite/sys_vars/t/plugin_dir_basic.test | 29 + mysql-test/suite/sys_vars/t/port_basic.test | 23 + .../sys_vars/t/preload_buffer_size_basic.test | 9 +- .../suite/sys_vars/t/profiling_basic.test | 35 + .../t/profiling_history_size_basic.test | 43 + .../sys_vars/t/protocol_version_basic.test | 18 + .../sys_vars/t/pseudo_thread_id_basic.test | 32 + .../sys_vars/t/query_cache_type_basic.test | 31 +- .../t/query_cache_wlock_invalidate_basic.test | 14 +- .../query_prealloc_size_basic.test} | 9 +- .../t/query_prealloc_size_basic_32.test | 9 - .../t/query_prealloc_size_basic_64.test | 9 - .../suite/sys_vars/t/rand_seed1_basic.test | 30 + .../suite/sys_vars/t/rand_seed2_basic.test | 30 + .../sys_vars/t/read_buffer_size_basic.test | 33 +- .../suite/sys_vars/t/read_only_basic.test | 3 +- .../t/read_rnd_buffer_size_basic.test | 54 +- .../suite/sys_vars/t/relay_log_basic.test | 19 + .../sys_vars/t/relay_log_index_basic.test | 19 + .../sys_vars/t/relay_log_info_file_basic.test | 19 + .../sys_vars/t/relay_log_recovery_basic.test | 39 + .../t/relay_log_space_limit_basic.test | 19 + .../suite/sys_vars/t/report_host_basic.test | 19 + .../sys_vars/t/report_password_basic.test | 19 + .../suite/sys_vars/t/report_port_basic.test | 24 + .../suite/sys_vars/t/report_user_basic.test | 19 + .../suite/sys_vars/t/rpl_init_slave_func.test | 4 +- .../sys_vars/t/secure_file_priv_basic.test | 23 + .../server_id_basic.test} | 7 +- .../suite/sys_vars/t/server_id_basic_32.test | 9 - .../suite/sys_vars/t/server_id_basic_64.test | 9 - .../t/shared_memory_base_name_basic.test | 24 + .../suite/sys_vars/t/shared_memory_basic.test | 19 + .../t/skip_external_locking_basic.test | 18 + .../sys_vars/t/skip_networking_basic.test | 18 + .../sys_vars/t/skip_show_database_basic.test | 18 + .../t/slave_allow_batching_basic.test | 2 - .../sys_vars/t/slave_exec_mode_basic.test | 1 + .../sys_vars/t/slave_load_tmpdir_basic.test | 24 + .../sys_vars/t/slave_net_timeout_basic.test | 7 +- .../sys_vars/t/slave_skip_errors_basic.test | 19 + .../sys_vars/t/slow_launch_time_basic.test | 1 - .../sys_vars/t/slow_query_log_file_basic.test | 3 +- mysql-test/suite/sys_vars/t/socket_basic.test | 23 + .../sys_vars/t/sql_auto_is_null_basic.test | 59 +- .../sys_vars/t/sql_big_selects_basic.test | 12 +- .../sys_vars/t/sql_big_tables_basic.test | 13 +- .../sys_vars/t/sql_buffer_result_basic.test | 21 +- .../suite/sys_vars/t/sql_log_bin_basic.test | 10 +- .../suite/sys_vars/t/sql_log_off_basic.test | 13 +- .../sys_vars/t/sql_log_update_basic.test | 35 + .../t/sql_low_priority_updates_basic.test | 18 +- .../sys_vars/t/sql_max_join_size_basic.test | 42 + .../suite/sys_vars/t/sql_mode_basic.test | 50 +- .../suite/sys_vars/t/sql_notes_basic.test | 13 +- .../t/sql_quote_show_create_basic.test | 13 +- .../sys_vars/t/sql_safe_updates_basic.test | 13 +- .../sys_vars/t/sql_select_limit_basic.test | 33 + .../t/sql_slave_skip_counter_basic.test | 9 +- .../suite/sys_vars/t/sql_warnings_basic.test | 20 +- .../sys_vars/t/storage_engine_basic.test | 17 +- .../sync_binlog_basic.test} | 1 - .../sys_vars/t/sync_binlog_basic_32.test | 9 - .../sys_vars/t/sync_binlog_basic_64.test | 9 - .../sys_vars/t/sync_master_info_basic.test | 43 + .../sys_vars/t/sync_relay_log_basic.test | 44 + .../sys_vars/t/sync_relay_log_info_basic.test | 44 + .../t/table_definition_cache_basic.test | 1 - .../t/table_lock_wait_timeout_basic.test | 1 - .../sys_vars/t/table_open_cache_basic.test | 3 - .../sys_vars/t/thread_cache_size_basic.test | 43 + .../sys_vars/t/thread_concurrency_basic.test | 19 + .../suite/sys_vars/t/thread_stack_basic.test | 23 + .../suite/sys_vars/t/time_format_basic.test | 18 + .../timestamp_basic.test} | 16 +- .../suite/sys_vars/t/timestamp_basic_32.test | 9 - .../suite/sys_vars/t/timestamp_basic_64.test | 9 - .../suite/sys_vars/t/tx_isolation_basic.test | 43 +- .../suite/sys_vars/t/unique_checks_basic.test | 10 - .../t/updatable_views_with_limit_basic.test | 2 +- .../wait_timeout_basic.test} | 2 - .../sys_vars/t/wait_timeout_basic_32.test | 9 - .../sys_vars/t/wait_timeout_basic_64.test | 9 - mysql-test/t/archive.test | 2 +- mysql-test/t/bug46080-master.opt | 2 +- mysql-test/t/bug46080.test | 2 + mysql-test/t/change_user.test | 2 +- mysql-test/t/date_formats.test | 139 +- mysql-test/t/ddl_i18n_koi8r.test | 26 +- mysql-test/t/ddl_i18n_utf8.test | 26 +- mysql-test/t/errors.test | 10 +- mysql-test/t/events_2.test | 9 - mysql-test/t/events_bugs.test | 8 +- mysql-test/t/index_merge_myisam.test | 1 - mysql-test/t/innodb_bug42101-nonzero.test | 4 +- mysql-test/t/innodb_bug42101.test | 4 +- mysql-test/t/key_cache.test | 10 +- mysql-test/t/mysql-bug45236-master.opt | 1 + mysql-test/t/mysql_locale_posix.test | 16 +- mysql-test/t/mysqld--help-notwin.test | 8 + mysql-test/t/mysqld--help-win.test | 8 + mysql-test/t/mysqldump.test | 30 +- mysql-test/t/partition_key_cache.test | 2 +- mysql-test/t/profiling.test | 4 - mysql-test/t/query_cache.test | 8 +- mysql-test/t/select_safe.test | 4 +- mysql-test/t/show_check.test | 2 +- mysql-test/t/sp.test | 7 +- mysql-test/t/user_limits.test | 2 +- mysql-test/t/user_var.test | 2 - mysql-test/t/variables.test | 37 +- mysys/my_getopt.c | 327 +- mysys/safemalloc.c | 2 +- mysys/typelib.c | 222 +- sql-common/my_time.c | 6 +- sql/CMakeLists.txt | 4 +- sql/Makefile.am | 8 +- sql/debug_sync.cc | 84 +- sql/event_scheduler.cc | 2 +- sql/events.cc | 159 +- sql/events.h | 36 +- sql/ha_ndbcluster.cc | 403 +- sql/ha_ndbcluster.h | 6 - sql/ha_ndbcluster_binlog.cc | 80 +- sql/ha_ndbcluster_binlog.h | 2 - sql/ha_partition.cc | 6 +- sql/handler.cc | 13 +- sql/handler.h | 7 +- sql/item.cc | 2 +- sql/item_cmpfunc.cc | 2 +- sql/item_func.cc | 63 +- sql/item_sum.cc | 6 +- sql/item_timefunc.h | 2 +- sql/keycaches.cc | 163 + sql/keycaches.h | 41 + sql/log.cc | 58 +- sql/log.h | 21 +- sql/log_event.cc | 66 +- sql/log_event_old.cc | 30 +- sql/mysql_priv.h | 195 +- sql/mysqld.cc | 2332 ++------- sql/opt_range.cc | 16 +- sql/repl_failsafe.cc | 7 +- sql/repl_failsafe.h | 4 +- sql/rpl_record.cc | 1 - sql/rpl_rli.cc | 8 +- sql/rpl_rli.h | 3 +- sql/set_var.cc | 4281 ++--------------- sql/set_var.h | 1503 +----- sql/share/errmsg-utf8.txt | 8 +- sql/share/errmsg.txt | 8 +- sql/slave.cc | 19 +- sql/slave.h | 1 + sql/sp_head.cc | 20 +- sql/sql_acl.cc | 25 +- sql/sql_acl.h | 1 + sql/sql_base.cc | 22 +- sql/sql_builtin.cc.in | 12 +- sql/sql_cache.cc | 23 +- sql/sql_cache.h | 1 - sql/sql_class.cc | 60 +- sql/sql_class.h | 61 +- sql/sql_connect.cc | 15 +- sql/sql_cursor.cc | 2 +- sql/sql_delete.cc | 4 +- sql/sql_derived.cc | 4 +- sql/sql_insert.cc | 6 +- sql/sql_lex.h | 14 +- sql/sql_parse.cc | 96 +- sql/sql_partition.cc | 12 +- sql/sql_plugin.cc | 649 ++- sql/sql_plugin.h | 7 +- sql/sql_prepare.cc | 1 + sql/sql_profile.cc | 4 +- sql/sql_repl.cc | 151 +- sql/sql_select.cc | 48 +- sql/sql_select.h | 4 +- sql/sql_show.cc | 26 +- sql/sql_table.cc | 44 +- sql/sql_test.cc | 7 +- sql/sql_union.cc | 8 +- sql/sql_update.cc | 19 +- sql/sql_view.cc | 9 - sql/sql_yacc.yy | 11 +- sql/strfunc.cc | 263 +- sql/structs.h | 2 - sql/sys_vars.cc | 2738 +++++++++++ sql/sys_vars.h | 1600 ++++++ sql/sys_vars_shared.h | 81 + sql/table.cc | 6 - sql/tztime.cc | 4 + sql/unireg.h | 4 +- storage/heap/hp_create.c | 6 - storage/heap/hp_rkey.c | 2 +- storage/myisam/ft_parser.c | 8 +- storage/myisam/ft_static.c | 18 +- storage/myisam/ha_myisam.cc | 92 +- storage/myisam/ha_myisam.h | 5 +- storage/myisam/mi_check.c | 3 +- storage/myisam/mi_static.c | 6 +- strings/longlong2str.c | 10 +- strings/longlong2str_asm.c | 2 +- strings/my_vsnprintf.c | 38 +- tests/mysql_client_test.c | 6 +- unittest/mysys/my_vsnprintf-t.c | 10 +- vio/viosocket.c | 21 +- 739 files changed, 16098 insertions(+), 14754 deletions(-) create mode 100644 mysql-test/include/have_thread_concurrency.inc create mode 100644 mysql-test/include/mysqld--help.inc create mode 100644 mysql-test/r/mysqld--help-notwin.result create mode 100644 mysql-test/r/mysqld--help-win.result delete mode 100644 mysql-test/suite/sys_vars/README create mode 100644 mysql-test/suite/sys_vars/r/all_vars.result rename mysql-test/suite/sys_vars/r/{auto_commit_basic.result => autocommit_basic.result} (89%) create mode 100644 mysql-test/suite/sys_vars/r/back_log_basic.result create mode 100644 mysql-test/suite/sys_vars/r/character_sets_dir_basic.result create mode 100644 mysql-test/suite/sys_vars/r/date_format_basic.result create mode 100644 mysql-test/suite/sys_vars/r/datetime_format_basic.result create mode 100644 mysql-test/suite/sys_vars/r/debug_basic.result create mode 100644 mysql-test/suite/sys_vars/r/debug_sync_basic.result create mode 100644 mysql-test/suite/sys_vars/r/default_storage_engine_basic.result create mode 100644 mysql-test/suite/sys_vars/r/flush_time_basic.result create mode 100644 mysql-test/suite/sys_vars/r/ft_max_word_len_basic.result create mode 100644 mysql-test/suite/sys_vars/r/ft_min_word_len_basic.result create mode 100644 mysql-test/suite/sys_vars/r/ft_query_expansion_limit_basic.result create mode 100644 mysql-test/suite/sys_vars/r/ft_stopword_file_basic.result create mode 100644 mysql-test/suite/sys_vars/r/have_profiling_basic.result create mode 100644 mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result create mode 100644 mysql-test/suite/sys_vars/r/init_file_basic.result rename mysql-test/suite/sys_vars/r/{innodb_concurrency_tickets_basic_64.result => innodb_concurrency_tickets_basic.result} (92%) delete mode 100644 mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result rename mysql-test/suite/sys_vars/r/{innodb_max_purge_lag_basic_64.result => innodb_max_purge_lag_basic.result} (97%) delete mode 100644 mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result rename mysql-test/suite/sys_vars/r/{innodb_sync_spin_loops_basic_64.result => innodb_sync_spin_loops_basic.result} (97%) delete mode 100644 mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result rename mysql-test/suite/sys_vars/r/{key_buffer_size_basic_32.result => key_buffer_size_basic.result} (68%) delete mode 100644 mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result rename mysql-test/suite/sys_vars/r/{key_cache_block_size_basic_64.result => key_cache_block_size_basic.result} (90%) delete mode 100644 mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result rename mysql-test/suite/sys_vars/r/{key_cache_division_limit_basic_64.result => key_cache_division_limit_basic.result} (94%) delete mode 100644 mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/large_files_support_basic.result create mode 100644 mysql-test/suite/sys_vars/r/large_page_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/large_pages_basic.result create mode 100644 mysql-test/suite/sys_vars/r/last_insert_id_basic.result create mode 100644 mysql-test/suite/sys_vars/r/lc_messages_basic.result create mode 100644 mysql-test/suite/sys_vars/r/lc_messages_dir_basic.result create mode 100644 mysql-test/suite/sys_vars/r/locked_in_memory_basic.result create mode 100644 mysql-test/suite/sys_vars/r/log_bin_basic.result delete mode 100644 mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result create mode 100644 mysql-test/suite/sys_vars/r/log_error_basic.result create mode 100644 mysql-test/suite/sys_vars/r/log_slave_updates_basic.result create mode 100644 mysql-test/suite/sys_vars/r/log_slow_queries_basic.result create mode 100644 mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result create mode 100644 mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result rename mysql-test/suite/sys_vars/r/{max_binlog_cache_size_basic_32.result => max_binlog_cache_size_basic.result} (91%) delete mode 100644 mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result rename mysql-test/suite/sys_vars/r/{max_heap_table_size_basic_32.result => max_heap_table_size_basic.result} (88%) delete mode 100644 mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/max_join_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/maximum_basic.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_mmap_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result delete mode 100644 mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/named_pipe_basic.result create mode 100644 mysql-test/suite/sys_vars/r/old_alter_table_basic.result create mode 100644 mysql-test/suite/sys_vars/r/old_basic.result create mode 100644 mysql-test/suite/sys_vars/r/open_files_limit_basic.result create mode 100644 mysql-test/suite/sys_vars/r/optimizer_switch_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pid_file_basic.result create mode 100644 mysql-test/suite/sys_vars/r/plugin_dir_basic.result create mode 100644 mysql-test/suite/sys_vars/r/port_basic.result create mode 100644 mysql-test/suite/sys_vars/r/profiling_basic.result create mode 100644 mysql-test/suite/sys_vars/r/profiling_history_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/protocol_version_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result rename mysql-test/suite/sys_vars/r/{query_prealloc_size_basic_64.result => query_prealloc_size_basic.result} (93%) delete mode 100644 mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/rand_seed1_basic.result create mode 100644 mysql-test/suite/sys_vars/r/rand_seed2_basic.result create mode 100644 mysql-test/suite/sys_vars/r/relay_log_basic.result create mode 100644 mysql-test/suite/sys_vars/r/relay_log_index_basic.result create mode 100644 mysql-test/suite/sys_vars/r/relay_log_info_file_basic.result create mode 100644 mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result create mode 100644 mysql-test/suite/sys_vars/r/relay_log_space_limit_basic.result create mode 100644 mysql-test/suite/sys_vars/r/report_host_basic.result create mode 100644 mysql-test/suite/sys_vars/r/report_password_basic.result create mode 100644 mysql-test/suite/sys_vars/r/report_port_basic.result create mode 100644 mysql-test/suite/sys_vars/r/report_user_basic.result create mode 100644 mysql-test/suite/sys_vars/r/secure_file_priv_basic.result rename mysql-test/suite/sys_vars/r/{server_id_basic_64.result => server_id_basic.result} (92%) delete mode 100644 mysql-test/suite/sys_vars/r/server_id_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result create mode 100644 mysql-test/suite/sys_vars/r/shared_memory_basic.result create mode 100644 mysql-test/suite/sys_vars/r/skip_external_locking_basic.result create mode 100644 mysql-test/suite/sys_vars/r/skip_networking_basic.result create mode 100644 mysql-test/suite/sys_vars/r/skip_show_database_basic.result create mode 100644 mysql-test/suite/sys_vars/r/slave_load_tmpdir_basic.result create mode 100644 mysql-test/suite/sys_vars/r/slave_skip_errors_basic.result create mode 100644 mysql-test/suite/sys_vars/r/socket_basic.result create mode 100644 mysql-test/suite/sys_vars/r/sql_log_update_basic.result create mode 100644 mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/sql_select_limit_basic.result rename mysql-test/suite/sys_vars/r/{sync_binlog_basic_32.result => sync_binlog_basic.result} (97%) delete mode 100644 mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/sync_master_info_basic.result create mode 100644 mysql-test/suite/sys_vars/r/sync_relay_log_basic.result create mode 100644 mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result create mode 100644 mysql-test/suite/sys_vars/r/thread_cache_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/thread_concurrency_basic.result create mode 100644 mysql-test/suite/sys_vars/r/thread_stack_basic.result create mode 100644 mysql-test/suite/sys_vars/r/time_format_basic.result rename mysql-test/suite/sys_vars/r/{timestamp_basic_32.result => timestamp_basic.result} (87%) delete mode 100644 mysql-test/suite/sys_vars/r/timestamp_basic_64.result rename mysql-test/suite/sys_vars/r/{wait_timeout_basic_32.result => wait_timeout_basic.result} (98%) delete mode 100644 mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result create mode 100644 mysql-test/suite/sys_vars/t/all_vars.test rename mysql-test/suite/sys_vars/t/{auto_commit_basic.test => autocommit_basic.test} (96%) delete mode 100644 mysql-test/suite/sys_vars/t/autocommit_func-master.opt create mode 100644 mysql-test/suite/sys_vars/t/back_log_basic.test create mode 100644 mysql-test/suite/sys_vars/t/character_sets_dir_basic.test create mode 100644 mysql-test/suite/sys_vars/t/date_format_basic.test create mode 100644 mysql-test/suite/sys_vars/t/datetime_format_basic.test create mode 100644 mysql-test/suite/sys_vars/t/debug_basic.test create mode 100644 mysql-test/suite/sys_vars/t/debug_sync_basic.test create mode 100644 mysql-test/suite/sys_vars/t/default_storage_engine_basic.test create mode 100644 mysql-test/suite/sys_vars/t/disabled.def create mode 100644 mysql-test/suite/sys_vars/t/flush_time_basic.test create mode 100644 mysql-test/suite/sys_vars/t/ft_max_word_len_basic.test create mode 100644 mysql-test/suite/sys_vars/t/ft_min_word_len_basic.test create mode 100644 mysql-test/suite/sys_vars/t/ft_query_expansion_limit_basic.test create mode 100644 mysql-test/suite/sys_vars/t/ft_stopword_file_basic.test create mode 100644 mysql-test/suite/sys_vars/t/have_profiling_basic.test create mode 100644 mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test create mode 100644 mysql-test/suite/sys_vars/t/init_file_basic.test rename mysql-test/suite/sys_vars/{inc/innodb_concurrency_tickets_basic.inc => t/innodb_concurrency_tickets_basic.test} (100%) delete mode 100644 mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test rename mysql-test/suite/sys_vars/{inc/innodb_max_purge_lag_basic.inc => t/innodb_max_purge_lag_basic.test} (100%) delete mode 100644 mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test rename mysql-test/suite/sys_vars/{inc/innodb_sync_spin_loops_basic.inc => t/innodb_sync_spin_loops_basic.test} (100%) delete mode 100644 mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test rename mysql-test/suite/sys_vars/{inc/key_buffer_size_basic.inc => t/key_buffer_size_basic.test} (78%) delete mode 100644 mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test rename mysql-test/suite/sys_vars/{inc/key_cache_block_size_basic.inc => t/key_cache_block_size_basic.test} (95%) delete mode 100644 mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test rename mysql-test/suite/sys_vars/{inc/key_cache_division_limit_basic.inc => t/key_cache_division_limit_basic.test} (97%) delete mode 100644 mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/large_files_support_basic.test create mode 100644 mysql-test/suite/sys_vars/t/large_page_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/large_pages_basic.test create mode 100644 mysql-test/suite/sys_vars/t/last_insert_id_basic.test create mode 100644 mysql-test/suite/sys_vars/t/lc_messages_basic.test create mode 100644 mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test create mode 100644 mysql-test/suite/sys_vars/t/locked_in_memory_basic.test create mode 100644 mysql-test/suite/sys_vars/t/log_bin_basic.test delete mode 100644 mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test create mode 100644 mysql-test/suite/sys_vars/t/log_error_basic.test create mode 100644 mysql-test/suite/sys_vars/t/log_slave_updates_basic.test create mode 100644 mysql-test/suite/sys_vars/t/log_slow_queries_basic.test create mode 100644 mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test create mode 100644 mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test rename mysql-test/suite/sys_vars/{inc/max_binlog_cache_size_basic.inc => t/max_binlog_cache_size_basic.test} (97%) delete mode 100644 mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test rename mysql-test/suite/sys_vars/{inc/max_heap_table_size_basic.inc => t/max_heap_table_size_basic.test} (95%) delete mode 100644 mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/max_join_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/maximum_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/maximum_basic.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test create mode 100644 mysql-test/suite/sys_vars/t/named_pipe_basic.test create mode 100644 mysql-test/suite/sys_vars/t/old_alter_table_basic.test create mode 100644 mysql-test/suite/sys_vars/t/old_basic.test create mode 100644 mysql-test/suite/sys_vars/t/open_files_limit_basic.test create mode 100644 mysql-test/suite/sys_vars/t/optimizer_switch_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pid_file_basic.test create mode 100644 mysql-test/suite/sys_vars/t/plugin_dir_basic.test create mode 100644 mysql-test/suite/sys_vars/t/port_basic.test create mode 100644 mysql-test/suite/sys_vars/t/profiling_basic.test create mode 100644 mysql-test/suite/sys_vars/t/profiling_history_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/protocol_version_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test rename mysql-test/suite/sys_vars/{inc/query_prealloc_size_basic.inc => t/query_prealloc_size_basic.test} (98%) delete mode 100644 mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/rand_seed1_basic.test create mode 100644 mysql-test/suite/sys_vars/t/rand_seed2_basic.test create mode 100644 mysql-test/suite/sys_vars/t/relay_log_basic.test create mode 100644 mysql-test/suite/sys_vars/t/relay_log_index_basic.test create mode 100644 mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test create mode 100644 mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test create mode 100644 mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test create mode 100644 mysql-test/suite/sys_vars/t/report_host_basic.test create mode 100644 mysql-test/suite/sys_vars/t/report_password_basic.test create mode 100644 mysql-test/suite/sys_vars/t/report_port_basic.test create mode 100644 mysql-test/suite/sys_vars/t/report_user_basic.test create mode 100644 mysql-test/suite/sys_vars/t/secure_file_priv_basic.test rename mysql-test/suite/sys_vars/{inc/server_id_basic.inc => t/server_id_basic.test} (98%) delete mode 100644 mysql-test/suite/sys_vars/t/server_id_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/server_id_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test create mode 100644 mysql-test/suite/sys_vars/t/shared_memory_basic.test create mode 100644 mysql-test/suite/sys_vars/t/skip_external_locking_basic.test create mode 100644 mysql-test/suite/sys_vars/t/skip_networking_basic.test create mode 100644 mysql-test/suite/sys_vars/t/skip_show_database_basic.test create mode 100644 mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test create mode 100644 mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test create mode 100644 mysql-test/suite/sys_vars/t/socket_basic.test create mode 100644 mysql-test/suite/sys_vars/t/sql_log_update_basic.test create mode 100644 mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/sql_select_limit_basic.test rename mysql-test/suite/sys_vars/{inc/sync_binlog_basic.inc => t/sync_binlog_basic.test} (98%) delete mode 100644 mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/sync_master_info_basic.test create mode 100644 mysql-test/suite/sys_vars/t/sync_relay_log_basic.test create mode 100644 mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test create mode 100644 mysql-test/suite/sys_vars/t/thread_cache_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/thread_concurrency_basic.test create mode 100644 mysql-test/suite/sys_vars/t/thread_stack_basic.test create mode 100644 mysql-test/suite/sys_vars/t/time_format_basic.test rename mysql-test/suite/sys_vars/{inc/timestamp_basic.inc => t/timestamp_basic.test} (94%) delete mode 100644 mysql-test/suite/sys_vars/t/timestamp_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/timestamp_basic_64.test rename mysql-test/suite/sys_vars/{inc/wait_timeout_basic.inc => t/wait_timeout_basic.test} (98%) delete mode 100644 mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test create mode 100644 mysql-test/t/mysql-bug45236-master.opt create mode 100644 mysql-test/t/mysqld--help-notwin.test create mode 100644 mysql-test/t/mysqld--help-win.test mode change 100755 => 100644 sql/CMakeLists.txt create mode 100644 sql/keycaches.cc create mode 100644 sql/keycaches.h create mode 100644 sql/sys_vars.cc create mode 100644 sql/sys_vars.h create mode 100644 sql/sys_vars_shared.h diff --git a/.bzrignore b/.bzrignore index 351417a4353..668a8824576 100644 --- a/.bzrignore +++ b/.bzrignore @@ -3070,3 +3070,5 @@ libmysqld/rpl_handler.cc libmysqld/debug_sync.cc libmysqld/rpl_handler.cc dbug/tests +libmysqld/sys_vars.cc +libmysqld/keycaches.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e8c7db3c2a..b3efe39a988 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,11 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS}) SET(ENGINE_BUILD_TYPE "NONE") ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC) IF (ENGINE_BUILD_TYPE STREQUAL "STATIC") - SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${ENGINE_LOWER}_plugin") + IF(MYSQL_PLUGIN_MANDATORY) + SET (mysql_mandatory_plugins "${mysql_mandatory_plugins}builtin_${ENGINE_LOWER}_plugin,") + ELSE(MYSQL_PLUGIN_MANDATORY) + SET (mysql_optional_plugins "${mysql_optional_plugins}builtin_${ENGINE_LOWER}_plugin,") + ENDIF(MYSQL_PLUGIN_MANDATORY) SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${ENGINE_LOWER}) SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE") SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE) @@ -274,12 +278,12 @@ ENDFOREACH(SUBDIR ${STORAGE_SUBDIRS}) # Special handling for partition(not really pluggable) IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE) SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_PARTITION_STORAGE_ENGINE") - SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin") + SET (mysql_optional_plugins "${mysql_optional_plugins}builtin_partition_plugin,") ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE) ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS}) -# Now write out our mysql_plugin_defs struct +# Now write out our mysql_mandatory_plugins/mysql_optional_plugins structs CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc @ONLY) diff --git a/Makefile.am b/Makefile.am index d98db920701..88322206575 100644 --- a/Makefile.am +++ b/Makefile.am @@ -204,10 +204,6 @@ test-bt-debug: @PERL@ ./mysql-test-run.pl --comment=debug --force --timer \ --skip-ndbcluster --skip-rpl --report-features $(EXP) -test-bt-debug-fast: - -test-bt-debug-fast: - # Keep these for a while test-pl: test test-full-pl: test-full diff --git a/client/mysql.cc b/client/mysql.cc index be3c13bf362..726b06b02be 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -100,7 +100,7 @@ extern "C" { #define vidattr(A) {} // Can't get this to work #endif -#ifdef FN_NO_CASE_SENCE +#ifdef FN_NO_CASE_SENSE #define cmp_database(cs,A,B) my_strcasecmp((cs), (A), (B)) #else #define cmp_database(cs,A,B) strcmp((A),(B)) @@ -3652,7 +3652,7 @@ static void print_warnings() mysql_store_result_for_lazy(&result); /* Bail out when no warnings */ - if (!(num_rows= mysql_num_rows(result))) + if (!result || !(num_rows= mysql_num_rows(result))) goto end; cur= mysql_fetch_row(result); diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 79ee7fe9990..43107d838ee 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -2227,7 +2227,7 @@ do_result_format_version(struct st_command *command) long version; static DYNAMIC_STRING ds_version; const struct command_arg result_format_args[] = { - "version", ARG_STRING, TRUE, &ds_version, "Version to use", + {"version", ARG_STRING, TRUE, &ds_version, "Version to use"} }; DBUG_ENTER("do_result_format_version"); @@ -6154,6 +6154,8 @@ void init_win_path_patterns() "$MYSQL_TMP_DIR", "$MYSQLTEST_VARDIR", "$MASTER_MYSOCK", + "$MYSQL_SHAREDIR", + "$MYSQL_LIBDIR", "./test/" }; int num_paths= sizeof(paths)/sizeof(char*); int i; @@ -7102,7 +7104,7 @@ int util_query(MYSQL* org_mysql, const char* query){ cur_con->util_mysql= mysql; } - return mysql_query(mysql, query); + DBUG_RETURN(mysql_query(mysql, query)); } @@ -7740,6 +7742,7 @@ int main(int argc, char **argv) cur_file->file_name= my_strdup("", MYF(MY_WME)); cur_file->lineno= 1; } + var_set_string("MYSQLTEST_FILE", cur_file->file_name); init_re(); ps_protocol_enabled= ps_protocol; sp_protocol_enabled= sp_protocol; diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 5d15afeda99..9fcfc031281 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -460,7 +460,11 @@ dnl Although this is "pretty", it breaks libmysqld build ]) ]) ]) - mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]" + m4_ifdef([$9],[ + mysql_mandatory_plugins="$mysql_mandatory_plugins [builtin_]$2[_plugin]," + ],[ + mysql_optional_plugins="$mysql_optional_plugins [builtin_]$2[_plugin]," + ]) [with_plugin_]$2=yes AC_MSG_RESULT([yes]) m4_ifdef([$11],[ diff --git a/configure.in b/configure.in index 402280392ba..644463bbfd9 100644 --- a/configure.in +++ b/configure.in @@ -2875,7 +2875,7 @@ case $SYSTEM_TYPE in fi # if there is no readline, but we want to build with readline, we fail - if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"] + if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"] then AC_MSG_ERROR([This commercially licensed MySQL source package can't be built with libreadline. Please use --with-libedit to use @@ -3015,8 +3015,8 @@ AC_SUBST(server_scripts) AC_SUBST(mysql_plugin_dirs) AC_SUBST(mysql_plugin_libs) -AC_SUBST(mysql_plugin_defs) - +AC_SUBST(mysql_optional_plugins) +AC_SUBST(mysql_mandatory_plugins) # Now that sql_client_dirs and sql_server_dirs are stable, determine the union. # We support client-only builds by "--without-server", but not vice versa, diff --git a/include/config-netware.h b/include/config-netware.h index adde3c4fbd2..a4465ea177a 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -100,7 +100,7 @@ extern "C" { #define USE_OLD_FUNCTIONS 1 /* no case sensitivity */ -#define FN_NO_CASE_SENCE 1 +#define FN_NO_CASE_SENSE 1 /* the thread alarm is not used */ #define DONT_USE_THR_ALARM 1 diff --git a/include/config-win.h b/include/config-win.h index 68248c09bef..f8d51165bc2 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -318,10 +318,8 @@ inline ulonglong double2ulonglong(double d) #define strcasecmp stricmp #define strncasecmp strnicmp -#ifdef NOT_USED #define HAVE_SNPRINTF /* Gave link error */ -#define _snprintf snprintf -#endif +#define snprintf _snprintf #ifdef _MSC_VER #define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ @@ -360,7 +358,7 @@ inline ulonglong double2ulonglong(double d) #define FN_ROOTDIR "\\" #define FN_DEVCHAR ':' #define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ -#define FN_NO_CASE_SENCE /* Files are not case-sensitive */ +#define FN_NO_CASE_SENSE /* Files are not case-sensitive */ #define OS_FILE_LIMIT UINT_MAX /* No limit*/ #define DO_NOT_REMOVE_THREAD_WRAPPERS diff --git a/include/ft_global.h b/include/ft_global.h index 752371d6bc6..ad56bce678b 100644 --- a/include/ft_global.h +++ b/include/ft_global.h @@ -28,6 +28,8 @@ extern "C" { #define HA_FT_MAXBYTELEN 254 #define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3) +#define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|" + typedef struct st_ft_info FT_INFO; struct _ft_vft { @@ -51,7 +53,7 @@ extern const char *ft_precompiled_stopwords[]; extern ulong ft_min_word_len; extern ulong ft_max_word_len; extern ulong ft_query_expansion_limit; -extern char ft_boolean_syntax[15]; +extern const char *ft_boolean_syntax; extern struct st_mysql_ftparser ft_default_parser; int ft_init_stopwords(void); diff --git a/include/keycache.h b/include/keycache.h index 4e715dda88d..cd5c83e144e 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -87,10 +87,10 @@ typedef struct st_key_cache initializing the key cache. */ - ulonglong param_buff_size; /* size the memory allocated for the cache */ - ulong param_block_size; /* size of the blocks in the key cache */ - ulong param_division_limit; /* min. percentage of warm blocks */ - ulong param_age_threshold; /* determines when hot block is downgraded */ + ulonglong param_buff_size; /* size the memory allocated for the cache */ + ulonglong param_block_size; /* size of the blocks in the key cache */ + ulonglong param_division_limit; /* min. percentage of warm blocks */ + ulonglong param_age_threshold; /* determines when hot block is downgraded */ /* Statistics variables. These are reset in reset_key_cache_counters(). */ ulong global_blocks_changed; /* number of currently dirty blocks */ diff --git a/include/m_string.h b/include/m_string.h index a6a36f32ca4..f1c42b0cda4 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -215,7 +215,7 @@ extern char *str2int(const char *src,int radix,long lower,long upper, long *val); longlong my_strtoll10(const char *nptr, char **endptr, int *error); #if SIZEOF_LONG == SIZEOF_LONG_LONG -#define longlong2str(A,B,C) int2str((A),(B),(C),1) +#define ll2str(A,B,C,D) int2str((A),(B),(C),(D)) #define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) #undef strtoll #define strtoll(A,B,C) strtol((A),(B),(C)) @@ -228,7 +228,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error); #endif #else #ifdef HAVE_LONG_LONG -extern char *longlong2str(longlong val,char *dst,int radix); +extern char *ll2str(longlong val,char *dst,int radix, int upcase); extern char *longlong10_to_str(longlong val,char *dst,int radix); #if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO)) extern longlong strtoll(const char *str, char **ptr, int base); @@ -236,6 +236,7 @@ extern ulonglong strtoull(const char *str, char **ptr, int base); #endif #endif #endif +#define longlong2str(A,B,C) ll2str((A),(B),(C),1) /* my_vsnprintf.c */ @@ -260,6 +261,13 @@ typedef struct st_mysql_lex_string LEX_STRING; #define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1)) #define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string LEX_CSTRING; + /* SPACE_INT is a word that contains only spaces */ #if SIZEOF_INT == 4 #define SPACE_INT 0x20202020 diff --git a/include/my_base.h b/include/my_base.h index 70bd9b5e073..226a6c44733 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -275,17 +275,6 @@ enum ha_base_keytype { #define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */ #define HA_USES_BLOCK_SIZE ((uint) 32768) #define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */ -#if MYSQL_VERSION_ID < 0x50200 -/* - Key has a part that can have end space. If this is an unique key - we have to handle it differently from other unique keys as we can find - many matching rows for one key (because end space are not compared) -*/ -#define HA_END_SPACE_KEY 0 /* was: 4096 */ -#else -#error HA_END_SPACE_KEY is obsolete, please remove it -#endif - /* These flags can be added to key-seg-flag */ diff --git a/include/my_getopt.h b/include/my_getopt.h index 7cbad607aac..32380efe289 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -32,6 +32,7 @@ C_MODE_START #define GET_ENUM 12 #define GET_SET 13 #define GET_DOUBLE 14 +#define GET_FLAGSET 15 #define GET_ASK_ADDR 128 #define GET_TYPE_MASK 127 @@ -42,24 +43,40 @@ struct st_typelib; struct my_option { - const char *name; /* Name of the option */ - int id; /* unique id or short option */ - const char *comment; /* option comment, for autom. --help */ - uchar **value; /* The variable value */ - uchar **u_max_value; /* The user def. max variable value */ - struct st_typelib *typelib; /* Pointer to possible values */ - ulong var_type; - enum get_opt_arg_type arg_type; - longlong def_value; /* Default value */ - longlong min_value; /* Min allowed value */ - longlong max_value; /* Max allowed value */ - longlong sub_size; /* Subtract this from given value */ - long block_size; /* Value should be a mult. of this */ - void *app_type; /* To be used by an application */ + const char *name; /**< Name of the option. name=NULL + marks the end of the my_option[] + array. + */ + int id; /**< For 0255 no short option + is created, but a long option still + can be identified uniquely in the + my_get_one_option() callback. + If an opton needs neither special + treatment in the my_get_one_option() + nor one-letter short equivalent + use id=0 + */ + const char *comment; /**< option comment, for autom. --help. + if it's NULL the option is not + visible in --help. + */ + uchar **value; /**< A pointer to the variable value */ + uchar **u_max_value; /**< The user def. max variable value */ + struct st_typelib *typelib; /**< Pointer to possible values */ + ulong var_type; /**< GET_BOOL, GET_ULL, etc */ + enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */ + longlong def_value; /**< Default value */ + longlong min_value; /**< Min allowed value (for numbers) */ + longlong max_value; /**< Max allowed value (for numbers) */ + longlong sub_size; /**< Unused */ + long block_size; /**< Value should be a mult. of this (for numbers) */ + void *app_type; /**< To be used by an application */ }; -typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * ); -typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... ); +typedef my_bool (*my_get_one_option) (int, const struct my_option *, char * ); +typedef void (*my_error_reporter) (enum loglevel level, const char *format, ... ); extern char *disabled_my_option; extern my_bool my_getopt_print_errors; @@ -78,6 +95,8 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, my_bool *fix); longlong getopt_ll_limit_value(longlong, const struct my_option *, my_bool *fix); +double getopt_double_limit_value(double num, const struct my_option *optp, + my_bool *fix); my_bool getopt_compare_strings(const char *s, const char *t, uint length); C_MODE_END diff --git a/include/my_global.h b/include/my_global.h index 255958e08b0..27fac096c19 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -93,11 +93,35 @@ #define HAVE_PSI_INTERFACE #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ -/* Make it easier to add conditionl code for windows */ +/* Make it easier to add conditional code in _expressions_ */ #ifdef __WIN__ -#define IF_WIN(A,B) (A) +#define IF_WIN(A,B) A #else -#define IF_WIN(A,B) (B) +#define IF_WIN(A,B) B +#endif + +#ifdef __NETWARE__ +#define IF_NETWARE(A,B) A +#else +#define IF_NETWARE(A,B) B +#endif + +#ifndef DBUG_OFF +#define IF_DBUG(A,B) A +#else +#define IF_DBUG(A,B) B +#endif + +#ifdef HAVE_purify +#define IF_PURIFY(A,B) A +#else +#define IF_PURIFY(A,B) B +#endif + +#ifdef DISABLE_GRANT_OPTIONS +#define IF_DISABLE_GRANT_OPTIONS(A,B) A +#else +#define IF_DISABLE_GRANT_OPTIONS(A,B) B #endif #ifndef EMBEDDED_LIBRARY @@ -249,6 +273,8 @@ #define inline_test_2(X) inline_test_1(X) #if inline_test_2(inline) != 1 #define HAVE_INLINE +#else +#warning No "inline" support in C, all "static inline" functions will be instantiated in every .o file!!! #endif #undef inline_test_2 #undef inline_test_1 @@ -489,8 +515,7 @@ C_MODE_END #define compile_time_assert(X) \ do \ { \ - char compile_time_assert[(X) ? 1 : -1] \ - __attribute__ ((unused)); \ + typedef char compile_time_assert[(X) ? 1 : -1]; \ } while(0) #endif @@ -787,7 +812,7 @@ typedef SOCKET_SIZE_TYPE size_socket; #endif /* #define EXT_IN_LIBNAME */ -/* #define FN_NO_CASE_SENCE */ +/* #define FN_NO_CASE_SENSE */ /* #define FN_UPPER_CASE TRUE */ /* @@ -810,7 +835,7 @@ typedef SOCKET_SIZE_TYPE size_socket; /* Typical record cash */ #define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD) /* Typical key cash */ -#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD) +#define KEY_CACHE_SIZE (uint) (8*1024*1024) /* Default size of a key cache block */ #define KEY_CACHE_BLOCK_SIZE (uint) 1024 diff --git a/include/my_pthread.h b/include/my_pthread.h index 2558f8d5986..343bff6ba72 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -154,8 +154,7 @@ int pthread_join(pthread_t thread, void **value_ptr); #define pthread_detach_this_thread() #define pthread_condattr_init(A) #define pthread_condattr_destroy(A) -/* per the platform's documentation */ -#define pthread_yield() Sleep(0) +#define pthread_yield() SwitchToThread() #else /* Normal threads */ diff --git a/include/my_time.h b/include/my_time.h index 58995f1bf62..829cb706bb6 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -74,12 +74,12 @@ typedef long my_time_t; TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND) my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, - ulong flags, int *was_cut); + ulonglong flags, int *was_cut); enum enum_mysql_timestamp_type str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, - uint flags, int *was_cut); + ulonglong flags, int *was_cut); longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, - uint flags, int *was_cut); + ulonglong flags, int *was_cut); ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *); ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *); diff --git a/include/myisam.h b/include/myisam.h index e6404cb5405..d590a29c1b3 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -251,7 +251,7 @@ typedef struct st_columndef /* column information */ extern char * myisam_log_filename; /* Name of logfile */ extern ulong myisam_block_size; -extern ulong myisam_concurrent_insert; +extern uint myisam_concurrent_insert; extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_off_t myisam_max_temp_length; extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size; diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 0ea1d0974c2..4fef9e9ec0b 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -233,6 +233,10 @@ extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; +my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, + my_ulonglong cur_set, my_ulonglong default_set, + const char *str, uint length, + char **err_pos, uint *err_len); typedef struct st_mysql_rows { struct st_mysql_rows *next; MYSQL_ROW data; diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index f158dc20999..cd5b6f2fe2c 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -675,6 +675,7 @@ struct st_mysql_value const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); int (*val_real)(struct st_mysql_value *, double *realbuf); int (*val_int)(struct st_mysql_value *, long long *intbuf); + int (*is_unsigned)(struct st_mysql_value *); }; diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp index b7dd7bc0032..709430db3fb 100644 --- a/include/mysql/plugin.h.pp +++ b/include/mysql/plugin.h.pp @@ -144,6 +144,7 @@ struct st_mysql_value const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); int (*val_real)(struct st_mysql_value *, double *realbuf); int (*val_int)(struct st_mysql_value *, long long *intbuf); + int (*is_unsigned)(struct st_mysql_value *); }; int thd_in_lock_tables(const void* thd); int thd_tablespace_op(const void* thd); diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h index ad344864c34..9e5fe7f9c9f 100644 --- a/include/mysql/service_my_snprintf.h +++ b/include/mysql/service_my_snprintf.h @@ -53,7 +53,7 @@ can be 'l', 'll', or 'z'. Supported formats are 's' (null pointer is accepted, printed as - "(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x', + "(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x', 'o', 'X', 'p' (works as 0x%x). Standard syntax for positional arguments $n is supported. diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h index eae1424238b..b98e72e298e 100644 --- a/include/sslopt-longopts.h +++ b/include/sslopt-longopts.h @@ -19,8 +19,8 @@ #ifdef HAVE_OPENSSL {"ssl", OPT_SSL_SSL, - "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.", - (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, + "Enable SSL for connection (automatically enabled with other flags).", + (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-ca", OPT_SSL_CA, "CA file in PEM format (check OpenSSL docs, implies --ssl).", @@ -43,7 +43,7 @@ {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, "Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.", (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif #endif /* HAVE_OPENSSL */ #endif /* SSLOPT_LONGOPTS_INCLUDED */ diff --git a/include/typelib.h b/include/typelib.h index 46106d1bdab..c6a7f7a42e9 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -36,4 +36,9 @@ extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; +my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, + my_ulonglong cur_set, my_ulonglong default_set, + const char *str, uint length, + char **err_pos, uint *err_len); + #endif /* _typelib_h */ diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 65b8e12bc26..2eeb092b759 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -117,7 +117,8 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/sql_class.cc ../sql/sql_crypt.cc ../sql/sql_cursor.cc ../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_derived.cc ../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_handler.cc - ../sql/sql_help.cc ../sql/sql_insert.cc ../sql/sql_lex.cc + ../sql/sql_help.cc ../sql/sql_insert.cc + ../sql/sql_lex.cc ../sql/keycaches.cc ../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc ../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc ../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index ec73741eaaf..c3e3086b446 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -67,7 +67,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \ scheduler.cc sql_connect.cc sql_parse.cc \ sql_prepare.cc sql_derived.cc sql_rename.cc \ - sql_select.cc sql_do.cc sql_show.cc set_var.cc \ + sql_select.cc sql_do.cc sql_show.cc set_var.cc sys_vars.cc \ sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \ sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \ unireg.cc uniques.cc sql_union.cc hash_filo.cc \ @@ -79,7 +79,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ sql_tablespace.cc \ rpl_injector.cc my_user.c partition_info.cc \ sql_servers.cc event_parse_data.cc sql_signal.cc \ - rpl_handler.cc + rpl_handler.cc keycaches.cc libmysqld_int_a_SOURCES= $(libmysqld_sources) nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 1d6c3ee18bf..2a425edb379 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -506,6 +506,9 @@ int init_embedded_server(int argc, char **argv, char **groups) mysql_server_end(); return 1; } + + mysql_data_home= mysql_real_data_home; + mysql_data_home_len= mysql_real_data_home_len; /* Get default temporary directory */ opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */ @@ -614,7 +617,7 @@ void *create_embedded_thd(int client_flag) /* TODO - add init_connect command execution */ if (thd->variables.max_join_size == HA_POS_ERROR) - thd->options |= OPTION_BIG_SELECTS; + thd->variables.option_bits |= OPTION_BIG_SELECTS; thd->proc_info=0; // Remove 'login' thd->command=COM_SLEEP; thd->version=refresh_version; diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index b1d0e85c70e..2686cd36355 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -99,7 +99,8 @@ TEST_DIRS = t r include std_data std_data/parts collections \ suite/ndb suite/ndb/t suite/ndb/r \ 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/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 # Used by dist-hook and install-data-local to copy all # test files into either dist or install directory diff --git a/mysql-test/collections/mysql-next-mr.push b/mysql-test/collections/mysql-next-mr.push index 97101d5994c..7699e2532c3 100644 --- a/mysql-test/collections/mysql-next-mr.push +++ b/mysql-test/collections/mysql-next-mr.push @@ -1,4 +1,4 @@ -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=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=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog diff --git a/mysql-test/extra/rpl_tests/rpl_charset.test b/mysql-test/extra/rpl_tests/rpl_charset.test index 8bcb60b0227..d884bd1178c 100644 --- a/mysql-test/extra/rpl_tests/rpl_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_charset.test @@ -114,9 +114,7 @@ set @@character_set_server=latin5; select @@character_set_server; select @@character_set_server; -# ONE_SHOT on not charset/collation stuff is not allowed --- error 1382 -set one_shot max_join_size=10; +set one_shot max_join_size=1000000; # Test of wrong character set numbers; error 1115; diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc index d15dd56b35d..ad42615511a 100644 --- a/mysql-test/include/diff_tables.inc +++ b/mysql-test/include/diff_tables.inc @@ -60,6 +60,7 @@ disable_query_log; --error 0,1 --remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2 + let $_diff_table=$diff_table_2; let $_diff_i=2; while ($_diff_i) { diff --git a/mysql-test/include/have_thread_concurrency.inc b/mysql-test/include/have_thread_concurrency.inc new file mode 100644 index 00000000000..730edbf4895 --- /dev/null +++ b/mysql-test/include/have_thread_concurrency.inc @@ -0,0 +1,10 @@ +disable_query_log; +disable_result_log; +set @have_thread_concurrency=0; +select @have_thread_concurrency:=1 from information_schema.global_variables where variable_name='thread_concurrency'; +if (`select @have_thread_concurrency = 0`) +{ + skip Need @@thread_concurrency; +} +enable_result_log; +enable_query_log; diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc index d137b0957c0..ef116c5addc 100644 --- a/mysql-test/include/index_merge1.inc +++ b/mysql-test/include/index_merge1.inc @@ -303,7 +303,7 @@ drop table t4; create table t4 (a int); insert into t4 values (1),(4),(3); set @save_join_buffer_size=@@join_buffer_size; -set join_buffer_size= 4000; +set join_buffer_size= 4096; explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) from t0 as A force index(i1,i2), t0 as B force index (i1,i2) where (A.key1 < 500000 or A.key2 < 3) diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc new file mode 100644 index 00000000000..11945e6606a --- /dev/null +++ b/mysql-test/include/mysqld--help.inc @@ -0,0 +1,39 @@ +# +# mysqld --help +# +--source include/not_embedded.inc + +# +# force lower-case-table-names=1 (linux/macosx have different defaults) +# force symbolic-links=0 (valgrind build has a different default) +# +exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1; + +perl; + @skipvars=qw/basedir character-sets-dir datadir + general-log-file language lc-messages-dir + log log-slow-queries pid-file plugin-dir slave-load-tmpdir + slow-query-log-file tmpdir open-files-limit/; + @plugins=qw/innodb ndb ndbcluster safemalloc debug temp-pool + thread-concurrency super-large-pages/; + $re1=join('|', @skipvars, @plugins); + $re2=join('|', @plugins); + $skip=0; + open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die; + while () { + next if 1../The following groups are read/; + next if /^($re1) /; + next if /^($re2)-/; + $skip=0 if /^ -/; + $skip=1 if / --($re2)\b/; + # fixes for 32-bit + s/\b4294967295\b/18446744073709551615/; + s/\b2146435072\b/9223372036853727232/; + s/\b196608\b/262144/; + next if /use --skip-(use-)?symbolic-links to disable/; # for valgrind, again + next if $skip; + print; + } + close F; +EOF + diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc index 7ce97b42158..0cc1ebb21d6 100644 --- a/mysql-test/include/query_cache.inc +++ b/mysql-test/include/query_cache.inc @@ -114,7 +114,7 @@ connection default; # This should be 'YES'. SHOW VARIABLES LIKE 'have_query_cache'; -SET GLOBAL query_cache_size = 200000; +SET GLOBAL query_cache_size = 204800; flush status; SET @@autocommit=1; eval SET SESSION STORAGE_ENGINE = $engine_type; diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc index baa041aa058..769cd535f37 100644 --- a/mysql-test/include/query_cache_sql_prepare.inc +++ b/mysql-test/include/query_cache_sql_prepare.inc @@ -27,7 +27,7 @@ connect (con1,localhost,root,,test,$MASTER_MYPORT,); connection default; set @initial_query_cache_size = @@global.query_cache_size; -set @@global.query_cache_size=100000; +set @@global.query_cache_size=102400; flush status; --disable_warnings drop table if exists t1; @@ -178,7 +178,7 @@ show status like 'Qcache_hits'; # then QC is re-enabled for more EXECUTE. --echo ---- switch to connection default ---- connection default; -set global query_cache_size=100000; +set global query_cache_size=102400; # Expect to see additional Qcache_hits. # The fact that the QC was temporary disabled should have no affect # except that the first execute will not hit results from the @@ -235,7 +235,7 @@ prepare stmt3 from "select * from t1 where c1=10"; --echo ---- switch to connection default ---- connection default; # then QC is enabled at EXECUTE -set global query_cache_size=100000; +set global query_cache_size=102400; show status like 'Qcache_hits'; execute stmt1; show status like 'Qcache_hits'; @@ -260,7 +260,7 @@ connection default; set global query_cache_size=0; prepare stmt1 from "select * from t1 where c1=?"; # then QC is enabled at EXECUTE -set global query_cache_size=100000; +set global query_cache_size=102400; show status like 'Qcache_hits'; set @a=1; execute stmt1 using @a; @@ -509,7 +509,7 @@ execute stmt; set @@global.query_cache_size=0; alter table t1 add column b int; execute stmt; -set @@global.query_cache_size=100000; +set @@global.query_cache_size=102400; execute stmt; execute stmt; --echo # diff --git a/mysql-test/include/show_slave_status2.inc b/mysql-test/include/show_slave_status2.inc index 9c4e14c62c2..7e970b31d8e 100644 --- a/mysql-test/include/show_slave_status2.inc +++ b/mysql-test/include/show_slave_status2.inc @@ -3,6 +3,6 @@ # masked out log positions ---replace_result $MASTER_MYPORT MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT $DEFAULT_MASTER_PORT 3306 --replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 03c0acfd2d0..27f4891c39e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -68,8 +68,8 @@ use My::File::Path; # Patched version of File::Path use File::Basename; use File::Copy; use File::Find; -use File::Temp qw /tempdir/; -use File::Spec::Functions qw / splitdir /; +use File::Temp qw/tempdir/; +use File::Spec::Functions qw/splitdir/; use My::Platform; use My::SafeProcess; use My::ConfigFactory; @@ -118,6 +118,8 @@ END { } } +sub env_or_val($$) { defined $ENV{$_[0]} ? $ENV{$_[0]} : $_[1] } + my $path_config_file; # The generated config file, var/my.cnf # Visual Studio produces executables in different sub-directories based on the @@ -126,7 +128,7 @@ 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,binlog,federated,rpl,rpl_ndb,ndb,innodb"; +my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose @@ -213,7 +215,7 @@ my $start_only; my $opt_wait_all; my $opt_repeat= 1; my $opt_retry= 3; -my $opt_retry_failure= 2; +my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2); my $opt_strace_client; @@ -242,9 +244,9 @@ our %mysqld_variables; my $source_dist= 0; -my $opt_max_save_core= $ENV{MTR_MAX_SAVE_CORE} || 5; -my $opt_max_save_datadir= $ENV{MTR_MAX_SAVE_DATADIR} || 20; -my $opt_max_test_fail= $ENV{MTR_MAX_TEST_FAIL} || 10; +my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5); +my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20); +my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10); my $opt_parallel= $ENV{MTR_PARALLEL} || 1; @@ -783,11 +785,12 @@ sub set_vardir { sub command_line_setup { my $opt_comment; my $opt_usage; + my $opt_list_options; # Read the command line options # Note: Keep list, and the order, in sync with usage at end of this file Getopt::Long::Configure("pass_through"); - GetOptions( + my %options=( # Control what engine/variation to run 'embedded-server' => \$opt_embedded_server, 'ps-protocol' => \$opt_ps_protocol, @@ -905,9 +908,13 @@ sub command_line_setup { 'timediff' => \&report_option, 'help|h' => \$opt_usage, - ) or usage("Can't read options"); + 'list-options' => \$opt_list_options, + ); + + GetOptions(%options) or usage("Can't read options"); usage("") if $opt_usage; + list_options(\%options) if $opt_list_options; # -------------------------------------------------------------------------- # Setup verbosity @@ -1925,7 +1932,6 @@ sub environment_setup { split(':', $ENV{'LIBPATH'}) : ()); mtr_debug("LIBPATH: $ENV{'LIBPATH'}"); - $ENV{'CHARSETSDIR'}= $path_charsetsdir; $ENV{'UMASK'}= "0660"; # The octal *string* $ENV{'UMASK_DIR'}= "0770"; # The octal *string* @@ -1943,9 +1949,11 @@ sub environment_setup { $ENV{'LC_COLLATE'}= "C"; $ENV{'USE_RUNNING_SERVER'}= using_extern(); $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; - $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'} || 3306; + $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'}; $ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir; $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir; + $ENV{'MYSQL_LIBDIR'}= "$basedir/lib"; + $ENV{'MYSQL_SHAREDIR'}= $path_language; # ---------------------------------------------------- # Setup env for NDB @@ -3784,7 +3792,7 @@ sub start_check_warnings ($$) { mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld')); - mtr_add_arg($args, "--skip-safemalloc"); + mtr_add_arg($args, "--loose-skip-safemalloc"); mtr_add_arg($args, "--test-file=%s", "include/check-warnings.test"); mtr_add_arg($args, "--verbose"); @@ -4208,7 +4216,7 @@ sub mysqld_arguments ($$$) { if ( $opt_valgrind_mysqld ) { - mtr_add_arg($args, "--skip-safemalloc"); + mtr_add_arg($args, "--loose-skip-safemalloc"); if ( $mysql_version_id < 50100 ) { @@ -4993,7 +5001,7 @@ sub gdb_arguments { my $type= shift; # Write $args to gdb init file - my $str= join(" ", @$$args); + my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args; my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type"; # Remove the old gdbinit file @@ -5057,7 +5065,7 @@ sub ddd_arguments { my $type= shift; # Write $args to ddd init file - my $str= join(" ", @$$args); + my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args; my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type"; # Remove the old gdbinit file @@ -5122,8 +5130,8 @@ sub debugger_arguments { # vc[express] /debugexe exe arg1 .. argn # Add /debugexe and name of the exe before args - unshift(@$$args, "/debugexe"); unshift(@$$args, "$$exe"); + unshift(@$$args, "/debugexe"); # Set exe to debuggername $$exe= $debugger; @@ -5392,3 +5400,15 @@ HERE } +sub list_options ($) { + my $hash= shift; + + for (keys %$hash) { + s/([:=].*|[+!])$//; + s/\|/\n--/g; + print "--$_\n" unless /list-options/; + } + + exit(1); +} + diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 08618f81808..b3a634b07e2 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12707,7 +12707,7 @@ DATA_LENGTH AVG_ROW_LENGTH 8700 4350 DROP TABLE t1; SET @save_join_buffer_size= @@join_buffer_size; -SET @@join_buffer_size= 8228; +SET @@join_buffer_size= 8192; CREATE TABLE t1(a CHAR(255)) ENGINE=archive; INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), diff --git a/mysql-test/r/bug46080.result b/mysql-test/r/bug46080.result index 2173768cdad..f1abcde7766 100644 --- a/mysql-test/r/bug46080.result +++ b/mysql-test/r/bug46080.result @@ -8,6 +8,8 @@ CREATE TABLE t1(a CHAR(255)); INSERT INTO t1 VALUES ('a'); SET @@SESSION.sort_buffer_size=5*16*1000000; SET @@SESSION.max_heap_table_size=5*1000000; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '5000000' # Must not crash. SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a; DROP TABLE t1; diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result index b59298727c5..600ed84c3c9 100644 --- a/mysql-test/r/cache_innodb.result +++ b/mysql-test/r/cache_innodb.result @@ -134,7 +134,7 @@ connection default SHOW VARIABLES LIKE 'have_query_cache'; Variable_name Value have_query_cache YES -SET GLOBAL query_cache_size = 200000; +SET GLOBAL query_cache_size = 204800; flush status; SET @@autocommit=1; SET SESSION STORAGE_ENGINE = InnoDB; diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result index f8d5d900a80..1ed7fcbb8fa 100644 --- a/mysql-test/r/change_user.result +++ b/mysql-test/r/change_user.result @@ -18,7 +18,7 @@ change_user SELECT @@session.sql_big_selects; @@session.sql_big_selects 0 -SET @@global.max_join_size = -1; +SET @@global.max_join_size = 18446744073709551615; SET @@session.max_join_size = default; change_user SELECT @@session.sql_big_selects; diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index b0b8316fe33..432b9b14a85 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -15,71 +15,6 @@ variable_name variable_value DATETIME_FORMAT %Y-%m-%d %H:%i:%s DATE_FORMAT %d.%m.%Y TIME_FORMAT %H.%i.%s -SET time_format='%H%i%s'; -SET time_format='%H:%i:%s.%f'; -SET time_format='%h-%i-%s.%f%p'; -SET time_format='%h:%i:%s.%f %p'; -SET time_format='%h:%i:%s%p'; -SET date_format='%Y%m%d'; -SET date_format='%Y.%m.%d'; -SET date_format='%d.%m.%Y'; -SET date_format='%m-%d-%Y'; -set datetime_format= '%Y%m%d%H%i%s'; -set datetime_format= '%Y-%m-%d %H:%i:%s'; -set datetime_format= '%m-%d-%y %H:%i:%s.%f'; -set datetime_format= '%d-%m-%Y %h:%i:%s%p'; -set datetime_format= '%H:%i:%s %Y-%m-%d'; -set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; -set datetime_format= '%h:%i:%s %p %Y-%m-%d'; -set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; -SELECT variable_name, variable_value -FROM information_schema.session_variables -WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') -ORDER BY variable_name; -variable_name variable_value -DATETIME_FORMAT %h:%i:%s.%f %p %Y-%m-%d -DATE_FORMAT %m-%d-%Y -TIME_FORMAT %h:%i:%s%p -SET time_format='%h:%i:%s'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s' -SET time_format='%H %i:%s'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%H %i:%s' -SET time_format='%H::%i:%s'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%H::%i:%s' -SET time_format='%H:%i:%s%f'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%f' -SET time_format='%H:%i.%f:%s'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i.%f:%s' -SET time_format='%H:%i:%s%p'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%p' -SET time_format='%h:%i:%s.%f %p %Y-%m-%d'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s.%f %p %Y-%m-%d' -SET time_format='%H%i%s.%f'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%H%i%s.%f' -SET time_format='%H:%i-%s.%f'; -ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i-%s.%f' -SET date_format='%d.%m.%d'; -ERROR 42000: Variable 'date_format' can't be set to the value of '%d.%m.%d' -SET datetime_format='%h.%m.%y %d.%i.%s'; -ERROR 42000: Variable 'datetime_format' can't be set to the value of '%h.%m.%y %d.%i.%s' -set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d'; -ERROR 42000: Variable 'datetime_format' can't be set to the value of '%H:%i:%s.%f %p %Y-%m-%d' -set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d'; -SET SESSION datetime_format=default; -select @@global.datetime_format, @@session.datetime_format; -@@global.datetime_format @@session.datetime_format -%H:%i:%s %Y-%m-%d %H:%i:%s %Y-%m-%d -SET GLOBAL datetime_format=default; -SET SESSION datetime_format=default; -select @@global.datetime_format, @@session.datetime_format; -@@global.datetime_format @@session.datetime_format -%Y-%m-%d %H:%i:%s %Y-%m-%d %H:%i:%s -SET GLOBAL date_format=default; -SET GLOBAL time_format=default; -SET GLOBAL datetime_format=default; -SET time_format=default; -SET date_format=default; -SET datetime_format=default; select str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')); str_to_date(concat('15-01-2001',' 2:59:58.999'), diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index b5863b94026..79474b960f5 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -109,10 +109,10 @@ SET sql_quote_show_create= _utf8 x'5452C39C45'; ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE' SET sql_quote_show_create=_latin1 x'5452DC45'; ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE' -SET sql_quote_show_create='TR.E'; -ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR.E' -SET sql_quote_show_create=TR.E; -ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'E' +SET sql_quote_show_create='TRÜE'; +ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE' +SET sql_quote_show_create=TRÜE; +ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE' SET NAMES binary; SET sql_quote_show_create= _binary x'5452C39C45'; ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE' diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result index 44eaa668b04..530d8559f11 100644 --- a/mysql-test/r/events_2.result +++ b/mysql-test/r/events_2.result @@ -13,12 +13,6 @@ ERROR HY000: Incorrect AT value: 'definitely not a datetime' set names utf8; create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1; drop event задачка; -set event_scheduler=off; -ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL -set global event_scheduler=3; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of '3' -set global event_scheduler=disabled; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled' "DISABLE the scheduler. Testing that it does not work when the variable is 0" set global event_scheduler=off; select definer, name, db from mysql.event; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index efe6df41ac6..a5003c936e8 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -725,16 +725,15 @@ DROP USER mysqltest_u1@localhost; drop procedure if exists p; set @old_mode= @@sql_mode; -set @@sql_mode= pow(2,32)-1; +set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); create event e1 on schedule every 1 day do select 1; -select @@sql_mode; -@@sql_mode -REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH +select @@sql_mode into @full_mode; set @@sql_mode= @old_mode; -select replace(@full_mode, '?', 'NOT_USED') into @full_mode; +select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode; select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode; -select name from mysql.event where name = 'p' and sql_mode = @full_mode; +select name from mysql.event where name = 'e1' and sql_mode = @full_mode; name +e1 drop event e1; SET @old_server_id = @@GLOBAL.server_id; SET GLOBAL server_id = (1 << 32) - 1; diff --git a/mysql-test/r/have_profiling.require b/mysql-test/r/have_profiling.require index 453ee5bb084..54caeba1dae 100644 --- a/mysql-test/r/have_profiling.require +++ b/mysql-test/r/have_profiling.require @@ -1,2 +1,2 @@ Variable_name Value -have_profiling YES +have_profiling YES diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result index c639b20de91..922f7241102 100644 --- a/mysql-test/r/index_merge_myisam.result +++ b/mysql-test/r/index_merge_myisam.result @@ -341,9 +341,7 @@ drop table t4; create table t4 (a int); insert into t4 values (1),(4),(3); set @save_join_buffer_size=@@join_buffer_size; -set join_buffer_size= 4000; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '4000' +set join_buffer_size= 4096; explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) from t0 as A force index(i1,i2), t0 as B force index (i1,i2) where (A.key1 < 500000 or A.key2 < 3) @@ -1435,7 +1433,6 @@ select @@optimizer_switch; @@optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on set optimizer_switch=4; -ERROR 42000: Variable 'optimizer_switch' can't be set to the value of '4' set optimizer_switch=NULL; ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL' set optimizer_switch='default,index_merge'; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 7208c529e89..6cee55482e3 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1788,7 +1788,7 @@ Variable_name Value innodb_thread_concurrency 0 set global innodb_thread_concurrency=1001; Warnings: -Warning 1292 Truncated incorrect thread_concurrency value: '1001' +Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001' show variables like "innodb_thread_concurrency"; Variable_name Value innodb_thread_concurrency 1000 @@ -1809,7 +1809,7 @@ Variable_name Value innodb_concurrency_tickets 1000 set global innodb_concurrency_tickets=0; Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '0' +Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0' show variables like "innodb_concurrency_tickets"; Variable_name Value innodb_concurrency_tickets 1 diff --git a/mysql-test/r/innodb_bug42101-nonzero.result b/mysql-test/r/innodb_bug42101-nonzero.result index 277dfffdd35..f43cb9da239 100644 --- a/mysql-test/r/innodb_bug42101-nonzero.result +++ b/mysql-test/r/innodb_bug42101-nonzero.result @@ -1,5 +1,5 @@ set global innodb_commit_concurrency=0; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0' select @@innodb_commit_concurrency; @@innodb_commit_concurrency 1 @@ -16,7 +16,7 @@ select @@innodb_commit_concurrency; @@innodb_commit_concurrency 1 set global innodb_commit_concurrency=0; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0' select @@innodb_commit_concurrency; @@innodb_commit_concurrency 1 diff --git a/mysql-test/r/innodb_bug42101.result b/mysql-test/r/innodb_bug42101.result index 805097ffe9d..4e3367d5a54 100644 --- a/mysql-test/r/innodb_bug42101.result +++ b/mysql-test/r/innodb_bug42101.result @@ -3,12 +3,12 @@ select @@innodb_commit_concurrency; @@innodb_commit_concurrency 0 set global innodb_commit_concurrency=1; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1' select @@innodb_commit_concurrency; @@innodb_commit_concurrency 0 set global innodb_commit_concurrency=42; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '42' select @@innodb_commit_concurrency; @@innodb_commit_concurrency 0 diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 08d8059f61b..844109dba1f 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -274,8 +274,26 @@ Key_blocks_used 4 show status like 'key_blocks_unused'; Variable_name Value Key_blocks_unused KEY_BLOCKS_UNUSED +create table t1 (a int primary key); +cache index t1 in keycache2; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +insert t1 values (1),(2),(3),(4),(5),(6),(7),(8); set global keycache2.key_buffer_size=0; +select * from t1; +a +1 +2 +3 +4 +5 +6 +7 +8 +drop table t1; set global keycache3.key_buffer_size=100; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '100' set global keycache3.key_buffer_size=0; create table t1 (mytext text, FULLTEXT (mytext)); insert t1 values ('aaabbb'); @@ -334,8 +352,7 @@ test.t1 check status OK DROP TABLE t1,t2; set global key_cache_block_size= @my_key_cache_block_size; set @@global.key_buffer_size=0; -Warnings: -Warning 1438 Cannot drop default keycache +ERROR HY000: Cannot drop default keycache select @@global.key_buffer_size; @@global.key_buffer_size 2097152 diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result new file mode 100644 index 00000000000..623b4a119e4 --- /dev/null +++ b/mysql-test/r/mysqld--help-notwin.result @@ -0,0 +1,947 @@ +The following options may be given as the first argument: +--print-defaults Print the program argument list and exit +--no-defaults Don't read default options from any options file +--defaults-file=# Only read default options from the given file # +--defaults-extra-file=# Read this file after the global files are read + + --abort-slave-event-count=# + Option used by mysql-test for debugging and testing of + replication. + --allow-suspicious-udfs + Allows use of UDFs consisting of only one symbol xxx() + without corresponding xxx_init() or xxx_deinit(). That + also means that one can load any function from any + library, for example exit() from libc.so + -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode + will also set transaction isolation level 'serializable'. + --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, + OFF, FORCE (don't start if the plugin fails to load). + --auto-increment-increment[=#] + Auto-increment columns are incremented by this + --auto-increment-offset[=#] + Offset added to Auto-increment columns. Used when + auto-increment-increment != 1 + --automatic-sp-privileges + Creating and dropping stored procedures alters ACLs + (Defaults to on; use --skip-automatic-sp-privileges to disable.) + --back-log=# The number of outstanding connection requests MySQL can + have. This comes into play when the main MySQL thread + gets very many connection requests in a very short time + -b, --basedir=name Path to installation directory. All paths are usually + resolved relative to this + --big-tables Allow big result sets by saving all temporary sets on + file (Solves most 'table full' errors) + --bind-address=name IP address to bind to. + --binlog-cache-size=# + The size of the cache to hold the SQL statements for the + binary log during a transaction. If you often use big, + multi-statement transactions you can increase this to get + more performance + --binlog-do-db=name Tells the master it should log updates for the specified + database, and exclude all others not explicitly + mentioned. + --binlog-format=name + What form of binary logging the master will use: either + ROW for row-based binary logging, STATEMENT for + statement-based binary logging, or MIXED. MIXED is + statement-based binary logging except for those + statements where only row-based is correct: those which + involve user-defined functions (i.e. UDFs) or the UUID() + function; for those, row-based binary logging is + automatically used. If NDBCLUSTER is enabled and + binlog-format is MIXED, the format switches to row-based + and back implicitly per each query accessing an + NDBCLUSTER table + --binlog-ignore-db=name + Tells the master that updates to the given database + should not be logged tothe binary log. + --binlog-row-event-max-size=# + The maximum size of a row-based binary log event in + bytes. Rows will be grouped into events smaller than this + size if possible. The value has to be a multiple of 256. + --blackhole[=name] Enable or disable BLACKHOLE plugin. Possible values are + ON, OFF, FORCE (don't start if the plugin fails to load). + --bootstrap Used by mysql installation scripts. + --bulk-insert-buffer-size=# + Size of tree cache used in bulk insert optimisation. Note + that this is a limit per thread! + --character-set-client-handshake + Don't ignore client side character set value sent during + handshake. + (Defaults to on; use --skip-character-set-client-handshake to disable.) + --character-set-filesystem=name + Set the filesystem character set. + -C, --character-set-server=name + Set the default character set. + --character-sets-dir=name + Directory where character sets are + -r, --chroot=name Chroot mysqld daemon during startup. + --collation-server=name + Set the default collation. + --completion-type=name + The transaction completion type, one of NO_CHAIN, CHAIN, + RELEASE + --concurrent-insert[=name] + Use concurrent insert with MyISAM. Possible values are + NEVER, AUTO, ALWAYS + --connect-timeout=# The number of seconds the mysqld server is waiting for a + connect packet before responding with 'Bad handshake' + --console Write error output on screen; Don't remove the console + window on windows. + --core-file Write core on errors. + -h, --datadir=name Path to the database root directory + --date-format=name The DATE format (ignored) + --datetime-format=name + The DATETIME format (ignored) + -C, --default-character-set=name + Set the default character set (deprecated option, use + --character-set-server instead). + --default-collation=name + Set the default collation (deprecated option, use + --collation-server instead). + --default-storage-engine=name + The default storage engine for new tables + --default-time-zone=name + Set the default time zone. + --default-week-format=# + The default week format used by WEEK() functions + --delay-key-write[=name] + Type of DELAY_KEY_WRITE + --delay-key-write-for-all-tables + Don't flush key buffers between writes for any MyISAM + table (Deprecated option, use --delay-key-write=all + instead). + --delayed-insert-limit=# + After inserting delayed_insert_limit rows, the INSERT + DELAYED handler will check if there are any SELECT + statements pending. If so, it allows these to execute + before continuing + --delayed-insert-timeout=# + How long a INSERT DELAYED thread should wait for INSERT + statements before terminating + --delayed-queue-size=# + What size queue (in rows) should be allocated for + handling INSERT DELAYED. If the queue becomes full, any + client that does INSERT DELAYED will wait until there is + room in the queue again + --des-key-file=name Load keys for des_encrypt() and des_encrypt from given + file. + --disconnect-slave-event-count=# + Option used by mysql-test for debugging and testing of + replication. + --div-precision-increment=# + Precision of the result of '/' operator will be increased + on that value + --enable-locking Deprecated option, use --external-locking instead. + --engine-condition-pushdown + Push supported query conditions to the storage engine + (Defaults to on; use --skip-engine-condition-pushdown to disable.) + --event-scheduler[=name] + Enable the event scheduler. Possible values are ON, OFF, + and DISABLED (keep the event scheduler completely + deactivated, it cannot be activated run-time) + -T, --exit-info[=#] Used for debugging; Use at your own risk! + --expire-logs-days=# + If non-zero, binary logs will be purged after + expire_logs_days days; possible purges happen at startup + and at binary log rotation + --external-locking Use system (external) locking (disabled by default). + With this option enabled you can run myisamchk to test + (not repair) tables while the MySQL server is running. + Disable with --skip-external-locking. + --federated[=name] Enable or disable FEDERATED plugin. Possible values are + ON, OFF, FORCE (don't start if the plugin fails to load). + --flush Flush MyISAM tables to disk between SQL commands + --flush-time=# A dedicated thread is created to flush all tables at the + given interval + --ft-boolean-syntax=name + List of operators for MATCH ... AGAINST ( ... IN BOOLEAN + MODE) + --ft-max-word-len=# The maximum length of the word to be included in a + FULLTEXT index. Note: FULLTEXT indexes must be rebuilt + after changing this variable + --ft-min-word-len=# The minimum length of the word to be included in a + FULLTEXT index. Note: FULLTEXT indexes must be rebuilt + after changing this variable + --ft-query-expansion-limit=# + Number of best matches to use for query expansion + --ft-stopword-file=name + Use stopwords from this file instead of built-in list + --gdb Set up signals usable for debugging + --general-log Log connections and queries to a table or log file. + Defaults logging to a file hostname.log or a table + mysql.general_logif --log-output=TABLE is used + --general-log-file=name + Log connections and queries to given file + --group-concat-max-len=# + The maximum length of the result of function + GROUP_CONCAT() + -?, --help Display this help and exit. + --ignore-builtin-innodb + Disable initialization of builtin InnoDB plugin + --init-connect=name Command(s) that are executed for each new connection + --init-file=name Read SQL commands from this file at startup + --init-rpl-role=name + Set the replication role. + --init-slave=name Command(s) that are executed by a slave server each time + the SQL thread starts + --interactive-timeout=# + The number of seconds the server waits for activity on an + interactive connection before closing it + --join-buffer-size=# + The size of the buffer that is used for full joins + --keep-files-on-create + Don't overwrite stale .MYD and .MYI even if no directory + is specified + --key-buffer-size=# The size of the buffer used for index blocks for MyISAM + tables. Increase this to get better index handling (for + all reads and multiple writes) to as much as you can + afford + --key-cache-age-threshold=# + This characterizes the number of hits a hot block has to + be untouched until it is considered aged enough to be + downgraded to a warm block. This specifies the percentage + ratio of that number of hits to the total number of + blocks in key cache + --key-cache-block-size=# + The default size of key cache blocks + --key-cache-division-limit=# + The minimum percentage of warm blocks in key cache + -L, --language=name Client error messages in given language. May be given as + a full path. Deprecated. Use --lc-messages-dir instead. + --large-pages Enable support for large pages + --lc-messages=name Set the language used for the error messages. + -L, --lc-messages-dir=name + Directory where error messages are + --lc-time-names=name + Set the language used for the month names and the days of + the week. + --local-infile Enable LOAD DATA LOCAL INFILE + (Defaults to on; use --skip-local-infile to disable.) + -l, --log[=name] Log connections and queries to file (deprecated option, + use --general-log/--general-log-file instead). + --log-bin[=name] Log update queries in binary format. Optional (but + strongly recommended to avoid replication problems if + server's hostname changes) argument should be the chosen + location for the binary log files. + --log-bin-index=name + File that holds the names for last binary log files. + --log-bin-trust-function-creators + If set to FALSE (the default), then when --log-bin is + used, creation of a stored function (or trigger) is + allowed only to users having the SUPER privilege and only + if this stored function (trigger) may not break binary + logging. Note that if ALL connections to this server + ALWAYS use row-based binary logging, the security issues + do not exist and the binary logging cannot break, so you + can safely set this to TRUE + --log-error[=name] Error log file + --log-isam[=name] Log all MyISAM changes to file. + -0, --log-long-format + Log some extra information to update log. Please note + that this option is deprecated; see --log-short-format + option. + --log-output=name Syntax: log-output=value[,value...], where "value" could + be TABLE, FILE or NONE + --log-queries-not-using-indexes + Log queries that are executed without benefit of any + index to the slow log if it is open + --log-short-format Don't log extra information to update and slow-query + logs. + --log-slave-updates Tells the slave to log the updates from the slave thread + to the binary log. You will need to turn it on if you + plan to daisy-chain the slaves + --log-slow-admin-statements + Log slow OPTIMIZE, ANALYZE, ALTER and other + administrative statements to the slow log if it is open. + --log-slow-queries[=name] + Log slow queries to a table or log file. Defaults logging + to table mysql.slow_log or hostname-slow.log if + --log-output=file is used. Must be enabled to activate + other slow log options. Deprecated option, use + --slow-query-log/--slow-query-log-file instead. + --log-slow-slave-statements + Log slow statements executed by slave thread to the slow + log if it is open. + --log-tc=name Path to transaction coordinator log (used for + transactions that affect more than one storage engine, + when binary log is disabled) + --log-tc-size=# Size of transaction coordinator log. + --log-update[=name] The update log is deprecated since version 5.0, is + replaced by the binary log and this option justs turns on + --log-bin instead. + -W, --log-warnings[=#] + Log some not critical warnings to the log file + --long-query-time=# Log all queries that have taken more than long_query_time + seconds to execute to file. The argument will be treated + as a decimal value with microsecond precision + --low-priority-updates + INSERT/DELETE/UPDATE has lower priority than selects + --lower-case-table-names[=#] + If set to 1 table names are stored in lowercase on disk + and table names will be case-insensitive. Should be set + to 2 if you are using a case insensitive file system + --master-info-file=name + The location and name of the file that remembers the + master and where the I/O replication thread is in the + master's binlogs. + --master-retry-count=# + The number of tries the slave will make to connect to the + master before giving up. + --max-allowed-packet=# + Max packet length to send to or receive from the server + --max-binlog-cache-size=# + Can be used to restrict the total size used to cache a + multi-transaction query + --max-binlog-dump-events=# + Option used by mysql-test for debugging and testing of + replication. + --max-binlog-size=# Binary log will be rotated automatically when the size + exceeds this value. Will also apply to relay logs if + max_relay_log_size is 0 + --max-connect-errors=# + If there is more than this number of interrupted + connections from a host this host will be blocked from + further connections + --max-connections=# The number of simultaneous clients allowed + --max-delayed-threads=# + Don't start more than this number of threads to handle + INSERT DELAYED statements. If set to zero INSERT DELAYED + will be not used + --max-error-count=# Max number of errors/warnings to store for a statement + --max-heap-table-size=# + Don't allow creation of heap tables bigger than this + --max-join-size=# Joins that are probably going to read more than + max_join_size records return an error + --max-length-for-sort-data=# + Max number of bytes in sorted records + --max-prepared-stmt-count=# + Maximum number of prepared statements in the server + --max-relay-log-size=# + If non-zero: relay log will be rotated automatically when + the size exceeds this value; if zero: when the size + exceeds max_binlog_size + --max-seeks-for-key=# + Limit assumed max number of seeks when looking up rows + based on a key + --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT + values (only the first max_sort_length bytes of each + value are used; the rest are ignored) + --max-sp-recursion-depth[=#] + Maximum stored procedure recursion depth + --max-tmp-tables=# Maximum number of temporary tables a client can keep open + at a time + --max-user-connections=# + The maximum number of active connections for a single + user (0 = no limit) + --max-write-lock-count=# + After this many write locks, allow some read locks to run + in between + --memlock Lock mysqld in memory. + --min-examined-row-limit=# + Don't write queries to slow log that examine fewer rows + than that + --multi-range-count=# + Number of key ranges to request at once + --myisam-block-size=# + Block size to be used for MyISAM index pages + --myisam-data-pointer-size=# + Default pointer size to be used for MyISAM tables + --myisam-max-sort-file-size=# + Don't use the fast sort index method to created index if + the temporary file would get bigger than this + --myisam-mmap-size=# + Restricts the total memory used for memory mapping of + MySQL tables + --myisam-recover-options[=name] + Syntax: myisam-recover-options[=option[,option...]], + where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF + --myisam-repair-threads=# + If larger than 1, when repairing a MyISAM table all + indexes will be created in parallel, with one thread per + index. The value of 1 disables parallel repair + --myisam-sort-buffer-size=# + The buffer that is allocated when sorting the index when + doing a REPAIR or when creating indexes with CREATE INDEX + or ALTER TABLE + --myisam-stats-method=name + Specifies how MyISAM index statistics collection code + should treat NULLs. Possible values of name are + NULLS_UNEQUAL (default behavior for 4.1 and later), + NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED + --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables + --net-buffer-length=# + Buffer length for TCP/IP and socket communication + --net-read-timeout=# + Number of seconds to wait for more data from a connection + before aborting the read + --net-retry-count=# If a read on a communication port is interrupted, retry + this many times before giving up + --net-write-timeout=# + Number of seconds to wait for a block to be written to a + connection before aborting the write + -n, --new Use very new possible "unsafe" functions + --old Use compatible behavior + --old-alter-table Use old, non-optimized alter table + --old-passwords Use old password encryption method (needed for 4.0 and + older clients) + --old-style-user-limits + Enable old-style user limits (before 5.0.3 user resources + were counted per each user+host vs. per account) + --one-thread (deprecated): Only use one thread (for debugging under + Linux). Use thread-handling=no-threads instead + --open-files-limit=# + If this is not 0, then mysqld will use this value to + reserve file descriptors to use with setrlimit(). If this + value is 0 then mysqld will reserve max_connections*5 or + max_connections + table_cache*2 (whichever is larger) + number of file descriptors + --optimizer-prune-level=# + Controls the heuristic(s) applied during query + optimization to prune less-promising partial plans from + the optimizer search space. Meaning: 0 - do not apply any + heuristic, thus perform exhaustive search; 1 - prune + plans based on number of retrieved rows + --optimizer-search-depth=# + Maximum depth of search performed by the query optimizer. + Values larger than the number of relations in a query + result in better query plans, but take longer to compile + a query. Values smaller than the number of tables in a + relation result in faster optimization, but may produce + very bad query plans. If set to 0, the system will + automatically pick a reasonable value; if set to 63, the + optimizer will switch to the original find_best + search(used for testing/comparison) + --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} + --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 + --plugin-dir=name Directory for plugins + --plugin-load=name Optional semicolon-separated list of plugins to load, + where each plugin is identified as name=library, where + name is the plugin name and library is the plugin library + in plugin_dir. + -P, --port=# Port number to use for connection or 0 to default to, + my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default + (3306), whatever comes first + --port-open-timeout=# + Maximum time in seconds to wait for the port to become + free. (Default: no wait) + --preload-buffer-size=# + The size of the buffer that is allocated when preloading + indexes + --profiling-history-size=# + Limit of query profiling memory + --query-alloc-block-size=# + Allocation block size for query parsing and execution + --query-cache-limit=# + Don't cache results that are bigger than this + --query-cache-min-res-unit=# + The minimum size for blocks allocated by the query cache + --query-cache-size=# + The memory allocated to store results from old queries + --query-cache-type=name + OFF = Don't cache or retrieve results. ON = Cache all + results except SELECT SQL_NO_CACHE ... queries. DEMAND = + Cache only SELECT SQL_CACHE ... queries + --query-cache-wlock-invalidate + Invalidate queries in query cache on LOCK for write + --query-prealloc-size=# + Persistent buffer for query parsing and execution + --range-alloc-block-size=# + Allocation block size for storing ranges during + optimization + --read-buffer-size=# + Each thread that does a sequential scan allocates a + buffer of this size for each table it scans. If you do + many sequential scans, you may want to increase this + value + --read-only Make all non-temporary tables read-only, with the + exception for replication (slave) threads and users with + the SUPER privilege + --read-rnd-buffer-size=# + When reading rows in sorted order after a sort, the rows + are read through this buffer to avoid a disk seeks. If + not set, then it's set to the value of record_buffer + --record-buffer=# Deprecated; use --read-buffer-size instead. + --relay-log=name The location and name to use for relay logs + --relay-log-index=name + The location and name to use for the file that keeps a + list of the last relay logs + --relay-log-info-file=name + The location and name of the file that remembers where + the SQL replication thread is in the relay logs + --relay-log-purge if disabled - do not purge relay logs. if enabled - purge + them as soon as they are no more needed + (Defaults to on; use --skip-relay-log-purge to disable.) + --relay-log-recovery + Enables automatic relay log recovery right after the + database startup, which means that the IO Thread starts + re-fetching from the master right after the last + transaction processed + --relay-log-space-limit=# + Maximum space to use for all relay logs + --replicate-do-db=name + Tells the slave thread to restrict replication to the + specified database. To specify more than one database, + use the directive multiple times, once for each database. + Note that this will only work if you do not use + cross-database queries such as UPDATE some_db.some_table + SET foo='bar' while having selected a different or no + database. If you need cross database updates to work, + make sure you have 3.23.28 or later, and use + replicate-wild-do-table=db_name.%. + --replicate-do-table=name + Tells the slave thread to restrict replication to the + specified table. To specify more than one table, use the + directive multiple times, once for each table. This will + work for cross-database updates, in contrast to + replicate-do-db. + --replicate-ignore-db=name + Tells the slave thread to not replicate to the specified + database. To specify more than one database to ignore, + use the directive multiple times, once for each database. + This option will not work if you use cross database + updates. If you need cross database updates to work, make + sure you have 3.23.28 or later, and use + replicate-wild-ignore-table=db_name.%. + --replicate-ignore-table=name + Tells the slave thread to not replicate to the specified + table. To specify more than one table to ignore, use the + directive multiple times, once for each table. This will + work for cross-datbase updates, in contrast to + replicate-ignore-db. + --replicate-rewrite-db=name + Updates to a database with a different name than the + original. Example: + replicate-rewrite-db=master_db_name->slave_db_name. + --replicate-same-server-id + In replication, if set to 1, do not skip events having + our server id. Default value is 0 (to break infinite + loops in circular replication). Can't be set to 1 if + --log-slave-updates is used. + --replicate-wild-do-table=name + Tells the slave thread to restrict replication to the + tables that match the specified wildcard pattern. To + specify more than one table, use the directive multiple + times, once for each table. This will work for + cross-database updates. Example: + replicate-wild-do-table=foo%.bar% will replicate only + updates to tables in all databases that start with foo + and whose table names start with bar. + --replicate-wild-ignore-table=name + Tells the slave thread to not replicate to the tables + that match the given wildcard pattern. To specify more + than one table to ignore, use the directive multiple + times, once for each table. This will work for + cross-database updates. Example: + replicate-wild-ignore-table=foo%.bar% will not do updates + to tables in databases that start with foo and whose + table names start with bar. + --report-host=name Hostname or IP of the slave to be reported to the master + during slave registration. Will appear in the output of + SHOW SLAVE HOSTS. Leave unset if you do not want the + slave to register itself with the master. Note that it is + not sufficient for the master to simply read the IP of + the slave off the socket once the slave connects. Due to + NAT and other routing issues, that IP may not be valid + for connecting to the slave from the master or other + hosts + --report-password=name + The account password of the slave to be reported to the + master during slave registration + --report-port=# Port for connecting to slave reported to the master + during slave registration. Set it only if the slave is + listening on a non-default port or if you have a special + tunnel from the master or other clients to the slave. If + not sure, leave this option unset + --report-user=name The account user name of the slave to be reported to the + master during slave registration + --rpl-recovery-rank=# + Unused, will be removed + --safe-mode Skip some optimize stages (for testing). + --safe-show-database + Deprecated option; use GRANT SHOW DATABASES instead... + --safe-user-create Don't allow new user creation by the user who has no + write privileges to the mysql.user table. + --secure-auth Disallow authentication for accounts that have old + (pre-4.1) passwords + --secure-file-priv=name + Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to + files within specified directory + --server-id=# Uniquely identifies the server instance in the community + of replication partners + -O, --set-variable=name + Change the value of a variable. Please note that this + option is deprecated;you can set variables directly with + --variable-name=value. + --show-slave-auth-info + Show user and password in SHOW SLAVE HOSTS on this master + --skip-grant-tables Start without grant tables. This gives all users FULL + ACCESS to all tables! + --skip-host-cache Don't cache host names. + --skip-locking Deprecated option, use --skip-external-locking instead. + --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or + 'localhost'. + --skip-networking Don't allow connection with TCP/IP + --skip-new Don't use new, possible wrong routines. + --skip-show-database + Don't allow 'SHOW DATABASE' commands + --skip-slave-start If set, slave is not autostarted. + --skip-stack-trace Don't print a stack trace on failure. + --skip-symlink Don't allow symlinking of tables. Deprecated option. Use + --skip-symbolic-links instead. + --skip-thread-priority + Don't give threads different priorities. This option is + deprecated because it has no effect; the implied behavior + is already the default. + --slave-compressed-protocol + Use compression on master/slave protocol + --slave-exec-mode=name + 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 + --slave-load-tmpdir=name + The location where the slave should put its temporary + files when replicating a LOAD DATA INFILE command + --slave-net-timeout=# + Number of seconds to wait for more data from a + master/slave connection before aborting the read + --slave-skip-errors=name + Tells the slave thread to continue replication when a + query event returns an error from the provided list + --slave-transaction-retries=# + 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 + --slow-launch-time=# + If creating the thread takes longer than this value (in + seconds), the Slow_launch_threads counter will be + incremented + --slow-query-log Log slow queries to a table or log file. Defaults logging + to a file hostname-slow.log or a table mysql.slow_log if + --log-output=TABLE is used. Must be enabled to activate + other slow log options + --slow-query-log-file=name + Log slow queries to given log file. Defaults logging to + hostname-slow.log. Must be enabled to activate other slow + log options + --socket=name Socket file to use for connection + --sort-buffer-size=# + Each thread that needs to do a sort allocates a buffer of + this size + --sporadic-binlog-dump-fail + Option used by mysql-test for debugging and testing of + replication. + --sql-bin-update-same + The update log is deprecated since version 5.0, is + replaced by the binary log and this option does nothing + anymore. + --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual + for the complete list of valid sql modes + --ssl Enable SSL for connection (automatically enabled with + other flags). + --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl) + --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl) + --ssl-cert=name X509 cert in PEM format (implies --ssl) + --ssl-cipher=name SSL cipher to use (implies --ssl) + --ssl-key=name X509 key in PEM format (implies --ssl) + -s, --symbolic-links + Enable symbolic link support. + --sync-binlog=# Synchronously flush binary log to disk after every #th + event. Use 0 (default) to disable synchronous flushing + --sync-frm Sync .frm files to disk on creation + (Defaults to on; use --skip-sync-frm to disable.) + --sync-master-info=# + Synchronously flush master info to disk after every #th + event. Use 0 (default) to disable synchronous flushing + --sync-relay-log=# Synchronously flush relay log to disk after every #th + event. Use 0 (default) to disable synchronous flushing + --sync-relay-log-info=# + Synchronously flush relay log info to disk after every + #th transaction. Use 0 (default) to disable synchronous + flushing + --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it + safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' + value different for different invocations, even within + the same statement. + --table-cache=# Deprecated; use --table-open-cache instead. + --table-definition-cache=# + The number of cached table definitions + --table-lock-wait-timeout=# + Timeout in seconds to wait for a table level lock before + returning an error. Used only if the connection has + active cursors + --table-open-cache=# + The number of cached open tables + --tc-heuristic-recover=name + Decision to use in heuristic recover process. Possible + values are COMMIT or ROLLBACK. + --thread-cache-size=# + How many threads we should keep in a cache for reuse + --thread-handling=name + Define threads usage for handling queries, one of + one-thread-per-connection, no-threads + --thread-stack=# The stack size for each thread + --time-format=name The TIME format (ignored) + --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are + currently supported) + --tmp-table-size=# If an internal in-memory temporary table exceeds this + size, MySQL will automatically convert it to an on-disk + MyISAM table + -t, --tmpdir=name Path for temporary files. Several paths may be specified, + separated by a colon (:), in this case they are used in a + round-robin fashion + --transaction-alloc-block-size=# + Allocation block size for transactions to be stored in + binary log + --transaction-isolation=name + Default transaction isolation level. + --transaction-prealloc-size=# + Persistent buffer for transactions to be stored in binary + log + --updatable-views-with-limit=name + YES = Don't issue an error message (warning only) if a + VIEW without presence of a key of the underlying table is + used in queries with a LIMIT clause for updating. NO = + Prohibit update of a VIEW, which does not contain a key + of the underlying table and the query uses a LIMIT clause + (usually get from GUI tools) + -s, --use-symbolic-links + Enable symbolic link support. Deprecated option; use + --symbolic-links instead. + -u, --user=name Run mysqld daemon as user. + -v, --verbose Used with --help option for detailed help + -V, --version Output version information and exit. + --wait-timeout=# The number of seconds the server waits for activity on a + connection before closing it + -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 +chroot (No default value) +collation-server latin1_swedish_ci +completion-type NO_CHAIN +concurrent-insert AUTO +connect-timeout 10 +console FALSE +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 +des-key-file (No default value) +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 +large-pages FALSE +lc-messages en_US +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-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-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 +ssl FALSE +ssl-ca (No default value) +ssl-capath (No default value) +ssl-cert (No default value) +ssl-cipher (No default value) +ssl-key (No default value) +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 +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 new file mode 100644 index 00000000000..ec621d72bef --- /dev/null +++ b/mysql-test/r/mysqld--help-win.result @@ -0,0 +1,953 @@ +The following options may be given as the first argument: +--print-defaults Print the program argument list and exit +--no-defaults Don't read default options from any options file +--defaults-file=# Only read default options from the given file # +--defaults-extra-file=# Read this file after the global files are read + + --abort-slave-event-count=# + Option used by mysql-test for debugging and testing of + replication. + --allow-suspicious-udfs + Allows use of UDFs consisting of only one symbol xxx() + without corresponding xxx_init() or xxx_deinit(). That + also means that one can load any function from any + library, for example exit() from libc.so + -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode + will also set transaction isolation level 'serializable'. + --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, + OFF, FORCE (don't start if the plugin fails to load). + --auto-increment-increment[=#] + Auto-increment columns are incremented by this + --auto-increment-offset[=#] + Offset added to Auto-increment columns. Used when + auto-increment-increment != 1 + --automatic-sp-privileges + Creating and dropping stored procedures alters ACLs + (Defaults to on; use --skip-automatic-sp-privileges to disable.) + --back-log=# The number of outstanding connection requests MySQL can + have. This comes into play when the main MySQL thread + gets very many connection requests in a very short time + -b, --basedir=name Path to installation directory. All paths are usually + resolved relative to this + --big-tables Allow big result sets by saving all temporary sets on + file (Solves most 'table full' errors) + --bind-address=name IP address to bind to. + --binlog-cache-size=# + The size of the cache to hold the SQL statements for the + binary log during a transaction. If you often use big, + multi-statement transactions you can increase this to get + more performance + --binlog-do-db=name Tells the master it should log updates for the specified + database, and exclude all others not explicitly + mentioned. + --binlog-format=name + What form of binary logging the master will use: either + ROW for row-based binary logging, STATEMENT for + statement-based binary logging, or MIXED. MIXED is + statement-based binary logging except for those + statements where only row-based is correct: those which + involve user-defined functions (i.e. UDFs) or the UUID() + function; for those, row-based binary logging is + automatically used. If NDBCLUSTER is enabled and + binlog-format is MIXED, the format switches to row-based + and back implicitly per each query accessing an + NDBCLUSTER table + --binlog-ignore-db=name + Tells the master that updates to the given database + should not be logged tothe binary log. + --binlog-row-event-max-size=# + The maximum size of a row-based binary log event in + bytes. Rows will be grouped into events smaller than this + size if possible. The value has to be a multiple of 256. + --blackhole[=name] Enable or disable BLACKHOLE plugin. Possible values are + ON, OFF, FORCE (don't start if the plugin fails to load). + --bootstrap Used by mysql installation scripts. + --bulk-insert-buffer-size=# + Size of tree cache used in bulk insert optimisation. Note + that this is a limit per thread! + --character-set-client-handshake + Don't ignore client side character set value sent during + handshake. + (Defaults to on; use --skip-character-set-client-handshake to disable.) + --character-set-filesystem=name + Set the filesystem character set. + -C, --character-set-server=name + Set the default character set. + --character-sets-dir=name + Directory where character sets are + -r, --chroot=name Chroot mysqld daemon during startup. + --collation-server=name + Set the default collation. + --completion-type=name + The transaction completion type, one of NO_CHAIN, CHAIN, + RELEASE + --concurrent-insert[=name] + Use concurrent insert with MyISAM. Possible values are + NEVER, AUTO, ALWAYS + --connect-timeout=# The number of seconds the mysqld server is waiting for a + connect packet before responding with 'Bad handshake' + --console Write error output on screen; Don't remove the console + window on windows. + --core-file Write core on errors. + -h, --datadir=name Path to the database root directory + --date-format=name The DATE format (ignored) + --datetime-format=name + The DATETIME format (ignored) + -C, --default-character-set=name + Set the default character set (deprecated option, use + --character-set-server instead). + --default-collation=name + Set the default collation (deprecated option, use + --collation-server instead). + --default-storage-engine=name + The default storage engine for new tables + --default-time-zone=name + Set the default time zone. + --default-week-format=# + The default week format used by WEEK() functions + --delay-key-write[=name] + Type of DELAY_KEY_WRITE + --delay-key-write-for-all-tables + Don't flush key buffers between writes for any MyISAM + table (Deprecated option, use --delay-key-write=all + instead). + --delayed-insert-limit=# + After inserting delayed_insert_limit rows, the INSERT + DELAYED handler will check if there are any SELECT + statements pending. If so, it allows these to execute + before continuing + --delayed-insert-timeout=# + How long a INSERT DELAYED thread should wait for INSERT + statements before terminating + --delayed-queue-size=# + What size queue (in rows) should be allocated for + handling INSERT DELAYED. If the queue becomes full, any + client that does INSERT DELAYED will wait until there is + room in the queue again + --des-key-file=name Load keys for des_encrypt() and des_encrypt from given + file. + --disconnect-slave-event-count=# + Option used by mysql-test for debugging and testing of + replication. + --div-precision-increment=# + Precision of the result of '/' operator will be increased + on that value + --enable-locking Deprecated option, use --external-locking instead. + --engine-condition-pushdown + Push supported query conditions to the storage engine + (Defaults to on; use --skip-engine-condition-pushdown to disable.) + --event-scheduler[=name] + Enable the event scheduler. Possible values are ON, OFF, + and DISABLED (keep the event scheduler completely + deactivated, it cannot be activated run-time) + -T, --exit-info[=#] Used for debugging; Use at your own risk! + --expire-logs-days=# + If non-zero, binary logs will be purged after + expire_logs_days days; possible purges happen at startup + and at binary log rotation + --external-locking Use system (external) locking (disabled by default). + With this option enabled you can run myisamchk to test + (not repair) tables while the MySQL server is running. + Disable with --skip-external-locking. + --federated[=name] Enable or disable FEDERATED plugin. Possible values are + ON, OFF, FORCE (don't start if the plugin fails to load). + --flush Flush MyISAM tables to disk between SQL commands + --flush-time=# A dedicated thread is created to flush all tables at the + given interval + --ft-boolean-syntax=name + List of operators for MATCH ... AGAINST ( ... IN BOOLEAN + MODE) + --ft-max-word-len=# The maximum length of the word to be included in a + FULLTEXT index. Note: FULLTEXT indexes must be rebuilt + after changing this variable + --ft-min-word-len=# The minimum length of the word to be included in a + FULLTEXT index. Note: FULLTEXT indexes must be rebuilt + after changing this variable + --ft-query-expansion-limit=# + Number of best matches to use for query expansion + --ft-stopword-file=name + Use stopwords from this file instead of built-in list + --gdb Set up signals usable for debugging + --general-log Log connections and queries to a table or log file. + Defaults logging to a file hostname.log or a table + mysql.general_logif --log-output=TABLE is used + --general-log-file=name + Log connections and queries to given file + --group-concat-max-len=# + The maximum length of the result of function + GROUP_CONCAT() + -?, --help Display this help and exit. + --ignore-builtin-innodb + Disable initialization of builtin InnoDB plugin + --init-connect=name Command(s) that are executed for each new connection + --init-file=name Read SQL commands from this file at startup + --init-rpl-role=name + Set the replication role. + --init-slave=name Command(s) that are executed by a slave server each time + the SQL thread starts + --interactive-timeout=# + The number of seconds the server waits for activity on an + interactive connection before closing it + --join-buffer-size=# + The size of the buffer that is used for full joins + --keep-files-on-create + Don't overwrite stale .MYD and .MYI even if no directory + is specified + --key-buffer-size=# The size of the buffer used for index blocks for MyISAM + tables. Increase this to get better index handling (for + all reads and multiple writes) to as much as you can + afford + --key-cache-age-threshold=# + This characterizes the number of hits a hot block has to + be untouched until it is considered aged enough to be + downgraded to a warm block. This specifies the percentage + ratio of that number of hits to the total number of + blocks in key cache + --key-cache-block-size=# + The default size of key cache blocks + --key-cache-division-limit=# + The minimum percentage of warm blocks in key cache + -L, --language=name Client error messages in given language. May be given as + a full path. Deprecated. Use --lc-messages-dir instead. + --lc-messages=name Set the language used for the error messages. + -L, --lc-messages-dir=name + Directory where error messages are + --lc-time-names=name + Set the language used for the month names and the days of + the week. + --local-infile Enable LOAD DATA LOCAL INFILE + (Defaults to on; use --skip-local-infile to disable.) + -l, --log[=name] Log connections and queries to file (deprecated option, + use --general-log/--general-log-file instead). + --log-bin[=name] Log update queries in binary format. Optional (but + strongly recommended to avoid replication problems if + server's hostname changes) argument should be the chosen + location for the binary log files. + --log-bin-index=name + File that holds the names for last binary log files. + --log-bin-trust-function-creators + If set to FALSE (the default), then when --log-bin is + used, creation of a stored function (or trigger) is + allowed only to users having the SUPER privilege and only + if this stored function (trigger) may not break binary + logging. Note that if ALL connections to this server + ALWAYS use row-based binary logging, the security issues + do not exist and the binary logging cannot break, so you + can safely set this to TRUE + --log-error[=name] Error log file + --log-isam[=name] Log all MyISAM changes to file. + -0, --log-long-format + Log some extra information to update log. Please note + that this option is deprecated; see --log-short-format + option. + --log-output=name Syntax: log-output=value[,value...], where "value" could + be TABLE, FILE or NONE + --log-queries-not-using-indexes + Log queries that are executed without benefit of any + index to the slow log if it is open + --log-short-format Don't log extra information to update and slow-query + logs. + --log-slave-updates Tells the slave to log the updates from the slave thread + to the binary log. You will need to turn it on if you + plan to daisy-chain the slaves + --log-slow-admin-statements + Log slow OPTIMIZE, ANALYZE, ALTER and other + administrative statements to the slow log if it is open. + --log-slow-queries[=name] + Log slow queries to a table or log file. Defaults logging + to table mysql.slow_log or hostname-slow.log if + --log-output=file is used. Must be enabled to activate + other slow log options. Deprecated option, use + --slow-query-log/--slow-query-log-file instead. + --log-slow-slave-statements + Log slow statements executed by slave thread to the slow + log if it is open. + --log-tc=name Path to transaction coordinator log (used for + transactions that affect more than one storage engine, + when binary log is disabled) + --log-tc-size=# Size of transaction coordinator log. + --log-update[=name] The update log is deprecated since version 5.0, is + replaced by the binary log and this option justs turns on + --log-bin instead. + -W, --log-warnings[=#] + Log some not critical warnings to the log file + --long-query-time=# Log all queries that have taken more than long_query_time + seconds to execute to file. The argument will be treated + as a decimal value with microsecond precision + --low-priority-updates + INSERT/DELETE/UPDATE has lower priority than selects + --lower-case-table-names[=#] + If set to 1 table names are stored in lowercase on disk + and table names will be case-insensitive. Should be set + to 2 if you are using a case insensitive file system + --master-info-file=name + The location and name of the file that remembers the + master and where the I/O replication thread is in the + master's binlogs. + --master-retry-count=# + The number of tries the slave will make to connect to the + master before giving up. + --max-allowed-packet=# + Max packet length to send to or receive from the server + --max-binlog-cache-size=# + Can be used to restrict the total size used to cache a + multi-transaction query + --max-binlog-dump-events=# + Option used by mysql-test for debugging and testing of + replication. + --max-binlog-size=# Binary log will be rotated automatically when the size + exceeds this value. Will also apply to relay logs if + max_relay_log_size is 0 + --max-connect-errors=# + If there is more than this number of interrupted + connections from a host this host will be blocked from + further connections + --max-connections=# The number of simultaneous clients allowed + --max-delayed-threads=# + Don't start more than this number of threads to handle + INSERT DELAYED statements. If set to zero INSERT DELAYED + will be not used + --max-error-count=# Max number of errors/warnings to store for a statement + --max-heap-table-size=# + Don't allow creation of heap tables bigger than this + --max-join-size=# Joins that are probably going to read more than + max_join_size records return an error + --max-length-for-sort-data=# + Max number of bytes in sorted records + --max-prepared-stmt-count=# + Maximum number of prepared statements in the server + --max-relay-log-size=# + If non-zero: relay log will be rotated automatically when + the size exceeds this value; if zero: when the size + exceeds max_binlog_size + --max-seeks-for-key=# + Limit assumed max number of seeks when looking up rows + based on a key + --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT + values (only the first max_sort_length bytes of each + value are used; the rest are ignored) + --max-sp-recursion-depth[=#] + Maximum stored procedure recursion depth + --max-tmp-tables=# Maximum number of temporary tables a client can keep open + at a time + --max-user-connections=# + The maximum number of active connections for a single + user (0 = no limit) + --max-write-lock-count=# + After this many write locks, allow some read locks to run + in between + --memlock Lock mysqld in memory. + --min-examined-row-limit=# + Don't write queries to slow log that examine fewer rows + than that + --multi-range-count=# + Number of key ranges to request at once + --myisam-block-size=# + Block size to be used for MyISAM index pages + --myisam-data-pointer-size=# + Default pointer size to be used for MyISAM tables + --myisam-max-sort-file-size=# + Don't use the fast sort index method to created index if + the temporary file would get bigger than this + --myisam-mmap-size=# + Restricts the total memory used for memory mapping of + MySQL tables + --myisam-recover-options[=name] + Syntax: myisam-recover-options[=option[,option...]], + where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF + --myisam-repair-threads=# + If larger than 1, when repairing a MyISAM table all + indexes will be created in parallel, with one thread per + index. The value of 1 disables parallel repair + --myisam-sort-buffer-size=# + The buffer that is allocated when sorting the index when + doing a REPAIR or when creating indexes with CREATE INDEX + or ALTER TABLE + --myisam-stats-method=name + Specifies how MyISAM index statistics collection code + should treat NULLs. Possible values of name are + NULLS_UNEQUAL (default behavior for 4.1 and later), + NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED + --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables + --named-pipe Enable the named pipe (NT) + --net-buffer-length=# + Buffer length for TCP/IP and socket communication + --net-read-timeout=# + Number of seconds to wait for more data from a connection + before aborting the read + --net-retry-count=# If a read on a communication port is interrupted, retry + this many times before giving up + --net-write-timeout=# + Number of seconds to wait for a block to be written to a + connection before aborting the write + -n, --new Use very new possible "unsafe" functions + --old Use compatible behavior + --old-alter-table Use old, non-optimized alter table + --old-passwords Use old password encryption method (needed for 4.0 and + older clients) + --old-style-user-limits + Enable old-style user limits (before 5.0.3 user resources + were counted per each user+host vs. per account) + --one-thread (deprecated): Only use one thread (for debugging under + Linux). Use thread-handling=no-threads instead + --open-files-limit=# + If this is not 0, then mysqld will use this value to + reserve file descriptors to use with setrlimit(). If this + value is 0 then mysqld will reserve max_connections*5 or + max_connections + table_cache*2 (whichever is larger) + number of file descriptors + --optimizer-prune-level=# + Controls the heuristic(s) applied during query + optimization to prune less-promising partial plans from + the optimizer search space. Meaning: 0 - do not apply any + heuristic, thus perform exhaustive search; 1 - prune + plans based on number of retrieved rows + --optimizer-search-depth=# + Maximum depth of search performed by the query optimizer. + Values larger than the number of relations in a query + result in better query plans, but take longer to compile + a query. Values smaller than the number of tables in a + relation result in faster optimization, but may produce + very bad query plans. If set to 0, the system will + automatically pick a reasonable value; if set to 63, the + optimizer will switch to the original find_best + search(used for testing/comparison) + --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} + --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 + --plugin-dir=name Directory for plugins + --plugin-load=name Optional semicolon-separated list of plugins to load, + where each plugin is identified as name=library, where + name is the plugin name and library is the plugin library + in plugin_dir. + -P, --port=# Port number to use for connection or 0 to default to, + my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default + (3306), whatever comes first + --port-open-timeout=# + Maximum time in seconds to wait for the port to become + free. (Default: no wait) + --preload-buffer-size=# + The size of the buffer that is allocated when preloading + indexes + --profiling-history-size=# + Limit of query profiling memory + --query-alloc-block-size=# + Allocation block size for query parsing and execution + --query-cache-limit=# + Don't cache results that are bigger than this + --query-cache-min-res-unit=# + The minimum size for blocks allocated by the query cache + --query-cache-size=# + The memory allocated to store results from old queries + --query-cache-type=name + OFF = Don't cache or retrieve results. ON = Cache all + results except SELECT SQL_NO_CACHE ... queries. DEMAND = + Cache only SELECT SQL_CACHE ... queries + --query-cache-wlock-invalidate + Invalidate queries in query cache on LOCK for write + --query-prealloc-size=# + Persistent buffer for query parsing and execution + --range-alloc-block-size=# + Allocation block size for storing ranges during + optimization + --read-buffer-size=# + Each thread that does a sequential scan allocates a + buffer of this size for each table it scans. If you do + many sequential scans, you may want to increase this + value + --read-only Make all non-temporary tables read-only, with the + exception for replication (slave) threads and users with + the SUPER privilege + --read-rnd-buffer-size=# + When reading rows in sorted order after a sort, the rows + are read through this buffer to avoid a disk seeks. If + not set, then it's set to the value of record_buffer + --record-buffer=# Deprecated; use --read-buffer-size instead. + --relay-log=name The location and name to use for relay logs + --relay-log-index=name + The location and name to use for the file that keeps a + list of the last relay logs + --relay-log-info-file=name + The location and name of the file that remembers where + the SQL replication thread is in the relay logs + --relay-log-purge if disabled - do not purge relay logs. if enabled - purge + them as soon as they are no more needed + (Defaults to on; use --skip-relay-log-purge to disable.) + --relay-log-recovery + Enables automatic relay log recovery right after the + database startup, which means that the IO Thread starts + re-fetching from the master right after the last + transaction processed + --relay-log-space-limit=# + Maximum space to use for all relay logs + --replicate-do-db=name + Tells the slave thread to restrict replication to the + specified database. To specify more than one database, + use the directive multiple times, once for each database. + Note that this will only work if you do not use + cross-database queries such as UPDATE some_db.some_table + SET foo='bar' while having selected a different or no + database. If you need cross database updates to work, + make sure you have 3.23.28 or later, and use + replicate-wild-do-table=db_name.%. + --replicate-do-table=name + Tells the slave thread to restrict replication to the + specified table. To specify more than one table, use the + directive multiple times, once for each table. This will + work for cross-database updates, in contrast to + replicate-do-db. + --replicate-ignore-db=name + Tells the slave thread to not replicate to the specified + database. To specify more than one database to ignore, + use the directive multiple times, once for each database. + This option will not work if you use cross database + updates. If you need cross database updates to work, make + sure you have 3.23.28 or later, and use + replicate-wild-ignore-table=db_name.%. + --replicate-ignore-table=name + Tells the slave thread to not replicate to the specified + table. To specify more than one table to ignore, use the + directive multiple times, once for each table. This will + work for cross-datbase updates, in contrast to + replicate-ignore-db. + --replicate-rewrite-db=name + Updates to a database with a different name than the + original. Example: + replicate-rewrite-db=master_db_name->slave_db_name. + --replicate-same-server-id + In replication, if set to 1, do not skip events having + our server id. Default value is 0 (to break infinite + loops in circular replication). Can't be set to 1 if + --log-slave-updates is used. + --replicate-wild-do-table=name + Tells the slave thread to restrict replication to the + tables that match the specified wildcard pattern. To + specify more than one table, use the directive multiple + times, once for each table. This will work for + cross-database updates. Example: + replicate-wild-do-table=foo%.bar% will replicate only + updates to tables in all databases that start with foo + and whose table names start with bar. + --replicate-wild-ignore-table=name + Tells the slave thread to not replicate to the tables + that match the given wildcard pattern. To specify more + than one table to ignore, use the directive multiple + times, once for each table. This will work for + cross-database updates. Example: + replicate-wild-ignore-table=foo%.bar% will not do updates + to tables in databases that start with foo and whose + table names start with bar. + --report-host=name Hostname or IP of the slave to be reported to the master + during slave registration. Will appear in the output of + SHOW SLAVE HOSTS. Leave unset if you do not want the + slave to register itself with the master. Note that it is + not sufficient for the master to simply read the IP of + the slave off the socket once the slave connects. Due to + NAT and other routing issues, that IP may not be valid + for connecting to the slave from the master or other + hosts + --report-password=name + The account password of the slave to be reported to the + master during slave registration + --report-port=# Port for connecting to slave reported to the master + during slave registration. Set it only if the slave is + listening on a non-default port or if you have a special + tunnel from the master or other clients to the slave. If + not sure, leave this option unset + --report-user=name The account user name of the slave to be reported to the + master during slave registration + --rpl-recovery-rank=# + Unused, will be removed + --safe-mode Skip some optimize stages (for testing). + --safe-show-database + Deprecated option; use GRANT SHOW DATABASES instead... + --safe-user-create Don't allow new user creation by the user who has no + write privileges to the mysql.user table. + --secure-auth Disallow authentication for accounts that have old + (pre-4.1) passwords + --secure-file-priv=name + Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to + files within specified directory + --server-id=# Uniquely identifies the server instance in the community + of replication partners + -O, --set-variable=name + Change the value of a variable. Please note that this + option is deprecated;you can set variables directly with + --variable-name=value. + --shared-memory Enable the shared memory + --shared-memory-base-name=name + Base name of shared memory + --show-slave-auth-info + Show user and password in SHOW SLAVE HOSTS on this master + --skip-grant-tables Start without grant tables. This gives all users FULL + ACCESS to all tables! + --skip-host-cache Don't cache host names. + --skip-locking Deprecated option, use --skip-external-locking instead. + --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or + 'localhost'. + --skip-networking Don't allow connection with TCP/IP + --skip-new Don't use new, possible wrong routines. + --skip-show-database + Don't allow 'SHOW DATABASE' commands + --skip-slave-start If set, slave is not autostarted. + --skip-stack-trace Don't print a stack trace on failure. + --skip-symlink Don't allow symlinking of tables. Deprecated option. Use + --skip-symbolic-links instead. + --skip-thread-priority + Don't give threads different priorities. This option is + deprecated because it has no effect; the implied behavior + is already the default. + --slave-compressed-protocol + Use compression on master/slave protocol + --slave-exec-mode=name + 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 + --slave-load-tmpdir=name + The location where the slave should put its temporary + files when replicating a LOAD DATA INFILE command + --slave-net-timeout=# + Number of seconds to wait for more data from a + master/slave connection before aborting the read + --slave-skip-errors=name + Tells the slave thread to continue replication when a + query event returns an error from the provided list + --slave-transaction-retries=# + 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 + --slow-launch-time=# + If creating the thread takes longer than this value (in + seconds), the Slow_launch_threads counter will be + incremented + --slow-query-log Log slow queries to a table or log file. Defaults logging + to a file hostname-slow.log or a table mysql.slow_log if + --log-output=TABLE is used. Must be enabled to activate + other slow log options + --slow-query-log-file=name + Log slow queries to given log file. Defaults logging to + hostname-slow.log. Must be enabled to activate other slow + log options + --socket=name Socket file to use for connection + --sort-buffer-size=# + Each thread that needs to do a sort allocates a buffer of + this size + --sporadic-binlog-dump-fail + Option used by mysql-test for debugging and testing of + replication. + --sql-bin-update-same + The update log is deprecated since version 5.0, is + replaced by the binary log and this option does nothing + anymore. + --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual + for the complete list of valid sql modes + --ssl Enable SSL for connection (automatically enabled with + other flags). + --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl) + --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl) + --ssl-cert=name X509 cert in PEM format (implies --ssl) + --ssl-cipher=name SSL cipher to use (implies --ssl) + --ssl-key=name X509 key in PEM format (implies --ssl) + --standalone Dummy option to start as a standalone program (NT). + -s, --symbolic-links + Enable symbolic link support. + --sync-binlog=# Synchronously flush binary log to disk after every #th + event. Use 0 (default) to disable synchronous flushing + --sync-frm Sync .frm files to disk on creation + (Defaults to on; use --skip-sync-frm to disable.) + --sync-master-info=# + Synchronously flush master info to disk after every #th + event. Use 0 (default) to disable synchronous flushing + --sync-relay-log=# Synchronously flush relay log to disk after every #th + event. Use 0 (default) to disable synchronous flushing + --sync-relay-log-info=# + Synchronously flush relay log info to disk after every + #th transaction. Use 0 (default) to disable synchronous + flushing + --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it + safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' + value different for different invocations, even within + the same statement. + --table-cache=# Deprecated; use --table-open-cache instead. + --table-definition-cache=# + The number of cached table definitions + --table-lock-wait-timeout=# + Timeout in seconds to wait for a table level lock before + returning an error. Used only if the connection has + active cursors + --table-open-cache=# + The number of cached open tables + --tc-heuristic-recover=name + Decision to use in heuristic recover process. Possible + values are COMMIT or ROLLBACK. + --thread-cache-size=# + How many threads we should keep in a cache for reuse + --thread-handling=name + Define threads usage for handling queries, one of + one-thread-per-connection, no-threads + --thread-stack=# The stack size for each thread + --time-format=name The TIME format (ignored) + --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are + currently supported) + --tmp-table-size=# If an internal in-memory temporary table exceeds this + size, MySQL will automatically convert it to an on-disk + MyISAM table + -t, --tmpdir=name Path for temporary files. Several paths may be specified, + separated by a semicolon (;), in this case they are used + in a round-robin fashion + --transaction-alloc-block-size=# + Allocation block size for transactions to be stored in + binary log + --transaction-isolation=name + Default transaction isolation level. + --transaction-prealloc-size=# + Persistent buffer for transactions to be stored in binary + log + --updatable-views-with-limit=name + YES = Don't issue an error message (warning only) if a + VIEW without presence of a key of the underlying table is + used in queries with a LIMIT clause for updating. NO = + Prohibit update of a VIEW, which does not contain a key + of the underlying table and the query uses a LIMIT clause + (usually get from GUI tools) + -s, --use-symbolic-links + Enable symbolic link support. Deprecated option; use + --symbolic-links instead. + -u, --user=name Run mysqld daemon as user. + -v, --verbose Used with --help option for detailed help + -V, --version Output version information and exit. + --wait-timeout=# The number of seconds the server waits for activity on a + connection before closing it + -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 +chroot (No default value) +collation-server latin1_swedish_ci +completion-type NO_CHAIN +concurrent-insert AUTO +connect-timeout 10 +console FALSE +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 +des-key-file (No default value) +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 +lc-messages en_US +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-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-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 +ssl FALSE +ssl-ca (No default value) +ssl-capath (No default value) +ssl-cert (No default value) +ssl-cipher (No default value) +ssl-key (No default value) +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 +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/partition_key_cache.result b/mysql-test/r/partition_key_cache.result index 7fbab34fa41..c5241c6ea90 100644 --- a/mysql-test/r/partition_key_cache.result +++ b/mysql-test/r/partition_key_cache.result @@ -5,9 +5,7 @@ SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size; @org_key_cache_buffer_size:= @@global.default.key_buffer_size 1048576 # Minimize default key cache (almost disabled). -SET @@global.default.key_buffer_size = 1; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '1' +SET @@global.default.key_buffer_size = 4096; CREATE TABLE t1 ( a INT, b INT, diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 85fbd1353cc..9cae2b487b2 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -34,7 +34,7 @@ INSTALL PLUGIN example SONAME 'ha_example.so'; SET GLOBAL example_enum_var= e1; SET GLOBAL example_enum_var= e2; SET GLOBAL example_enum_var= impossible; -ERROR 42000: Variable 'enum_var' can't be set to the value of 'impossible' +ERROR 42000: Variable 'example_enum_var' can't be set to the value of 'impossible' UNINSTALL PLUGIN example; INSTALL PLUGIN example SONAME 'ha_example.so'; select @@session.sql_mode into @old_sql_mode; @@ -45,7 +45,7 @@ select @@global.example_ulong_var; 500 set global example_ulong_var=1111; Warnings: -Warning 1292 Truncated incorrect ulong_var value: '1111' +Warning 1292 Truncated incorrect example_ulong_var value: '1111' select @@global.example_ulong_var; @@global.example_ulong_var 1000 @@ -55,7 +55,7 @@ select @@global.example_ulong_var; @@global.example_ulong_var 500 set global example_ulong_var=1111; -ERROR 42000: Variable 'ulong_var' can't be set to the value of '1111' +ERROR 42000: Variable 'example_ulong_var' can't be set to the value of '1111' select @@global.example_ulong_var; @@global.example_ulong_var 500 diff --git a/mysql-test/r/profiling.result b/mysql-test/r/profiling.result index f20c459d7dc..6292cd085e4 100644 --- a/mysql-test/r/profiling.result +++ b/mysql-test/r/profiling.result @@ -9,8 +9,6 @@ profiling_history_size 15 select @@profiling; @@profiling 0 -set global profiling = ON; -ERROR HY000: Variable 'profiling' is a SESSION variable and can't be used with SET GLOBAL set @start_value= @@global.profiling_history_size; set global profiling_history_size=100; show global variables like 'profil%'; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 9cde630e4ed..eab0c51f974 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -508,6 +508,8 @@ AAA drop table t1; create table t1 (a int); set GLOBAL query_cache_size=1000; +Warnings: +Warning 1292 Truncated incorrect query_cache_size value: '1000' show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -1342,9 +1344,9 @@ set global query_cache_size=0; create table t1 (a int); insert into t1 values (1),(2),(3); set GLOBAL query_cache_type=1; -set GLOBAL query_cache_limit=10000; +set GLOBAL query_cache_limit=10240; set GLOBAL query_cache_min_res_unit=0; -set GLOBAL query_cache_size= 100000; +set GLOBAL query_cache_size= 102400; reset query cache; set LOCAL default_week_format = 0; select week('2007-01-04'); @@ -1434,7 +1436,7 @@ set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size= default; -set GLOBAL query_cache_size=1000000; +set GLOBAL query_cache_size=1024000; create table t1 (a char); insert into t1 values ('c'); a @@ -1562,7 +1564,7 @@ SET GLOBAL query_cache_size= default; # # Bug#25132 disabled query cache: Qcache_free_blocks = 1 # -set global query_cache_size=100000; +set global query_cache_size=102400; set global query_cache_size=0; set global query_cache_type=0; show status like 'Qcache_free_blocks'; @@ -1581,7 +1583,7 @@ CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM; INSERT INTO t1 (c1) VALUES (1), (2); SHOW GLOBAL VARIABLES LIKE 'concurrent_insert'; Variable_name Value -concurrent_insert 0 +concurrent_insert NEVER SHOW STATUS LIKE 'Qcache_hits'; Variable_name Value Qcache_hits 0 diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result index f686e876a60..02e660450d1 100644 --- a/mysql-test/r/query_cache_ps_no_prot.result +++ b/mysql-test/r/query_cache_ps_no_prot.result @@ -1,7 +1,7 @@ ---- establish connection con1 (root) ---- ---- switch to connection default ---- set @initial_query_cache_size = @@global.query_cache_size; -set @@global.query_cache_size=100000; +set @@global.query_cache_size=102400; flush status; drop table if exists t1; create table t1(c1 int); @@ -211,7 +211,7 @@ show status like 'Qcache_hits'; Variable_name Value Qcache_hits 16 ---- switch to connection default ---- -set global query_cache_size=100000; +set global query_cache_size=102400; execute stmt1; c1 10 @@ -297,7 +297,7 @@ prepare stmt1 from "select * from t1 where c1=10"; ---- switch to connection con1 ---- prepare stmt3 from "select * from t1 where c1=10"; ---- switch to connection default ---- -set global query_cache_size=100000; +set global query_cache_size=102400; show status like 'Qcache_hits'; Variable_name Value Qcache_hits 21 @@ -344,7 +344,7 @@ Qcache_hits 21 ---- switch to connection default ---- set global query_cache_size=0; prepare stmt1 from "select * from t1 where c1=?"; -set global query_cache_size=100000; +set global query_cache_size=102400; show status like 'Qcache_hits'; Variable_name Value Qcache_hits 21 @@ -548,7 +548,7 @@ alter table t1 add column b int; execute stmt; a Pack my box with five dozen liquor jugs. -set @@global.query_cache_size=100000; +set @@global.query_cache_size=102400; execute stmt; a Pack my box with five dozen liquor jugs. diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result index e594161f2e9..2115ecc62ff 100644 --- a/mysql-test/r/query_cache_ps_ps_prot.result +++ b/mysql-test/r/query_cache_ps_ps_prot.result @@ -1,7 +1,7 @@ ---- establish connection con1 (root) ---- ---- switch to connection default ---- set @initial_query_cache_size = @@global.query_cache_size; -set @@global.query_cache_size=100000; +set @@global.query_cache_size=102400; flush status; drop table if exists t1; create table t1(c1 int); @@ -211,7 +211,7 @@ show status like 'Qcache_hits'; Variable_name Value Qcache_hits 14 ---- switch to connection default ---- -set global query_cache_size=100000; +set global query_cache_size=102400; execute stmt1; c1 10 @@ -297,7 +297,7 @@ prepare stmt1 from "select * from t1 where c1=10"; ---- switch to connection con1 ---- prepare stmt3 from "select * from t1 where c1=10"; ---- switch to connection default ---- -set global query_cache_size=100000; +set global query_cache_size=102400; show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 @@ -344,7 +344,7 @@ Qcache_hits 19 ---- switch to connection default ---- set global query_cache_size=0; prepare stmt1 from "select * from t1 where c1=?"; -set global query_cache_size=100000; +set global query_cache_size=102400; show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 @@ -548,7 +548,7 @@ alter table t1 add column b int; execute stmt; a Pack my box with five dozen liquor jugs. -set @@global.query_cache_size=100000; +set @@global.query_cache_size=102400; execute stmt; a Pack my box with five dozen liquor jugs. diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result index feac9efcb13..5e5ef55477c 100644 --- a/mysql-test/r/select_safe.result +++ b/mysql-test/r/select_safe.result @@ -1,5 +1,5 @@ drop table if exists t1; -SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9; +SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9; create table t1 (a int auto_increment primary key, b char(20)); insert into t1 values(1,"test"); SELECT SQL_BUFFER_RESULT * from t1; @@ -90,4 +90,4 @@ set local max_join_size=1; select * from (select 1 union select 2 union select 3) x; ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay drop table t1; -SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT; +SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index ac118d0bab2..7ef69df56bd 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3030,7 +3030,7 @@ set @x = @x + 1; return @x; end| set @qcs1 = @@query_cache_size| -set global query_cache_size = 100000| +set global query_cache_size = 102400| set @x = 1| insert into t1 values ("qc", 42)| select bug9902() from t1| @@ -6903,15 +6903,12 @@ DROP FUNCTION f1; drop procedure if exists p; set @old_mode= @@sql_mode; -set @@sql_mode= pow(2,32)-1; +set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); select @@sql_mode into @full_mode; create procedure p() begin end; call p(); -select @@sql_mode; -@@sql_mode -REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH set @@sql_mode= @old_mode; -select replace(@full_mode, '?', 'NOT_USED') into @full_mode; +select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode; select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode; select name from mysql.proc where name = 'p' and sql_mode = @full_mode; name diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index ccea954c214..615ba21c811 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3669,8 +3669,6 @@ CREATE TABLE t1 (a int, b int auto_increment, PRIMARY KEY (b)); CREATE TABLE t2 (x int auto_increment, y int, z int, PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b)); SET SESSION sort_buffer_size = 32 * 1024; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32768' SELECT SQL_NO_CACHE COUNT(*) FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c FROM t1) t; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 3b6541ce56a..4f492d05558 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1305,6 +1305,8 @@ SELECT @tmp_max:= @@global.max_allowed_packet; @tmp_max:= @@global.max_allowed_packet 1048576 SET @@global.max_allowed_packet=25000000; +Warnings: +Warning 1292 Truncated incorrect max_allowed_packet value: '25000000' CREATE TABLE t1 (a mediumtext); CREATE TABLE t2 (b varchar(20)); INSERT INTO t1 VALUES ('a'); diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result index a94eb4616d1..80ec5517b16 100644 --- a/mysql-test/r/user_limits.result +++ b/mysql-test/r/user_limits.result @@ -70,7 +70,7 @@ select @@session.max_user_connections, @@global.max_user_connections; @@session.max_user_connections @@global.max_user_connections 0 0 set session max_user_connections= 2; -ERROR HY000: Variable 'max_user_connections' is a GLOBAL variable and should be set with SET GLOBAL +ERROR HY000: SESSION variable 'max_user_connections' is read-only. Use SET GLOBAL to assign the value set global max_user_connections= 2; select @@session.max_user_connections, @@global.max_user_connections; @@session.max_user_connections @@global.max_user_connections diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 28da1dae931..fe3dd4171ce 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -192,8 +192,6 @@ coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4) 2 2 2 2 set session @honk=99; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@honk=99' at line 1 -set one_shot @honk=99; -ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server select @@local.max_allowed_packet; @@local.max_allowed_packet # diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index f98872d93b3..e99f4e3deb9 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -24,7 +24,7 @@ set @my_query_cache_type =@@global.query_cache_type; set @my_rpl_recovery_rank =@@global.rpl_recovery_rank; set @my_server_id =@@global.server_id; set @my_slow_launch_time =@@global.slow_launch_time; -set @my_storage_engine =@@global.storage_engine; +set @my_storage_engine =@@global.default_storage_engine; set @my_thread_cache_size =@@global.thread_cache_size; set @my_max_allowed_packet =@@global.max_allowed_packet; set @my_join_buffer_size =@@global.join_buffer_size; @@ -165,28 +165,28 @@ set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", set global concurrent_insert=2; show variables like 'concurrent_insert'; Variable_name Value -concurrent_insert 2 +concurrent_insert ALWAYS select * from information_schema.session_variables where variable_name like 'concurrent_insert'; VARIABLE_NAME VARIABLE_VALUE -CONCURRENT_INSERT 2 +CONCURRENT_INSERT ALWAYS set global concurrent_insert=1; show variables like 'concurrent_insert'; Variable_name Value -concurrent_insert 1 +concurrent_insert AUTO select * from information_schema.session_variables where variable_name like 'concurrent_insert'; VARIABLE_NAME VARIABLE_VALUE -CONCURRENT_INSERT 1 +CONCURRENT_INSERT AUTO set global concurrent_insert=0; show variables like 'concurrent_insert'; Variable_name Value -concurrent_insert 0 +concurrent_insert NEVER select * from information_schema.session_variables where variable_name like 'concurrent_insert'; VARIABLE_NAME VARIABLE_VALUE -CONCURRENT_INSERT 0 +CONCURRENT_INSERT NEVER set global concurrent_insert=DEFAULT; select @@concurrent_insert; @@concurrent_insert -1 +AUTO set global timed_mutexes=ON; show variables like 'timed_mutexes'; Variable_name Value @@ -201,21 +201,23 @@ timed_mutexes OFF select * from information_schema.session_variables where variable_name like 'timed_mutexes'; VARIABLE_NAME VARIABLE_VALUE TIMED_MUTEXES OFF -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; -show local variables like 'storage_engine'; +set default_storage_engine=MYISAM, default_storage_engine="HEAP", global default_storage_engine="MERGE"; +show local variables like 'default_storage_engine'; Variable_name Value -storage_engine MEMORY -select * from information_schema.session_variables where variable_name like 'storage_engine'; +default_storage_engine MEMORY +select * from information_schema.session_variables where variable_name like 'default_storage_engine'; VARIABLE_NAME VARIABLE_VALUE -STORAGE_ENGINE MEMORY -show global variables like 'storage_engine'; +DEFAULT_STORAGE_ENGINE MEMORY +show global variables like 'default_storage_engine'; Variable_name Value -storage_engine MRG_MYISAM -select * from information_schema.global_variables where variable_name like 'storage_engine'; +default_storage_engine MRG_MYISAM +select * from information_schema.global_variables where variable_name like 'default_storage_engine'; VARIABLE_NAME VARIABLE_VALUE -STORAGE_ENGINE MRG_MYISAM -set GLOBAL query_cache_size=100000; +DEFAULT_STORAGE_ENGINE MRG_MYISAM +set GLOBAL query_cache_size=102400; set GLOBAL myisam_max_sort_file_size=2000000; +Warnings: +Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '2000000' show global variables like 'myisam_max_sort_file_size'; Variable_name Value myisam_max_sort_file_size 1048576 @@ -256,6 +258,8 @@ NET_READ_TIMEOUT 30 NET_RETRY_COUNT 10 NET_WRITE_TIMEOUT 60 set global net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000; +Warnings: +Warning 1292 Truncated incorrect net_buffer_length value: '8000' show global variables like 'net_%'; Variable_name Value net_buffer_length 7168 @@ -359,13 +363,20 @@ TRANSACTION_PREALLOC_SIZE 19456 ==+ Manipulate variable values +== Testing values that are not 1024 multiples set @@range_alloc_block_size=1024*16+1023; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '17407' set @@query_alloc_block_size=1024*17+2; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '17410' set @@query_prealloc_size=1024*18-1023; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '17409' set @@transaction_alloc_block_size=1024*20-1; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '20479' set @@transaction_prealloc_size=1024*21-1; -select @@query_alloc_block_size; -@@query_alloc_block_size -17408 +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '21503' ==+ Check manipulated values ==+ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', @@ -415,17 +426,15 @@ set unknown_variable=1; ERROR HY000: Unknown system variable 'unknown_variable' set max_join_size="hello"; ERROR 42000: Incorrect argument type to variable 'max_join_size' -set storage_engine=UNKNOWN_TABLE_TYPE; +set default_storage_engine=UNKNOWN_TABLE_TYPE; ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE' -set storage_engine=MERGE, big_tables=2; +set default_storage_engine=MERGE, big_tables=2; ERROR 42000: Variable 'big_tables' can't be set to the value of '2' -show local variables like 'storage_engine'; +show local variables like 'default_storage_engine'; Variable_name Value -storage_engine MEMORY +default_storage_engine MEMORY set SESSION query_cache_size=10000; ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -set GLOBAL storage_engine=DEFAULT; -ERROR 42000: Variable 'storage_engine' doesn't have a default value set character_set_client=UNKNOWN_CHARACTER_SET; ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET' set collation_connection=UNKNOWN_COLLATION; @@ -434,18 +443,12 @@ set character_set_client=NULL; ERROR 42000: Variable 'character_set_client' can't be set to the value of 'NULL' set collation_connection=NULL; ERROR 42000: Variable 'collation_connection' can't be set to the value of 'NULL' -set global autocommit=1; -ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL select @@global.timestamp; ERROR HY000: Variable 'timestamp' is a SESSION variable set @@version=''; ERROR HY000: Variable 'version' is a read only variable set @@concurrent_insert=1; ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL -set @@global.sql_auto_is_null=1; -ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable and can't be used with SET GLOBAL -select @@global.sql_auto_is_null; -ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable set myisam_max_sort_file_size=100; ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL set @@SQL_WARNINGS=NULL; @@ -530,14 +533,16 @@ set net_read_timeout=100; set net_write_timeout=100; set global query_cache_limit=100; set global query_cache_size=100; +Warnings: +Warning 1292 Truncated incorrect query_cache_size value: '100' set global query_cache_type=demand; set read_buffer_size=100; Warnings: Warning 1292 Truncated incorrect read_buffer_size value: '100' set read_rnd_buffer_size=100; -Warnings: -Warning 1292 Truncated incorrect read_rnd_buffer_size value: '100' set global rpl_recovery_rank=100; +Warnings: +Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0. set global server_id=100; set global slow_launch_time=100; set sort_buffer_size=100; @@ -568,17 +573,13 @@ set sql_log_update=1; Warnings: Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored set sql_low_priority_updates=1; -set sql_max_join_size=200; -select @@sql_max_join_size,@@max_join_size; -@@sql_max_join_size @@max_join_size -200 200 set sql_quote_show_create=1; set sql_safe_updates=1; set sql_select_limit=1; set sql_select_limit=default; set sql_warnings=1; set global table_open_cache=100; -set storage_engine=myisam; +set default_storage_engine=myisam; set global thread_cache_size=100; set timestamp=1, timestamp=default; set tmp_table_size=100; @@ -615,6 +616,8 @@ create table t2 (a int not null auto_increment, primary key(a)); insert into t1 values(null),(null),(null); insert into t2 values(null),(null),(null); set global key_buffer_size=100000; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '100000' select @@key_buffer_size; @@key_buffer_size 98304 @@ -658,11 +661,11 @@ MYISAM_MAX_SORT_FILE_SIZE MAX_FILE_SIZE set global myisam_max_sort_file_size=default; select @@global.max_user_connections,@@local.max_join_size; @@global.max_user_connections @@local.max_join_size -100 200 +100 100 set @svc=@@global.max_user_connections, @svj=@@local.max_join_size; select @@global.max_user_connections,@@local.max_join_size; @@global.max_user_connections @@local.max_join_size -100 200 +100 100 set @@global.max_user_connections=111,@@local.max_join_size=222; select @@global.max_user_connections,@@local.max_join_size; @@global.max_user_connections @@local.max_join_size @@ -674,7 +677,7 @@ select @@global.max_user_connections,@@local.max_join_size; set @@global.max_user_connections=@svc, @@local.max_join_size=@svj; select @@global.max_user_connections,@@local.max_join_size; @@global.max_user_connections @@local.max_join_size -100 200 +100 100 set @a=1, @b=2; set @a=@b, @b=@a; select @a, @b; @@ -1055,9 +1058,11 @@ set global net_read_timeout =@my_net_read_timeout; set global query_cache_limit =@my_query_cache_limit; set global query_cache_type =@my_query_cache_type; set global rpl_recovery_rank =@my_rpl_recovery_rank; +Warnings: +Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0. set global server_id =@my_server_id; set global slow_launch_time =@my_slow_launch_time; -set global storage_engine =@my_storage_engine; +set global default_storage_engine =@my_storage_engine; set global thread_cache_size =@my_thread_cache_size; set global max_allowed_packet =@my_max_allowed_packet; set global join_buffer_size =@my_join_buffer_size; @@ -1440,10 +1445,10 @@ Warning 1292 Truncated incorrect auto_increment_offset value: '-1' SET GLOBAL auto_increment_offset=0; Warnings: Warning 1292 Truncated incorrect auto_increment_offset value: '0' -select @@storage_engine; +select @@default_storage_engine; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @@storage_engine 253 6 6 Y 0 31 8 -@@storage_engine +def @@default_storage_engine 253 6 6 Y 0 31 8 +@@default_storage_engine MyISAM SET @old_server_id = @@GLOBAL.server_id; SET GLOBAL server_id = (1 << 32) - 1; diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result index 548013fcbf2..1c0e73f8842 100644 --- a/mysql-test/suite/binlog/r/binlog_grant.result +++ b/mysql-test/suite/binlog/r/binlog_grant.result @@ -6,12 +6,8 @@ Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' **** Variable SQL_LOG_BIN **** [root] -set global sql_log_bin = 1; -ERROR HY000: Variable 'sql_log_bin' is a SESSION variable and can't be used with SET GLOBAL set session sql_log_bin = 1; [plain] -set global sql_log_bin = 1; -ERROR HY000: Variable 'sql_log_bin' is a SESSION variable and can't be used with SET GLOBAL set session sql_log_bin = 1; ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation **** Variable BINLOG_FORMAT **** diff --git a/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-test/suite/binlog/t/binlog_grant.test index d36dcce4cc3..9d9c6031b5a 100644 --- a/mysql-test/suite/binlog/t/binlog_grant.test +++ b/mysql-test/suite/binlog/t/binlog_grant.test @@ -22,14 +22,10 @@ connect (root,localhost,root,,test); connection root; --echo [root] ---error ER_LOCAL_VARIABLE -set global sql_log_bin = 1; set session sql_log_bin = 1; connection plain; --echo [plain] ---error ER_LOCAL_VARIABLE -set global sql_log_bin = 1; --error ER_SPECIFIC_ACCESS_DENIED_ERROR set session sql_log_bin = 1; diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result index 21396d81ba8..bcd3849238f 100644 --- a/mysql-test/suite/innodb/r/innodb-zip.result +++ b/mysql-test/suite/innodb/r/innodb-zip.result @@ -173,19 +173,19 @@ select @@innodb_file_format; @@innodb_file_format Barracuda set global innodb_file_format=`2`; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '2' set global innodb_file_format=`-1`; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '-1' set global innodb_file_format=`Antelope`; set global innodb_file_format=`Barracuda`; set global innodb_file_format=`Cheetah`; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Cheetah' set global innodb_file_format=`abc`; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'abc' set global innodb_file_format=`1a`; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '1a' set global innodb_file_format=``; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '' set global innodb_file_per_table = on; set global innodb_file_format = `1`; set innodb_strict_mode = off; diff --git a/mysql-test/suite/innodb/r/innodb_bug47167.result b/mysql-test/suite/innodb/r/innodb_bug47167.result index cbec363d78f..cf8cb0c0d7b 100644 --- a/mysql-test/suite/innodb/r/innodb_bug47167.result +++ b/mysql-test/suite/innodb/r/innodb_bug47167.result @@ -15,10 +15,10 @@ select @@innodb_file_format_check; @@innodb_file_format_check Antelope set global innodb_file_format_check = cheetah; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'cheetah' set global innodb_file_format_check = Bear; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'Bear' set global innodb_file_format_check = on; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'ON' set global innodb_file_format_check = off; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'off' diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result index 36f176c616a..107025e4e52 100644 --- a/mysql-test/suite/innodb/r/innodb_file_format.result +++ b/mysql-test/suite/innodb/r/innodb_file_format.result @@ -8,7 +8,7 @@ Antelope set global innodb_file_format=antelope; set global innodb_file_format=barracuda; set global innodb_file_format=cheetah; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'cheetah' select @@innodb_file_format; @@innodb_file_format Barracuda @@ -17,16 +17,16 @@ select @@innodb_file_format; @@innodb_file_format Antelope set global innodb_file_format=on; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON' set global innodb_file_format=off; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off' select @@innodb_file_format; @@innodb_file_format Antelope set global innodb_file_format_check=antelope; set global innodb_file_format_check=barracuda; set global innodb_file_format_check=cheetah; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'cheetah' select @@innodb_file_format_check; @@innodb_file_format_check Barracuda @@ -35,9 +35,9 @@ select @@innodb_file_format_check; @@innodb_file_format_check Barracuda set global innodb_file_format=on; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON' set global innodb_file_format=off; -ERROR HY000: Incorrect arguments to SET +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off' select @@innodb_file_format_check; @@innodb_file_format_check Barracuda diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test index fdb9b89e37a..eb517563416 100644 --- a/mysql-test/suite/innodb/t/innodb-zip.test +++ b/mysql-test/suite/innodb/t/innodb-zip.test @@ -142,19 +142,19 @@ set global innodb_file_format=`0`; select @@innodb_file_format; set global innodb_file_format=`1`; select @@innodb_file_format; --- error ER_WRONG_ARGUMENTS +-- error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=`2`; --- error ER_WRONG_ARGUMENTS +-- error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=`-1`; set global innodb_file_format=`Antelope`; set global innodb_file_format=`Barracuda`; --- error ER_WRONG_ARGUMENTS +-- error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=`Cheetah`; --- error ER_WRONG_ARGUMENTS +-- error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=`abc`; --- error ER_WRONG_ARGUMENTS +-- error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=`1a`; --- error ER_WRONG_ARGUMENTS +-- error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=``; #test strict mode. diff --git a/mysql-test/suite/innodb/t/innodb_bug47167.test b/mysql-test/suite/innodb/t/innodb_bug47167.test index 88e927c01bd..9b8bff0292f 100644 --- a/mysql-test/suite/innodb/t/innodb_bug47167.test +++ b/mysql-test/suite/innodb/t/innodb_bug47167.test @@ -31,15 +31,15 @@ select @@innodb_file_format_check; # Following are negative tests, all should fail. --disable_warnings ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format_check = cheetah; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format_check = Bear; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format_check = on; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format_check = off; --enable_warnings diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test index 3bd1dd2fa6f..4e11da5f123 100644 --- a/mysql-test/suite/innodb/t/innodb_file_format.test +++ b/mysql-test/suite/innodb/t/innodb_file_format.test @@ -9,26 +9,26 @@ select @@innodb_file_format; select @@innodb_file_format_check; set global innodb_file_format=antelope; set global innodb_file_format=barracuda; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=cheetah; select @@innodb_file_format; set global innodb_file_format=default; select @@innodb_file_format; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=on; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=off; select @@innodb_file_format; set global innodb_file_format_check=antelope; set global innodb_file_format_check=barracuda; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format_check=cheetah; select @@innodb_file_format_check; set global innodb_file_format_check=default; select @@innodb_file_format_check; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=on; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=off; select @@innodb_file_format_check; diff --git a/mysql-test/suite/ndb/r/ndb_basic.result b/mysql-test/suite/ndb/r/ndb_basic.result index 9f4f8c0755c..cbc320908ac 100644 --- a/mysql-test/suite/ndb/r/ndb_basic.result +++ b/mysql-test/suite/ndb/r/ndb_basic.result @@ -18,11 +18,15 @@ Variable_name Value ndb_autoincrement_prefetch_sz # ndb_cache_check_time # ndb_connectstring # +ndb_distribution # ndb_extra_logging # ndb_force_send # ndb_index_stat_cache_entries # ndb_index_stat_enable # ndb_index_stat_update_freq # +ndb_mgmd_host # +ndb_nodeid # +ndb_optimized_node_selection # ndb_report_thresh_binlog_epoch_slip # ndb_report_thresh_binlog_mem_usage # ndb_use_copying_alter_table # diff --git a/mysql-test/suite/ndb/r/ndb_dd_ddl.result b/mysql-test/suite/ndb/r/ndb_dd_ddl.result index 9714a89c2ab..35516efb48c 100644 --- a/mysql-test/suite/ndb/r/ndb_dd_ddl.result +++ b/mysql-test/suite/ndb/r/ndb_dd_ddl.result @@ -308,6 +308,7 @@ ENGINE = NDB; DROP USER mysqltest_u1@localhost; DROP USER mysqltest_u2@localhost; +DROP DATABASE mysqltest2; # ----------------------------------------------------------------- # End 6.0 test diff --git a/mysql-test/suite/ndb/t/ndb_dd_ddl.test b/mysql-test/suite/ndb/t/ndb_dd_ddl.test index e8db0730687..ca39be87c94 100644 --- a/mysql-test/suite/ndb/t/ndb_dd_ddl.test +++ b/mysql-test/suite/ndb/t/ndb_dd_ddl.test @@ -462,6 +462,7 @@ ENGINE = NDB; DROP USER mysqltest_u1@localhost; DROP USER mysqltest_u2@localhost; +DROP DATABASE mysqltest2; --echo --echo # ----------------------------------------------------------------- diff --git a/mysql-test/suite/rpl/r/rpl_charset.result b/mysql-test/suite/rpl/r/rpl_charset.result index ae5cf3b0fd1..a4841b0baf3 100644 --- a/mysql-test/suite/rpl/r/rpl_charset.result +++ b/mysql-test/suite/rpl/r/rpl_charset.result @@ -116,8 +116,7 @@ latin5 select @@character_set_server; @@character_set_server latin5 -set one_shot max_join_size=10; -ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server +set one_shot max_join_size=1000000; set character_set_client=9999999; ERROR 42000: Unknown character set: '9999999' set collation_server=9999998; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result index 92ba8549ee4..44b3964f632 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -42,7 +42,7 @@ Variable_name Slave_heartbeat_period Value 4.000 set @@global.slave_net_timeout= 3 /* must be a warning */; Warnings: -Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout. +Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout. reset slave; drop table if exists t1; set @@global.slave_net_timeout= 10; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index d229e1260dd..5a47d1da596 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -38,7 +38,7 @@ RESET SLAVE; *** Warning if updated slave_net_timeout < slave_heartbeat_timeout *** SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1; Warnings: -Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout. +Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout. SET @@global.slave_net_timeout=@restore_slave_net_timeout; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result index bfdcbc6fa23..6a20480fb5a 100644 --- a/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -113,7 +113,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/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result index c2554218f73..a21bec6ae55 100644 --- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result @@ -17,6 +17,8 @@ reset slave; set @my_max_binlog_size= @@global.max_binlog_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '8191' select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result index c2554218f73..a21bec6ae55 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result @@ -17,6 +17,8 @@ reset slave; set @my_max_binlog_size= @@global.max_binlog_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '8191' select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result index 7447d12f9b2..37781aeac0c 100644 --- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result @@ -23,7 +23,7 @@ binlog_format ROW set global binlog_format=DEFAULT; show global variables like "binlog_format%"; Variable_name Value -binlog_format MIXED +binlog_format STATEMENT set global binlog_format=MIXED; show global variables like "binlog_format%"; Variable_name Value diff --git a/mysql-test/suite/rpl/r/rpl_variables_stm.result b/mysql-test/suite/rpl/r/rpl_variables_stm.result index 51484187215..7a1bcc4f44f 100644 --- a/mysql-test/suite/rpl/r/rpl_variables_stm.result +++ b/mysql-test/suite/rpl/r/rpl_variables_stm.result @@ -6,7 +6,6 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; ==== Initialization ==== [on master] -SET @m_pseudo_thread_id= @@global.pseudo_thread_id; SET @m_auto_increment_increment= @@global.auto_increment_increment; SET @m_auto_increment_offset= @@global.auto_increment_offset; SET @m_character_set_client= @@global.character_set_client; @@ -16,7 +15,6 @@ SET @m_time_zone= @@global.time_zone; SET @m_lc_time_names= @@global.lc_time_names; SET @m_collation_database= @@global.collation_database; [on slave] -SET @s_pseudo_thread_id= @@global.pseudo_thread_id; SET @s_auto_increment_increment= @@global.auto_increment_increment; SET @s_auto_increment_offset= @@global.auto_increment_offset; SET @s_character_set_client= @@global.character_set_client; @@ -25,7 +23,6 @@ SET @s_collation_server= @@global.collation_server; SET @s_time_zone= @@global.time_zone; SET @s_lc_time_names= @@global.lc_time_names; SET @s_collation_database= @@global.collation_database; -SET @@global.pseudo_thread_id= 4711; SET @@global.auto_increment_increment=19; SET @@global.auto_increment_offset=4; SET @@global.character_set_client='latin2'; @@ -505,7 +502,6 @@ DROP PROCEDURE proc; DROP FUNCTION func; DROP TRIGGER trig; DROP TABLE tstmt, tproc, tfunc, ttrig, tprep, trigger_table; -SET @@global.pseudo_thread_id= @m_pseudo_thread_id; SET @@global.auto_increment_increment= @m_auto_increment_increment; SET @@global.auto_increment_offset= @m_auto_increment_offset; SET @@global.character_set_client= @m_character_set_client; @@ -515,7 +511,6 @@ SET @@global.time_zone= @m_time_zone; SET @@global.lc_time_names= @m_lc_time_names; SET @@global.collation_database= @m_collation_database; [on slave] -SET @@global.pseudo_thread_id= @s_pseudo_thread_id; SET @@global.auto_increment_increment= @s_auto_increment_increment; SET @@global.auto_increment_offset= @s_auto_increment_offset; SET @@global.character_set_client= @s_character_set_client; diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test index c96b88a1b1a..b1abe916806 100644 --- a/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -165,7 +165,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/rpl/t/rpl_sp_effects-master.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt index 61dd7a6ad0e..27fad1403d2 100644 --- a/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt +++ b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt @@ -1 +1 @@ ---log_bin_trust_routine_creators=1 +--log_bin_trust_function_creators=1 diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt index 61dd7a6ad0e..27fad1403d2 100644 --- a/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt @@ -1 +1 @@ ---log_bin_trust_routine_creators=1 +--log_bin_trust_function_creators=1 diff --git a/mysql-test/suite/rpl/t/rpl_variables_stm.test b/mysql-test/suite/rpl/t/rpl_variables_stm.test index 67f2e50e041..c05bc42b1c2 100644 --- a/mysql-test/suite/rpl/t/rpl_variables_stm.test +++ b/mysql-test/suite/rpl/t/rpl_variables_stm.test @@ -63,7 +63,6 @@ source include/have_binlog_format_mixed_or_statement.inc; --echo [on master] connection master; -SET @m_pseudo_thread_id= @@global.pseudo_thread_id; SET @m_auto_increment_increment= @@global.auto_increment_increment; SET @m_auto_increment_offset= @@global.auto_increment_offset; SET @m_character_set_client= @@global.character_set_client; @@ -75,7 +74,6 @@ SET @m_collation_database= @@global.collation_database; --echo [on slave] connection slave; -SET @s_pseudo_thread_id= @@global.pseudo_thread_id; SET @s_auto_increment_increment= @@global.auto_increment_increment; SET @s_auto_increment_offset= @@global.auto_increment_offset; SET @s_character_set_client= @@global.character_set_client; @@ -85,7 +83,6 @@ SET @s_time_zone= @@global.time_zone; SET @s_lc_time_names= @@global.lc_time_names; SET @s_collation_database= @@global.collation_database; -SET @@global.pseudo_thread_id= 4711; SET @@global.auto_increment_increment=19; SET @@global.auto_increment_offset=4; SET @@global.character_set_client='latin2'; @@ -612,7 +609,6 @@ DROP FUNCTION func; DROP TRIGGER trig; DROP TABLE tstmt, tproc, tfunc, ttrig, tprep, trigger_table; -SET @@global.pseudo_thread_id= @m_pseudo_thread_id; SET @@global.auto_increment_increment= @m_auto_increment_increment; SET @@global.auto_increment_offset= @m_auto_increment_offset; SET @@global.character_set_client= @m_character_set_client; @@ -624,7 +620,6 @@ SET @@global.collation_database= @m_collation_database; --echo [on slave] connection slave; -SET @@global.pseudo_thread_id= @s_pseudo_thread_id; SET @@global.auto_increment_increment= @s_auto_increment_increment; SET @@global.auto_increment_offset= @s_auto_increment_offset; SET @@global.character_set_client= @s_character_set_client; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result index 9857f621bbe..b4e6c7c77b5 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result @@ -924,4 +924,5 @@ DELETE FROM t1; --- End test 5 key partition testing --- --- Do Cleanup --- DROP TABLE IF EXISTS t1; +set @@global.slave_exec_mode= DEFAULT; drop table mysql.ndb_apply_status; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result index 44ee9d01709..935a7d61dfa 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result @@ -924,4 +924,5 @@ DELETE FROM t1; --- End test 5 key partition testing --- --- Do Cleanup --- DROP TABLE IF EXISTS t1; +set @@global.slave_exec_mode= DEFAULT; drop table mysql.ndb_apply_status; 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..21265f730d3 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test @@ -31,5 +31,6 @@ CREATE TABLE mysql.ndb_apply_status --source extra/rpl_tests/rpl_ndb_2multi_eng.test +set @@global.slave_exec_mode= DEFAULT; --connection slave drop table mysql.ndb_apply_status; 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..785222f85e4 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test @@ -30,5 +30,6 @@ CREATE TABLE mysql.ndb_apply_status --source extra/rpl_tests/rpl_ndb_2multi_eng.test +set @@global.slave_exec_mode= DEFAULT; --connection slave drop table mysql.ndb_apply_status; diff --git a/mysql-test/suite/sys_vars/README b/mysql-test/suite/sys_vars/README deleted file mode 100644 index a84f00f1f62..00000000000 --- a/mysql-test/suite/sys_vars/README +++ /dev/null @@ -1,3 +0,0 @@ -Some of these tests allocate more than 4GB RAM. -So, assure that the machine on which the suite will be executed has more than 4GB RAM. - diff --git a/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc index 56ffbace173..a9580028c7e 100644 --- a/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc @@ -115,7 +115,6 @@ SET @@session.bulk_insert_buffer_size = 42949672950; SELECT @@session.bulk_insert_buffer_size; SET @@session.bulk_insert_buffer_size = -2; SELECT @@session.bulk_insert_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.bulk_insert_buffer_size = test; diff --git a/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc index ab158bc593e..0c9a7d1ddb8 100644 --- a/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc +++ b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc @@ -79,7 +79,6 @@ SET @@global.delayed_insert_limit = -1024; SELECT @@global.delayed_insert_limit; SET @@global.delayed_insert_limit = 42949672950; SELECT @@global.delayed_insert_limit; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.delayed_insert_limit = 429496729.5; diff --git a/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc index 2d16f75d4e1..e8b5ab31224 100644 --- a/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc @@ -77,7 +77,6 @@ SET @@global.delayed_queue_size = -1024; SELECT @@global.delayed_queue_size; SET @@global.delayed_queue_size = 42949672950; SELECT @@global.delayed_queue_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.delayed_queue_size = 429496729.5; diff --git a/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc index 880dac4cac4..618b70f3ac3 100644 --- a/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc @@ -45,40 +45,24 @@ SELECT @start_session_value; # Display the DEFAULT value of join_buffer_size # ################################################################ -SET @@global.join_buffer_size = 8200; SET @@global.join_buffer_size = DEFAULT; SELECT @@global.join_buffer_size; -SET @@session.join_buffer_size = 8200; SET @@session.join_buffer_size = DEFAULT; SELECT @@session.join_buffer_size; ---echo '#--------------------FN_DYNVARS_053_02-------------------------#' -################################################################### -# Check the DEFAULT value of join_buffer_size # -################################################################### - -SET @@global.join_buffer_size = DEFAULT; -SELECT @@global.join_buffer_size = 131072; - -SET @@session.join_buffer_size = DEFAULT; -SELECT @@session.join_buffer_size = 131072; - - --echo '#--------------------FN_DYNVARS_053_03-------------------------#' ########################################################################## # Change the value of join_buffer_size to a valid value for GLOBAL Scope # ########################################################################## SET @@global.join_buffer_size = 8200; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SELECT @@global.join_buffer_size; SET @@global.join_buffer_size = 65536; SELECT @@global.join_buffer_size; SET @@global.join_buffer_size = 4294967295; SELECT @@global.join_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --echo '#--------------------FN_DYNVARS_053_04-------------------------#' ########################################################################### @@ -86,13 +70,11 @@ echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable ########################################################################### SET @@session.join_buffer_size = 8200; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +SELECT @@session.join_buffer_size; SET @@session.join_buffer_size = 65536; SELECT @@session.join_buffer_size; SET @@session.join_buffer_size = 4294967295; SELECT @@session.join_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --echo '#------------------FN_DYNVARS_053_05-----------------------#' ############################################################ @@ -100,40 +82,38 @@ echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable ############################################################ SET @@global.join_buffer_size = 0; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SELECT @@global.join_buffer_size; SET @@global.join_buffer_size = -1024; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -SET @@global.join_buffer_size = 8199; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SELECT @@global.join_buffer_size; +SET @@global.join_buffer_size = 127; +SELECT @@global.join_buffer_size; SET @@global.join_buffer_size = 42949672951; SELECT @@global.join_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.join_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.join_buffer_size = 65530.34; SELECT @@global.join_buffer_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.join_buffer_size = test; SELECT @@global.join_buffer_size; SET @@session.join_buffer_size = 0; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -SET @@session.join_buffer_size = -2; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -SET @@session.join_buffer_size = 8199; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +SELECT @@session.join_buffer_size; +SET @@session.join_buffer_size = -1024; +SELECT @@session.join_buffer_size; +SET @@session.join_buffer_size = 127; +SELECT @@session.join_buffer_size; SET @@session.join_buffer_size = 42949672951; SELECT @@session.join_buffer_size; ---Error ER_PARSE_ERROR -SET @@session.join_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.join_buffer_size = 65530.34; SELECT @@session.join_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.join_buffer_size = test; SELECT @@session.join_buffer_size; - --echo '#------------------FN_DYNVARS_053_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # @@ -160,11 +140,7 @@ WHERE VARIABLE_NAME='join_buffer_size'; #################################################################### SET @@global.join_buffer_size = TRUE; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; SET @@global.join_buffer_size = FALSE; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; ---echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; - --echo '#---------------------FN_DYNVARS_001_09----------------------#' ################################################################################# @@ -174,7 +150,6 @@ SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; SET @@global.join_buffer_size = 10; SELECT @@join_buffer_size = @@global.join_buffer_size; - --echo '#---------------------FN_DYNVARS_001_10----------------------#' ######################################################################################################## # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # @@ -184,14 +159,13 @@ SET @@join_buffer_size = 100; SELECT @@join_buffer_size = @@local.join_buffer_size; SELECT @@local.join_buffer_size = @@session.join_buffer_size; - --echo '#---------------------FN_DYNVARS_001_11----------------------#' ############################################################################## # Check if join_buffer_size can be accessed with and without @@ sign # ############################################################################## SET join_buffer_size = 1; -SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228; +SELECT @@join_buffer_size; --Error ER_UNKNOWN_TABLE SELECT local.join_buffer_size; --Error ER_UNKNOWN_TABLE @@ -199,7 +173,6 @@ SELECT session.join_buffer_size; --Error ER_BAD_FIELD_ERROR SELECT join_buffer_size = @@session.join_buffer_size; - #################################### # Restore initial value # #################################### diff --git a/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc index 7841ad2cedc..e0970016577 100644 --- a/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc +++ b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc @@ -43,10 +43,7 @@ SELECT @start_value; # Display the DEFAULT value of key_cache_age_threshold # ################################################################################ -SET @@global.key_cache_age_threshold = 99; ---Error ER_NO_DEFAULT SET @@global.key_cache_age_threshold = DEFAULT; ---echo 'Bug# 34878: This variable has default value according to documentation'; SELECT @@global.key_cache_age_threshold; @@ -72,8 +69,6 @@ SET @@global.key_cache_age_threshold = 1800; SELECT @@global.key_cache_age_threshold; SET @@global.key_cache_age_threshold = 65535; SELECT @@global.key_cache_age_threshold; ---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; - --echo '#--------------------FN_DYNVARS_056_04-------------------------#' ########################################################################### @@ -92,8 +87,6 @@ SELECT @@global.key_cache_age_threshold; SET @@global.key_cache_age_threshold = 99; SELECT @@global.key_cache_age_threshold; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.key_cache_age_threshold = ON; SELECT @@global.key_cache_age_threshold; diff --git a/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc index cd7e1023649..54b4fc4c937 100644 --- a/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc +++ b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc @@ -109,8 +109,8 @@ SET @@global.log_warnings = 100000000000; SELECT @@global.log_warnings; SET @@global.log_warnings = -1024; SELECT @@global.log_warnings; ---Error ER_PARSE_ERROR -SET @@global.log_warnings = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.log_warnings = 65530.34; SELECT @@global.log_warnings; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.log_warnings = test; @@ -120,9 +120,8 @@ SET @@session.log_warnings = 100000000000; SELECT @@session.log_warnings; SET @@session.log_warnings = -2; SELECT @@session.log_warnings; ---Error ER_PARSE_ERROR -SET @@session.log_warnings = 65530.34.; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.log_warnings = 65530.34; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.log_warnings = test; diff --git a/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc index 530022652a1..ffad23f6ba7 100644 --- a/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc +++ b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc @@ -46,7 +46,6 @@ SELECT @start_value; SET @@global.max_connect_errors = 5000; SET @@global.max_connect_errors = DEFAULT; SELECT @@global.max_connect_errors; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; --echo '#---------------------FN_DYNVARS_073_02-------------------------#' ############################################### @@ -71,7 +70,6 @@ SET @@global.max_connect_errors = 1; SELECT @@global.max_connect_errors; SET @@global.max_connect_errors = 2; SELECT @@global.max_connect_errors; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#--------------------FN_DYNVARS_073_04-------------------------#' @@ -93,8 +91,6 @@ SELECT @@global.max_connect_errors; SET @@global.max_connect_errors = 4294967296; SELECT @@global.max_connect_errors; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_connect_errors = ON; SELECT @@global.max_connect_errors; diff --git a/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc index 23c3c5b2a95..08aff37054d 100644 --- a/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc +++ b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc @@ -110,8 +110,8 @@ SET @@global.max_seeks_for_key = -1024; SELECT @@global.max_seeks_for_key; SET @@global.max_seeks_for_key = 4294967296; SELECT @@global.max_seeks_for_key; ---Error ER_PARSE_ERROR -SET @@global.max_seeks_for_key = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_seeks_for_key = 65530.34; SELECT @@global.max_seeks_for_key; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_seeks_for_key = test; @@ -121,11 +121,10 @@ SET @@session.max_seeks_for_key = 0; SELECT @@session.max_seeks_for_key; SET @@session.max_seeks_for_key = -2; SELECT @@session.max_seeks_for_key; ---Error ER_PARSE_ERROR -SET @@session.max_seeks_for_key = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_seeks_for_key = 65530.34; SET @@session.max_seeks_for_key = 4294967296; SELECT @@session.max_seeks_for_key; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.max_seeks_for_key = test; diff --git a/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc index e24d97f47dd..236c59837d8 100644 --- a/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc +++ b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc @@ -121,8 +121,8 @@ SET @@global.max_tmp_tables = -1; SELECT @@global.max_tmp_tables; SET @@global.max_tmp_tables = 429496729500; SELECT @@global.max_tmp_tables; ---Error ER_PARSE_ERROR -SET @@global.max_tmp_tables = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_tmp_tables = 65530.34; SELECT @@global.max_tmp_tables; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_tmp_tables = test; @@ -136,8 +136,8 @@ SET @@session.max_tmp_tables = 429496729500; SELECT @@session.max_tmp_tables; SET @@session.max_tmp_tables = -001; SELECT @@session.max_tmp_tables; ---Error ER_PARSE_ERROR -SET @@session.max_tmp_tables = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_tmp_tables = 65530.34; SET @@session.max_tmp_tables = 10737418241; SELECT @@session.max_tmp_tables; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc index 80d5b7cc747..4e92a3057b0 100644 --- a/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc +++ b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc @@ -88,8 +88,8 @@ SET @@global.max_write_lock_count = -1; SELECT @@global.max_write_lock_count; SET @@global.max_write_lock_count = 429496729500; SELECT @@global.max_write_lock_count; ---Error ER_PARSE_ERROR -SET @@global.max_write_lock_count = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_write_lock_count = 65530.34; SELECT @@global.max_write_lock_count; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_write_lock_count = test; diff --git a/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc index c032d4a9d6d..cd80d1d0998 100644 --- a/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc +++ b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc @@ -116,8 +116,8 @@ SET @@global.min_examined_row_limit = -1024; SELECT @@global.min_examined_row_limit; SET @@global.min_examined_row_limit = 429496729500; SELECT @@global.min_examined_row_limit; ---Error ER_PARSE_ERROR -SET @@global.min_examined_row_limit = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.min_examined_row_limit = 65530.34; SELECT @@global.min_examined_row_limit; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.min_examined_row_limit = test; @@ -127,11 +127,10 @@ SET @@session.min_examined_row_limit = 4294967296; SELECT @@session.min_examined_row_limit; SET @@session.min_examined_row_limit = -1; SELECT @@session.min_examined_row_limit; ---Error ER_PARSE_ERROR -SET @@session.min_examined_row_limit = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.min_examined_row_limit = 65530.34; SET @@session.min_examined_row_limit = 4294967295021; SELECT @@session.min_examined_row_limit; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.min_examined_row_limit = test; diff --git a/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc index 23f0607b439..9a975b977eb 100644 --- a/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc @@ -47,8 +47,6 @@ SET @@global.myisam_max_sort_file_size = 500000; SET @@global.myisam_max_sort_file_size = DEFAULT; SELECT @@global.myisam_max_sort_file_size; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - --echo '#--------------------FN_DYNVARS_094_02-------------------------#' ################################################################### # Check the DEFAULT value of myisam_max_sort_file_size # @@ -102,8 +100,8 @@ SET @@global.myisam_max_sort_file_size = -2147483648; SELECT @@global.myisam_max_sort_file_size; SET @@global.myisam_max_sort_file_size = -2147483649; SELECT @@global.myisam_max_sort_file_size; ---Error ER_PARSE_ERROR -SET @@global.myisam_max_sort_file_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_max_sort_file_size = 65530.34; SELECT @@global.myisam_max_sort_file_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_max_sort_file_size = 2147483649.56; @@ -111,9 +109,6 @@ SELECT @@global.myisam_max_sort_file_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_max_sort_file_size = 1G; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - --echo '#------------------FN_DYNVARS_094_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # diff --git a/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc index 8485e79ff03..e3aca46536d 100644 --- a/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc +++ b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc @@ -114,8 +114,8 @@ SET @@global.myisam_repair_threads = 429496729533; SELECT @@global.myisam_repair_threads ; ---Error ER_PARSE_ERROR -SET @@global.myisam_repair_threads = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_repair_threads = 65530.34; SELECT @@global.myisam_repair_threads ; --Error ER_WRONG_TYPE_FOR_VAR @@ -141,9 +141,8 @@ SELECT @@session.myisam_repair_threads ; SET @@session.myisam_repair_threads = -2; SELECT @@session.myisam_repair_threads ; ---Error ER_PARSE_ERROR - -SET @@session.myisam_repair_threads = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.myisam_repair_threads = 65530.34; SELECT @@session.myisam_repair_threads ; diff --git a/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc index 8e36d8a2c70..c92c2f85adb 100644 --- a/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc @@ -113,8 +113,8 @@ SET @@global.myisam_sort_buffer_size = 429496729533; SELECT @@global.myisam_sort_buffer_size ; ---Error ER_PARSE_ERROR -SET @@global.myisam_sort_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_sort_buffer_size = 65530.34; SELECT @@global.myisam_sort_buffer_size ; --Error ER_WRONG_TYPE_FOR_VAR @@ -140,9 +140,8 @@ SELECT @@session.myisam_sort_buffer_size ; SET @@session.myisam_sort_buffer_size = -2; SELECT @@session.myisam_sort_buffer_size ; ---Error ER_PARSE_ERROR - -SET @@session.myisam_sort_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.myisam_sort_buffer_size = 65530.34; SELECT @@session.myisam_sort_buffer_size ; diff --git a/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc index 537d8eea6c6..46b8d0350fe 100644 --- a/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc +++ b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc @@ -111,8 +111,8 @@ SET @@global.net_retry_count = 4294967296; SELECT @@global.net_retry_count; SET @@global.net_retry_count = 429496729500; SELECT @@global.net_retry_count; ---Error ER_PARSE_ERROR -SET @@global.net_retry_count = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.net_retry_count = 65530.34; SELECT @@global.net_retry_count; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.net_retry_count = test; @@ -122,15 +122,13 @@ SET @@session.net_retry_count = 0; SELECT @@session.net_retry_count; SET @@session.net_retry_count = -2; SELECT @@session.net_retry_count; ---Error ER_PARSE_ERROR -SET @@session.net_retry_count = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.net_retry_count = 65530.34; SET @@session.net_retry_count = 6555015425; SELECT @@session.net_retry_count; SET @@session.net_retry_count = 4294967296; SELECT @@session.net_retry_count; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@session.net_retry_count = test; SELECT @@session.net_retry_count; diff --git a/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc index 208fe6b3da4..35d80f36f6d 100644 --- a/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc @@ -82,9 +82,6 @@ SELECT @@global.query_alloc_block_size; SET @@global.query_alloc_block_size = 65536; SELECT @@global.query_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - --echo '#--------------------FN_DYNVARS_130_04-------------------------#' ################################################################################# # Change the value of query_alloc_block_size to a valid value for SESSION Scope # @@ -114,8 +111,8 @@ SET @@global.query_alloc_block_size = 1023; SELECT @@global.query_alloc_block_size; SET @@global.query_alloc_block_size = 4294967296; SELECT @@global.query_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@global.query_alloc_block_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_alloc_block_size = 65530.34; SELECT @@global.query_alloc_block_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.query_alloc_block_size = test; @@ -125,13 +122,12 @@ SET @@session.query_alloc_block_size = 64; SELECT @@session.query_alloc_block_size; SET @@session.query_alloc_block_size = -2; SELECT @@session.query_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@session.query_alloc_block_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.query_alloc_block_size = 65530.34; SET @@session.query_alloc_block_size = 1023; SELECT @@session.query_alloc_block_size; -SET @@session.query_alloc_block_size = 4294967296; -SELECT @@session.query_alloc_block_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +#SET @@session.query_alloc_block_size = 4294967296; +#SELECT @@session.query_alloc_block_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.query_alloc_block_size = test; @@ -144,7 +140,6 @@ SELECT @@session.query_alloc_block_size; #SET @@global.query_alloc_block_size = 1; #SET @@session.query_alloc_block_size = 12; ---echo 'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement'; SET @@global.query_alloc_block_size = 1; SET @@session.query_alloc_block_size = 12; diff --git a/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc index 2eb4a597eef..c94ba3a52dd 100644 --- a/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc +++ b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc @@ -91,7 +91,6 @@ SET @@global.query_cache_limit = -1024; SELECT @@global.query_cache_limit; SET @@global.query_cache_limit = 42949672950; SELECT @@global.query_cache_limit; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.query_cache_limit = ON; diff --git a/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc index 1b65e035b18..9276a987dfb 100644 --- a/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc +++ b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc @@ -70,12 +70,10 @@ SET @@global.query_cache_min_res_unit = 0; SELECT @@global.query_cache_min_res_unit; SET @@global.query_cache_min_res_unit = 1; SELECT @@global.query_cache_min_res_unit; ---echo 'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512'; SET @@global.query_cache_min_res_unit = 512; SELECT @@global.query_cache_min_res_unit; SET @@global.query_cache_min_res_unit = 513; SELECT @@global.query_cache_min_res_unit; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; SET @@global.query_cache_min_res_unit = 1048576; SELECT @@global.query_cache_min_res_unit; SET @@global.query_cache_min_res_unit = 1048575; @@ -100,7 +98,6 @@ SET @@global.query_cache_min_res_unit = -1024; SELECT @@global.query_cache_min_res_unit; SET @@global.query_cache_min_res_unit = 42949672950; SELECT @@global.query_cache_min_res_unit; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.query_cache_min_res_unit = ON; diff --git a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc index 1f8c63c55bb..83edefaaf25 100644 --- a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc @@ -68,8 +68,6 @@ SET @@global.query_cache_size = 512; SELECT @@global.query_cache_size; SET @@global.query_cache_size = 1024; SELECT @@global.query_cache_size; ---echo : 'Bug#34880: Warnings are coming on assinging valid values to variable ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; SET @@global.query_cache_size = 1048576; SELECT @@global.query_cache_size; SET @@global.query_cache_size = 1048575; @@ -93,8 +91,6 @@ SET @@global.query_cache_size = -1024; SELECT @@global.query_cache_size; SET @@global.query_cache_size = 42949672950; SELECT @@global.query_cache_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.query_cache_size = ON; SELECT @@global.query_cache_size; diff --git a/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc index 37692cc8c35..cfa74665dd9 100644 --- a/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc @@ -73,12 +73,10 @@ SELECT @@session.range_alloc_block_size = 2048; SET @@global.range_alloc_block_size = 2048; SELECT @@global.range_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; SET @@global.range_alloc_block_size = 4294967295; SELECT @@global.range_alloc_block_size; SET @@global.range_alloc_block_size = 4294967294; SELECT @@global.range_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#--------------------FN_DYNVARS_137_04-------------------------#' @@ -105,8 +103,8 @@ SET @@global.range_alloc_block_size = -1024; SELECT @@global.range_alloc_block_size; SET @@global.range_alloc_block_size = 42949672951; SELECT @@global.range_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@global.range_alloc_block_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.range_alloc_block_size = 65530.34; SELECT @@global.range_alloc_block_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.range_alloc_block_size = test; @@ -116,11 +114,10 @@ SET @@session.range_alloc_block_size = 0; SELECT @@session.range_alloc_block_size; SET @@session.range_alloc_block_size = -2; SELECT @@session.range_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@session.range_alloc_block_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.range_alloc_block_size = 65530.34; SET @@session.range_alloc_block_size = 4294967296; SELECT @@session.range_alloc_block_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.range_alloc_block_size = test; diff --git a/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc index f9ae3968b31..b185eeb21a7 100644 --- a/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc +++ b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc @@ -93,8 +93,8 @@ SET @@global.rpl_recovery_rank = -2147483648; SELECT @@global.rpl_recovery_rank; SET @@global.rpl_recovery_rank = -2147483649; SELECT @@global.rpl_recovery_rank; ---Error ER_PARSE_ERROR -SET @@global.rpl_recovery_rank = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.rpl_recovery_rank = 65530.34; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.rpl_recovery_rank = 2147483649.56; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc index 28ba8791b0a..17146f07bc0 100644 --- a/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc +++ b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc @@ -105,10 +105,8 @@ SELECT @@global.slave_transaction_retries; SET @@global.slave_transaction_retries = 2147483649*2147483649; SELECT @@global.slave_transaction_retries; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - ---Error ER_PARSE_ERROR -SET @@global.slave_transaction_retries = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_transaction_retries = 65530.34; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.slave_transaction_retries = '100'; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc index 19d8b442c2c..a88ad65a076 100644 --- a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc @@ -40,12 +40,6 @@ # Save initial value # ############################################################# -# due to differences when running on Windows (Bug#36695) ---source include/not_windows.inc - -let $kbrange32 = BETWEEN 32776 AND 32999; -let $mbrange2 = BETWEEN 2097116 AND 2100000; - --disable_warnings SET @start_global_value = @@global.sort_buffer_size; @@ -59,12 +53,12 @@ SET @start_session_value = @@session.sort_buffer_size; SET @@global.sort_buffer_size = 1000; SET @@global.sort_buffer_size = DEFAULT; eval -SELECT @@global.sort_buffer_size $mbrange2; +SELECT @@global.sort_buffer_size; SET @@session.sort_buffer_size = 2000; SET @@session.sort_buffer_size = DEFAULT; eval -SELECT @@session.sort_buffer_size $mbrange2; +SELECT @@session.sort_buffer_size; --echo '#--------------------FN_DYNVARS_151_02-------------------------#' @@ -74,11 +68,11 @@ SELECT @@session.sort_buffer_size $mbrange2; SET @@global.sort_buffer_size = DEFAULT; eval -SELECT @@global.sort_buffer_size $mbrange2; +SELECT @@global.sort_buffer_size; SET @@session.sort_buffer_size = DEFAULT; eval -SELECT @@session.sort_buffer_size $mbrange2; +SELECT @@session.sort_buffer_size; --echo '#--------------------FN_DYNVARS_151_03-------------------------#' @@ -88,10 +82,10 @@ SELECT @@session.sort_buffer_size $mbrange2; SET @@global.sort_buffer_size = 32776; eval -SELECT @@global.sort_buffer_size $kbrange32; +SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = 32777; eval -SELECT @@global.sort_buffer_size $kbrange32; +SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = 4294967295; SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = 4294967294; @@ -104,10 +98,10 @@ SELECT @@global.sort_buffer_size; SET @@session.sort_buffer_size = 32776; eval -SELECT @@session.sort_buffer_size $kbrange32; +SELECT @@session.sort_buffer_size; SET @@session.sort_buffer_size = 32777; eval -SELECT @@session.sort_buffer_size $kbrange32; +SELECT @@session.sort_buffer_size; SET @@session.sort_buffer_size = 4294967295; SELECT @@session.sort_buffer_size; SET @@session.sort_buffer_size = 4294967294; @@ -121,14 +115,14 @@ SELECT @@session.sort_buffer_size; SET @@global.sort_buffer_size = 32775; eval -SELECT @@global.sort_buffer_size $kbrange32; +SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = -1024; eval -SELECT @@global.sort_buffer_size $kbrange32; +SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = 4294967296; SELECT @@global.sort_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.sort_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.sort_buffer_size = 65530.34; SELECT @@global.sort_buffer_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.sort_buffer_size = test; @@ -136,12 +130,12 @@ SELECT @@global.sort_buffer_size; SET @@session.sort_buffer_size = 32775; eval -SELECT @@session.sort_buffer_size $kbrange32; +SELECT @@session.sort_buffer_size; SET @@session.sort_buffer_size = -2; eval -SELECT @@session.sort_buffer_size $kbrange32; ---Error ER_PARSE_ERROR -SET @@session.sort_buffer_size = 65530.34.; +SELECT @@session.sort_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.sort_buffer_size = 65530.34; SET @@session.sort_buffer_size = 4294967296; SELECT @@session.sort_buffer_size; @@ -173,10 +167,10 @@ INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; SET @@global.sort_buffer_size = TRUE; eval -SELECT @@global.sort_buffer_size $kbrange32; +SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = FALSE; eval -SELECT @@global.sort_buffer_size $kbrange32; +SELECT @@global.sort_buffer_size; --echo '#---------------------FN_DYNVARS_151_09----------------------#' #################################################################################### @@ -203,7 +197,7 @@ SELECT @@local.sort_buffer_size = @@session.sort_buffer_size; SET sort_buffer_size = 9100; eval -SELECT @@sort_buffer_size $kbrange32; +SELECT @@sort_buffer_size; --Error ER_UNKNOWN_TABLE SELECT local.sort_buffer_size; --Error ER_UNKNOWN_TABLE diff --git a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc index c14383b86c6..4a69bbcdb01 100644 --- a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc @@ -82,7 +82,6 @@ SELECT @@global.transaction_alloc_block_size; SET @@global.transaction_alloc_block_size = 4294967295; SELECT @@global.transaction_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#--------------------FN_DYNVARS_005_04-------------------------#' ################################################################### @@ -97,7 +96,6 @@ SELECT @@session.transaction_alloc_block_size; SET @@session.transaction_alloc_block_size = 65535; SELECT @@session.transaction_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#------------------FN_DYNVARS_005_05-----------------------#' @@ -115,8 +113,6 @@ SELECT @@global.transaction_alloc_block_size; SET @@global.transaction_alloc_block_size = 123456789201; SELECT @@global.transaction_alloc_block_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - -- Error ER_WRONG_TYPE_FOR_VAR SET @@global.transaction_alloc_block_size = ON; @@ -143,8 +139,6 @@ SELECT @@global.transaction_alloc_block_size; SET @@session.transaction_alloc_block_size = 12345678901; SELECT @@session.transaction_alloc_block_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - -- Error ER_WRONG_TYPE_FOR_VAR SET @@session.transaction_alloc_block_size = ON; diff --git a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc index 1ca302a19e0..56c93163621 100644 --- a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc +++ b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc @@ -39,8 +39,6 @@ SELECT @start_global_value; SET @start_session_value = @@session.transaction_prealloc_size; SELECT @start_session_value; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - --echo '#--------------------FN_DYNVARS_005_01-------------------------#' ######################################################################## # Display the DEFAULT value of transaction_prealloc_size # @@ -106,8 +104,6 @@ SELECT @@global.transaction_prealloc_size; SET @@global.transaction_prealloc_size = -1024; SELECT @@global.transaction_prealloc_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - -- Error ER_WRONG_TYPE_FOR_VAR SET @@global.transaction_prealloc_size = ON; diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result new file mode 100644 index 00000000000..abd1f5d2bd6 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -0,0 +1,12 @@ +create table t1 (test_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; +There should be *no* variables listed below: +drop table t1; diff --git a/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result b/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result index 3cfdc54457b..3e66041856f 100644 --- a/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result +++ b/mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result @@ -71,8 +71,8 @@ Warning 1292 Truncated incorrect auto_increment_increment value: '65536' SELECT @@global.auto_increment_increment; @@global.auto_increment_increment 65535 -SET @@global.auto_increment_increment = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.auto_increment_increment = 65530.34; +ERROR 42000: Incorrect argument type to variable 'auto_increment_increment' SELECT @@global.auto_increment_increment; @@global.auto_increment_increment 65535 @@ -93,15 +93,14 @@ Warning 1292 Truncated incorrect auto_increment_increment value: '-2' SELECT @@session.auto_increment_increment; @@session.auto_increment_increment 1 -SET @@session.auto_increment_increment = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.auto_increment_increment = 65530.34; +ERROR 42000: Incorrect argument type to variable 'auto_increment_increment' SET @@session.auto_increment_increment = 65550; Warnings: Warning 1292 Truncated incorrect auto_increment_increment value: '65550' SELECT @@session.auto_increment_increment; @@session.auto_increment_increment 65535 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; SET @@session.auto_increment_increment = test; ERROR 42000: Incorrect argument type to variable 'auto_increment_increment' SELECT @@session.auto_increment_increment; diff --git a/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result index eeaa3949886..df3ca1ab093 100644 --- a/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result +++ b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result @@ -95,8 +95,6 @@ id name 113 Record_8 115 Record_9 116 Record_10 -'Bug#35362: Here Record_10 id should be 120 instead of 115 because we' -'have set the value of variable to 5' SET @@session.auto_increment_increment = 1; SELECT @@auto_increment_increment; @@auto_increment_increment @@ -189,7 +187,6 @@ id name 127 Record_16 128 Record_17 129 Record_18 -'Bug#35364: Variable is incrementing some random values on assigning -ve value' ## Disconnecting test_con2 ## ## Dropping table t1 ## DROP table if exists t1; diff --git a/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result b/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result index 7752851cb4c..cc7b6b693c0 100644 --- a/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result +++ b/mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result @@ -104,7 +104,6 @@ Warning 1292 Truncated incorrect auto_increment_offset value: '65550' SELECT @@session.auto_increment_offset; @@session.auto_increment_offset 65535 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' SET @@session.auto_increment_offset = ON; ERROR 42000: Incorrect argument type to variable 'auto_increment_offset' SELECT @@session.auto_increment_offset; diff --git a/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result index e166cb149f6..d2b5b828c04 100644 --- a/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result +++ b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result @@ -84,8 +84,6 @@ id name ## Setting value of variable less than last insert id ## SET @@session.auto_increment_offset = 5; INSERT into t1(name) values('Record_9'); -'Bug#35367: Random value of id is increasing on assigning value to'; -'variable that is less than current offset'; INSERT into t1(name) values('Record_10'); INSERT into t1(name) values('Record_11'); INSERT into t1(name) values('Record_12'); @@ -125,8 +123,6 @@ id name 125 Record_12 134 Record_13 140 Record_14 -'Bug#35369: Some invalid value of id is increasing on assigning value to'; -'variable that is greater than auto_increment_increment'; '#--------------------FN_DYNVARS_002_06-------------------------#' ## Changing datatype of column id with primary key to SmallInt ## ALTER table t1 modify id SMALLINT NOT NULL auto_increment; @@ -206,8 +202,6 @@ id name 180 Record_18 181 Record_17 191 Record_18 -'Bug#35370: Some invalid value of id is increasing on assigning negative'; -' value in variable'; ## Assigning value that is out of range of variable ## SET @@auto_increment_offset = 65536; Warnings: diff --git a/mysql-test/suite/sys_vars/r/auto_commit_basic.result b/mysql-test/suite/sys_vars/r/autocommit_basic.result similarity index 89% rename from mysql-test/suite/sys_vars/r/auto_commit_basic.result rename to mysql-test/suite/sys_vars/r/autocommit_basic.result index 96cfd3e7ee6..68531f8b5a6 100644 --- a/mysql-test/suite/sys_vars/r/auto_commit_basic.result +++ b/mysql-test/suite/sys_vars/r/autocommit_basic.result @@ -1,4 +1,4 @@ -SET @start_value = @@autocommit; +SET @start_value = @@global.autocommit; SELECT @start_value; @start_value 1 @@ -7,8 +7,7 @@ SET @@autocommit = 0; SET @@autocommit = DEFAULT; SELECT @@autocommit; @@autocommit -0 -'Bug: variable DEFAULT value not working and is not throwing error' +1 '#---------------------FN_DYNVARS_003_02-------------------------#' SET @@autocommit = @start_value; SELECT @@autocommit = 1; @@ -50,16 +49,16 @@ SET @@autocommit = ''; ERROR 42000: Variable 'autocommit' can't be set to the value of '' '#-------------------FN_DYNVARS_003_05----------------------------#' SET @@global.autocommit = 0; -ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL SELECT @@global.autocommit; -ERROR HY000: Variable 'autocommit' is a SESSION variable +@@global.autocommit +0 +SET @@global.autocommit = 1; '#----------------------FN_DYNVARS_003_06------------------------#' SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='autocommit'; IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE 1 -Bug # 34839: Values in variable and information_schema do not match for autocommit '#----------------------FN_DYNVARS_003_07------------------------#' SET @@autocommit = 1; SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE @@ -111,7 +110,7 @@ SELECT session.autocommit; ERROR 42S02: Unknown table 'session' in field list SELECT autocommit = @@session.autocommit; ERROR 42S22: Unknown column 'autocommit' in 'field list' -SET @@autocommit = @start_value; -SELECT @@autocommit; -@@autocommit +SET @@global.autocommit = @start_value; +SELECT @@global.autocommit; +@@global.autocommit 1 diff --git a/mysql-test/suite/sys_vars/r/autocommit_func.result b/mysql-test/suite/sys_vars/r/autocommit_func.result index 47c2c921022..8fe7c0bc90e 100644 --- a/mysql-test/suite/sys_vars/r/autocommit_func.result +++ b/mysql-test/suite/sys_vars/r/autocommit_func.result @@ -89,7 +89,6 @@ id name 1 Record_1 2 Record_2 3 Record_3 -'Bug#35373: Records donot get committed in transaction on switching connections' INSERT into t1(name) values('Record_6'); SELECT * from t1; id name diff --git a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result index 26e33a384b9..e0a939758d5 100644 --- a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result +++ b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_basic.result @@ -58,7 +58,6 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='automatic_sp_privileges'; IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE 1 -'Bug# 34839: Values in variable and information_schema donot match' '#---------------------FN_DYNVARS_004_07----------------------#' SET @@global.automatic_sp_privileges = OFF; SELECT @@global.automatic_sp_privileges; diff --git a/mysql-test/suite/sys_vars/r/back_log_basic.result b/mysql-test/suite/sys_vars/r/back_log_basic.result new file mode 100644 index 00000000000..5cfb0da65d6 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/back_log_basic.result @@ -0,0 +1,21 @@ +select @@global.back_log; +@@global.back_log +50 +select @@session.back_log; +ERROR HY000: Variable 'back_log' is a GLOBAL variable +show global variables like 'back_log'; +Variable_name Value +back_log 50 +show session variables like 'back_log'; +Variable_name Value +back_log 50 +select * from information_schema.global_variables where variable_name='back_log'; +VARIABLE_NAME VARIABLE_VALUE +BACK_LOG 50 +select * from information_schema.session_variables where variable_name='back_log'; +VARIABLE_NAME VARIABLE_VALUE +BACK_LOG 50 +set global back_log=1; +ERROR HY000: Variable 'back_log' is a read only variable +set session back_log=1; +ERROR HY000: Variable 'back_log' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/big_tables_basic.result b/mysql-test/suite/sys_vars/r/big_tables_basic.result index e88caae47cf..fac9be20d8d 100644 --- a/mysql-test/suite/sys_vars/r/big_tables_basic.result +++ b/mysql-test/suite/sys_vars/r/big_tables_basic.result @@ -7,8 +7,7 @@ SET @@big_tables = 1; SET @@big_tables = DEFAULT; SELECT @@big_tables; @@big_tables -1 -'Bug# 34829: No default value for variable and setting default does not raise error'; +0 '#--------------------FN_DYNVARS_005_02------------------------#' SET @@big_tables = 0; SELECT @@big_tables; @@ -44,17 +43,17 @@ ERROR 42000: Variable 'big_tables' can't be set to the value of ' ' SET @@big_tables = ''; ERROR 42000: Variable 'big_tables' can't be set to the value of '' '#-------------------FN_DYNVARS_005_04----------------------------#' -SET @@global.big_tables = 0; -ERROR HY000: Variable 'big_tables' is a SESSION variable and can't be used with SET GLOBAL +SET @@global.big_tables = 1-@@global.big_tables; SELECT @@global.big_tables; -ERROR HY000: Variable 'big_tables' is a SESSION variable +@@global.big_tables +1 +SET @@global.big_tables = 1-@@global.big_tables; '#----------------------FN_DYNVARS_005_05------------------------#' SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='big_tables'; IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE 1 -Bug # 34839: Values in variable and information_schema do not match for autocommit '#---------------------FN_DYNVARS_005_06----------------------#' SET @@big_tables = OFF; SELECT @@big_tables; diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result index 2f439c8f834..d378765d96f 100644 --- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result +++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result @@ -21,14 +21,20 @@ SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 4096 SET @@global.binlog_cache_size = 4294967295; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '4294967295' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 4294963200 SET @@global.binlog_cache_size = 10000; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '10000' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 8192 SET @@global.binlog_cache_size = 21221204; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '21221204' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 21217280 diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result index 3858df0f4d6..95693c6a1ba 100644 --- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result +++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result @@ -21,14 +21,20 @@ SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 4096 SET @@global.binlog_cache_size = 4294967295; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '4294967295' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 4294963200 SET @@global.binlog_cache_size = 10000; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '10000' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 8192 SET @@global.binlog_cache_size = 21221204; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '21221204' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 21217280 @@ -49,6 +55,8 @@ SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 4096 SET @@global.binlog_cache_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '42949672950' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size 42949668864 diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result index 3e071f76f98..497fe531fec 100644 --- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result +++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result @@ -91,7 +91,6 @@ Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2' SELECT @@session.bulk_insert_buffer_size; @@session.bulk_insert_buffer_size 0 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' SET @@session.bulk_insert_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' SET @@session.bulk_insert_buffer_size = 429496.10; diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result index 320290fbca1..e687a86c68d 100644 --- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result +++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result @@ -87,7 +87,6 @@ Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2' SELECT @@session.bulk_insert_buffer_size; @@session.bulk_insert_buffer_size 0 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' SET @@session.bulk_insert_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' SET @@session.bulk_insert_buffer_size = 429496.10; diff --git a/mysql-test/suite/sys_vars/r/character_set_client_basic.result b/mysql-test/suite/sys_vars/r/character_set_client_basic.result index c946d5109a8..78993015a24 100644 --- a/mysql-test/suite/sys_vars/r/character_set_client_basic.result +++ b/mysql-test/suite/sys_vars/r/character_set_client_basic.result @@ -162,11 +162,8 @@ SET @@character_set_client = utf8; SELECT @@character_set_client; @@character_set_client utf8 -'Bug: Assignment of ucs2 to session character-set does not raise error'; -'but selecting variable after setting it does.'; -'Even catching this does not allow any further character-set to be set.'; -'Offending querry seems to be:'; -'SET @@character_set_client = ucs2;' +SET @@character_set_client = ucs2; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' SET @@character_set_client = cp866; SELECT @@character_set_client; @@character_set_client @@ -426,9 +423,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; @total_charset 36 -'Bug # 34843: character sets are mapped in such a way that 100 and following'; -'numbers gives error, and before 100 the 36 mapped wraps arround'; -'several times.'; '#--------------------FN_DYNVARS_010_10-------------------------#' SET @@character_set_client = abc; ERROR 42000: Unknown character set: 'abc' diff --git a/mysql-test/suite/sys_vars/r/character_set_client_func.result b/mysql-test/suite/sys_vars/r/character_set_client_func.result index 087db21639b..82c1548d438 100644 --- a/mysql-test/suite/sys_vars/r/character_set_client_func.result +++ b/mysql-test/suite/sys_vars/r/character_set_client_func.result @@ -10,7 +10,6 @@ utf8 SELECT @@session.character_set_client; @@session.character_set_client latin1 -'Bug# 35372: session character_set_client is not effected by global character_set_client' '#--------------------FN_DYNVARS_010_02-------------------------#' 'connection default' SHOW VARIABLES like 'character_set_client'; @@ -22,16 +21,16 @@ CREATE TABLE t1(a CHAR(3) character set utf8); 'For latin1 characterset'; SET @@session.character_set_client = latin1; INSERT INTO t1 values('è'); -SELECT a,CHAR_LENGTH(a) FROM t1; -a CHAR_LENGTH(a) -è 2 +SELECT hex(a),CHAR_LENGTH(a) FROM t1; +hex(a) CHAR_LENGTH(a) +03C3A8 2 DELETE FROM t1; 'For utf8 characterset'; SET @@session.character_set_client = utf8; INSERT INTO t1 values('è'); -SELECT a,CHAR_LENGTH(a) FROM t1; -a CHAR_LENGTH(a) - 1 +SELECT hex(a),CHAR_LENGTH(a) FROM t1; +hex(a) CHAR_LENGTH(a) +03 1 DELETE FROM t1; DROP TABLE IF EXISTS t1; SET @@global.character_set_client = @global_character_set_client; diff --git a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result index 18697a20fb9..dd1052d27ef 100644 --- a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result +++ b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result @@ -425,9 +425,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; @total_charset 36 -'Bug # 34843: character sets are mapped in such a way that 100 and following '; -'numbers gives error, and before 100 the 36 mapped wraps arround'; -'several times.'; '#--------------------FN_DYNVARS_011_10-------------------------#' SET @@character_set_connection = abc; ERROR 42000: Unknown character set: 'abc' diff --git a/mysql-test/suite/sys_vars/r/character_set_database_basic.result b/mysql-test/suite/sys_vars/r/character_set_database_basic.result index 4380fea4c81..9aa449816f5 100644 --- a/mysql-test/suite/sys_vars/r/character_set_database_basic.result +++ b/mysql-test/suite/sys_vars/r/character_set_database_basic.result @@ -425,8 +425,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; @total_charset 36 -'Bug # 34843: character sets are mapped in such a way that 100 and following'; -'numbers gives error, and before 100 the 36 mapped wraps arround several times.'; '#--------------------FN_DYNVARS_012_10-------------------------#' SET @@character_set_database = "grek"; ERROR 42000: Unknown character set: 'grek' diff --git a/mysql-test/suite/sys_vars/r/character_set_database_func.result b/mysql-test/suite/sys_vars/r/character_set_database_func.result index 746824c58ff..3cadadd0f3f 100644 --- a/mysql-test/suite/sys_vars/r/character_set_database_func.result +++ b/mysql-test/suite/sys_vars/r/character_set_database_func.result @@ -12,7 +12,6 @@ utf8 SELECT @@session.character_set_database; @@session.character_set_database latin1 -'Bug#35356: session character_set_database differ from global character_set_database' '#--------------------FN_DYNVARS_008_02-------------------------#' 'connection default' DROP TABLE IF EXISTS t1; @@ -39,7 +38,6 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 DROP TABLE t1; DROP DATABASE db1; -'Bug#35357: character_set_database does not effects CREATE DATABASE without characater set' '--ascii character set specified--' CREATE DATABASE db1 CHARACTER SET ascii; USE db1; @@ -72,7 +70,6 @@ SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1; count(*) 1 DROP TABLE IF EXISTS t1; -'Bug#27208: If no current database, character_set_database !=character_set_server' SET GLOBAL character_set_server=latin5; CREATE DATABASE csdb CHARACTER SET = utf8; USE csdb; diff --git a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result index 11f85528593..e33df353c74 100644 --- a/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result +++ b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result @@ -403,8 +403,6 @@ SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; @total_charset 36 -'Bug # 34843: character sets are mapped in such a way that 100 and following ' -'numbers give error, and before 100 the 36 mapped wraps arround several times.' '#--------------------FN_DYNVARS_008_10-------------------------#' SET @@character_set_filesystem = abc; ERROR 42000: Unknown character set: 'abc' diff --git a/mysql-test/suite/sys_vars/r/character_set_results_basic.result b/mysql-test/suite/sys_vars/r/character_set_results_basic.result index 71c01a3dc0d3c966fb8a4626a4476b364b72c87d..0b59f60cd45857a1ed981af75672baf3920de017 100644 GIT binary patch delta 18 acmccDz<95Lal-<()~*:""&| SET @@global.ft_boolean_syntax = @global_start_value; -ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '' -'Bug# 34883: ft_boolean_syntax cant be assigned values from session temporary'; -'variables'; SET @@global.ft_boolean_syntax = DEFAULT; SELECT @@global.ft_boolean_syntax; @@global.ft_boolean_syntax diff --git a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result index 0096c553155..0e7d9e26325 100644 --- a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result +++ b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result @@ -76,14 +76,14 @@ AGAINST ('"faster than"' IN BOOLEAN MODE); id title body 6 100 Tips for Myisam 1. Myisam is faster than innodb 2. Tricks and Tips for Myisam... SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('+run ~line' IN BOOLEAN MODE); +AGAINST ('+tutorial ~line' IN BOOLEAN MODE); id title body -'Bug#35359: ~ is not working correctly. Its behaving like -' +1 MySQL Tutorial DBMS stands for DataBase ... +4 Optimizing MySQL In this tutorial we will show .... Run command line ... SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('10*' IN BOOLEAN MODE); id title body 5 1001 MySQL Tricks 1. Never run mysqld as root. 2. ... -'Bug#35360: * is not working correctly. Not all rows are returned' SELECT id,title,body, (MATCH (title,body) AGAINST ('+MySQL +(>show @copy_file, left(@orig_file, length(@copy_file)) = @copy_file; +@orig_file > @copy_file left(@orig_file, length(@copy_file)) = @copy_file +1 1 ## Dropping tables ## DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result b/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result index 4821ca91308..48126d33ee8 100644 --- a/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result +++ b/mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result @@ -73,8 +73,8 @@ SET @@global.group_concat_max_len = 65536; SELECT @@global.group_concat_max_len; @@global.group_concat_max_len 65536 -SET @@global.group_concat_max_len = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.group_concat_max_len = 65530.34; +ERROR 42000: Incorrect argument type to variable 'group_concat_max_len' SELECT @@global.group_concat_max_len; @@global.group_concat_max_len 65536 @@ -95,13 +95,12 @@ Warning 1292 Truncated incorrect group_concat_max_len value: '-2' SELECT @@session.group_concat_max_len; @@session.group_concat_max_len 4 -SET @@session.group_concat_max_len = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.group_concat_max_len = 65530.34; +ERROR 42000: Incorrect argument type to variable 'group_concat_max_len' SET @@session.group_concat_max_len = 65550; SELECT @@session.group_concat_max_len; @@session.group_concat_max_len 65550 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' SET @@session.group_concat_max_len = test; ERROR 42000: Incorrect argument type to variable 'group_concat_max_len' SELECT @@session.group_concat_max_len; diff --git a/mysql-test/suite/sys_vars/r/have_profiling_basic.result b/mysql-test/suite/sys_vars/r/have_profiling_basic.result new file mode 100644 index 00000000000..72923134e83 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/have_profiling_basic.result @@ -0,0 +1,21 @@ +select @@global.have_profiling="1"; +@@global.have_profiling="1" +0 +select @@session.have_profiling; +ERROR HY000: Variable 'have_profiling' is a GLOBAL variable +show global variables like 'have_profiling'; +Variable_name Value +have_profiling # +show session variables like 'have_profiling'; +Variable_name Value +have_profiling # +select * from information_schema.global_variables where variable_name='have_profiling'; +VARIABLE_NAME VARIABLE_VALUE +HAVE_PROFILING # +select * from information_schema.session_variables where variable_name='have_profiling'; +VARIABLE_NAME VARIABLE_VALUE +HAVE_PROFILING # +set global have_profiling=1; +ERROR HY000: Variable 'have_profiling' is a read only variable +set session have_profiling=1; +ERROR HY000: Variable 'have_profiling' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/identity_basic.result b/mysql-test/suite/sys_vars/r/identity_basic.result index 60f3edcc030..063decf2eb1 100644 --- a/mysql-test/suite/sys_vars/r/identity_basic.result +++ b/mysql-test/suite/sys_vars/r/identity_basic.result @@ -32,9 +32,11 @@ SELECT @@session.identity; 65535 '#--------------------FN_DYNVARS_035_04-------------------------#' SET @@session.identity = -1; +Warnings: +Warning 1292 Truncated incorrect identity value: '-1' SELECT @@session.identity; @@session.identity --1 +0 SET @@session.identity = 100000000000; SELECT @@session.identity; @@session.identity @@ -45,14 +47,15 @@ SELECT @@session.identity; @@session.identity 100000000000 SET @@session.identity = -1024; +Warnings: +Warning 1292 Truncated incorrect identity value: '-1024' SELECT @@session.identity; @@session.identity --1024 +0 SET @@session.identity = 42949672950; SELECT @@session.identity; @@session.identity 42949672950 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' SET @@session.identity = ON; ERROR 42000: Incorrect argument type to variable 'identity' SELECT @@session.identity; diff --git a/mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result b/mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result new file mode 100644 index 00000000000..85084c13115 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/ignore_builtin_innodb_basic.result @@ -0,0 +1,21 @@ +select @@global.ignore_builtin_innodb; +@@global.ignore_builtin_innodb +0 +select @@session.ignore_builtin_innodb; +ERROR HY000: Variable 'ignore_builtin_innodb' is a GLOBAL variable +show global variables like 'ignore_builtin_innodb'; +Variable_name Value +ignore_builtin_innodb OFF +show session variables like 'ignore_builtin_innodb'; +Variable_name Value +ignore_builtin_innodb OFF +select * from information_schema.global_variables where variable_name='ignore_builtin_innodb'; +VARIABLE_NAME VARIABLE_VALUE +IGNORE_BUILTIN_INNODB OFF +select * from information_schema.session_variables where variable_name='ignore_builtin_innodb'; +VARIABLE_NAME VARIABLE_VALUE +IGNORE_BUILTIN_INNODB OFF +set global ignore_builtin_innodb=1; +ERROR HY000: Variable 'ignore_builtin_innodb' is a read only variable +set session ignore_builtin_innodb=1; +ERROR HY000: Variable 'ignore_builtin_innodb' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/init_connect_basic.result b/mysql-test/suite/sys_vars/r/init_connect_basic.result index 58f7a9d2ccdc0f67900c73e5ab904a2e95f6623e..333a230a4a169876ca75a3bc09c3a189d4922d41 100644 GIT binary patch delta 206 zcmew(JzH+WJ$An0)Di`UL|Y|8qZk8YlgazpETj-Z48|r(T*0nBuFfF}8L1T-lLMJW z*)^@XVC;HLE^}iuQ*#p|0}}%?Lt_^sBV$8jBLf3tV`CE|Bd%Z%|8Rvc#~@EfCm+{f z1s_juR|WOVyv&mL_basic.test file. +# + +# +# we can diff in perl or in sql, as it's my_SQL_test suite, do it in sql +# + +perl; + use File::Basename; + my $dirname=dirname($ENV{MYSQLTEST_FILE}); + my @all_tests=<$dirname/*_basic{,_32,_64}.test>; + open(F, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/sys_vars.all_vars.txt") or die; + binmode F; + print F join "\n", sort map { s/_basic(_32|_64)?\.test$//; basename $_ } @all_tests; +EOF + +create table t1 (test_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; + +drop table t1; diff --git a/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test b/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test index 4acfb8f503b..d76880b149e 100644 --- a/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test +++ b/mysql-test/suite/sys_vars/t/auto_increment_increment_basic.test @@ -103,8 +103,8 @@ SET @@global.auto_increment_increment = -1024; SELECT @@global.auto_increment_increment; SET @@global.auto_increment_increment = 65536; SELECT @@global.auto_increment_increment; ---Error ER_PARSE_ERROR -SET @@global.auto_increment_increment = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.auto_increment_increment = 65530.34; SELECT @@global.auto_increment_increment; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.auto_increment_increment = test; @@ -114,11 +114,10 @@ SET @@session.auto_increment_increment = 0; SELECT @@session.auto_increment_increment; SET @@session.auto_increment_increment = -2; SELECT @@session.auto_increment_increment; ---Error ER_PARSE_ERROR -SET @@session.auto_increment_increment = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.auto_increment_increment = 65530.34; SET @@session.auto_increment_increment = 65550; SELECT @@session.auto_increment_increment; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.auto_increment_increment = test; diff --git a/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test index 7822775fb35..51c32669934 100644 --- a/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test +++ b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test @@ -119,8 +119,6 @@ SELECT @@session.auto_increment_increment = 20; SET @@session.auto_increment_increment = 5; INSERT into t1(name) values('Record_10'); SELECT * from t1; ---echo 'Bug#35362: Here Record_10 id should be 120 instead of 115 because we' ---echo 'have set the value of variable to 5' SET @@session.auto_increment_increment = 1; SELECT @@auto_increment_increment; @@ -176,9 +174,6 @@ INSERT into t1(name) values('Record_17'); INSERT into t1(name) values('Record_18'); SELECT * from t1; ---echo 'Bug#35364: Variable is incrementing some random values on assigning -ve value' - - ############################################################ # Disconnecting all connection & dropping table # ############################################################ diff --git a/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test b/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test index a98fd6467ad..76261645b30 100644 --- a/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test +++ b/mysql-test/suite/sys_vars/t/auto_increment_offset_basic.test @@ -117,7 +117,6 @@ SET @@session.auto_increment_offset = -2; SELECT @@session.auto_increment_offset; SET @@session.auto_increment_offset = 65550; SELECT @@session.auto_increment_offset; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.auto_increment_offset = ON; diff --git a/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test index 7e1668452cc..0ac96255acf 100644 --- a/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test +++ b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test @@ -111,8 +111,6 @@ SELECT * from t1; --echo ## Setting value of variable less than last insert id ## SET @@session.auto_increment_offset = 5; INSERT into t1(name) values('Record_9'); ---echo 'Bug#35367: Random value of id is increasing on assigning value to'; ---echo 'variable that is less than current offset'; INSERT into t1(name) values('Record_10'); INSERT into t1(name) values('Record_11'); INSERT into t1(name) values('Record_12'); @@ -133,9 +131,6 @@ SET @@auto_increment_increment = 10; INSERT into t1(name) values('Record_13'); INSERT into t1(name) values('Record_14'); SELECT * from t1; ---echo 'Bug#35369: Some invalid value of id is increasing on assigning value to'; ---echo 'variable that is greater than auto_increment_increment'; - --echo '#--------------------FN_DYNVARS_002_06-------------------------#' ############################################################################### @@ -165,8 +160,6 @@ SELECT @@auto_increment_offset = -10; INSERT into t1(name) values('Record_17'); INSERT into t1(name) values('Record_18'); SELECT * from t1; ---echo 'Bug#35370: Some invalid value of id is increasing on assigning negative'; ---echo ' value in variable'; --echo ## Assigning value that is out of range of variable ## SET @@auto_increment_offset = 65536; diff --git a/mysql-test/suite/sys_vars/t/auto_commit_basic.test b/mysql-test/suite/sys_vars/t/autocommit_basic.test similarity index 96% rename from mysql-test/suite/sys_vars/t/auto_commit_basic.test rename to mysql-test/suite/sys_vars/t/autocommit_basic.test index b899c273093..fa6654ae37c 100644 --- a/mysql-test/suite/sys_vars/t/auto_commit_basic.test +++ b/mysql-test/suite/sys_vars/t/autocommit_basic.test @@ -33,7 +33,7 @@ # Saving initial value of autocommit in a temporary variable # ######################################################################## -SET @start_value = @@autocommit; +SET @start_value = @@global.autocommit; SELECT @start_value; @@ -45,7 +45,6 @@ SELECT @start_value; SET @@autocommit = 0; SET @@autocommit = DEFAULT; SELECT @@autocommit; -echo 'Bug: variable DEFAULT value not working and is not throwing error'; --echo '#---------------------FN_DYNVARS_003_02-------------------------#' ############################################### @@ -102,10 +101,9 @@ SET @@autocommit = ''; # Test if accessing global autocommit gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE SET @@global.autocommit = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR SELECT @@global.autocommit; +SET @@global.autocommit = 1; --echo '#----------------------FN_DYNVARS_003_06------------------------#' @@ -116,7 +114,6 @@ SELECT @@global.autocommit; SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='autocommit'; ---echo Bug # 34839: Values in variable and information_schema do not match for autocommit --echo '#----------------------FN_DYNVARS_003_07------------------------#' ######################################################################### @@ -182,8 +179,8 @@ SELECT autocommit = @@session.autocommit; # Restore initial value # ############################## -SET @@autocommit = @start_value; -SELECT @@autocommit; +SET @@global.autocommit = @start_value; +SELECT @@global.autocommit; ######################################################################## # END OF autocommit TESTS # diff --git a/mysql-test/suite/sys_vars/t/autocommit_func-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func-master.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/suite/sys_vars/t/autocommit_func-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/suite/sys_vars/t/autocommit_func.test b/mysql-test/suite/sys_vars/t/autocommit_func.test index 07e15ce40da..06193448588 100644 --- a/mysql-test/suite/sys_vars/t/autocommit_func.test +++ b/mysql-test/suite/sys_vars/t/autocommit_func.test @@ -145,7 +145,6 @@ SELECT * from t1; --echo ## Connecting with connection # 01 and inserting few records ## CONNECTION test_con1; SELECT * from t1; ---echo 'Bug#35373: Records donot get committed in transaction on switching connections' INSERT into t1(name) values('Record_6'); SELECT * from t1; diff --git a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test index 005aec91acf..dfa733a0b9b 100644 --- a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test +++ b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_basic.test @@ -116,7 +116,6 @@ SELECT @@session.automatic_sp_privileges; SELECT IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='automatic_sp_privileges'; -echo 'Bug# 34839: Values in variable and information_schema donot match'; --echo '#---------------------FN_DYNVARS_004_07----------------------#' ################################################################### diff --git a/mysql-test/suite/sys_vars/t/back_log_basic.test b/mysql-test/suite/sys_vars/t/back_log_basic.test new file mode 100644 index 00000000000..518ca2f0e5f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/back_log_basic.test @@ -0,0 +1,19 @@ +# +# show the global and session values; +# +select @@global.back_log; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.back_log; +show global variables like 'back_log'; +show session variables like 'back_log'; +select * from information_schema.global_variables where variable_name='back_log'; +select * from information_schema.session_variables where variable_name='back_log'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global back_log=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session back_log=1; + diff --git a/mysql-test/suite/sys_vars/t/big_tables_basic.test b/mysql-test/suite/sys_vars/t/big_tables_basic.test index 67215f2625d..89a7ee83bc8 100644 --- a/mysql-test/suite/sys_vars/t/big_tables_basic.test +++ b/mysql-test/suite/sys_vars/t/big_tables_basic.test @@ -45,7 +45,6 @@ SELECT @start_value; SET @@big_tables = 1; SET @@big_tables = DEFAULT; SELECT @@big_tables; ---echo 'Bug# 34829: No default value for variable and setting default does not raise error'; --echo '#--------------------FN_DYNVARS_005_02------------------------#' @@ -96,11 +95,9 @@ SET @@big_tables = ''; # Test if accessing global big_tables gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE -SET @@global.big_tables = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.big_tables = 1-@@global.big_tables; SELECT @@global.big_tables; - +SET @@global.big_tables = 1-@@global.big_tables; --echo '#----------------------FN_DYNVARS_005_05------------------------#' ############################################################################## @@ -110,7 +107,6 @@ SELECT @@global.big_tables; SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='big_tables'; ---echo Bug # 34839: Values in variable and information_schema do not match for autocommit --echo '#---------------------FN_DYNVARS_005_06----------------------#' diff --git a/mysql-test/suite/sys_vars/t/character_set_client_basic.test b/mysql-test/suite/sys_vars/t/character_set_client_basic.test index 177a663c112..26912e89509 100644 --- a/mysql-test/suite/sys_vars/t/character_set_client_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_client_basic.test @@ -164,14 +164,8 @@ SELECT @@character_set_client; SET @@character_set_client = utf8; SELECT @@character_set_client; -#SET @@character_set_client = ucs2; -#--Error ER_PARSE_ERROR -#SELECT @@session.character_set_client; ---echo 'Bug: Assignment of ucs2 to session character-set does not raise error'; ---echo 'but selecting variable after setting it does.'; ---echo 'Even catching this does not allow any further character-set to be set.'; ---echo 'Offending querry seems to be:'; ---echo 'SET @@character_set_client = ucs2;' +--error ER_WRONG_VALUE_FOR_VAR +SET @@character_set_client = ucs2; SET @@character_set_client = cp866; SELECT @@character_set_client; @@ -256,9 +250,6 @@ SET @@global.character_set_client = 100; SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following'; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround'; ---echo 'several times.'; --echo '#--------------------FN_DYNVARS_010_10-------------------------#' ############################################################################### diff --git a/mysql-test/suite/sys_vars/t/character_set_client_func.test b/mysql-test/suite/sys_vars/t/character_set_client_func.test index 19994672fa4..90f5cdaae0f 100644 --- a/mysql-test/suite/sys_vars/t/character_set_client_func.test +++ b/mysql-test/suite/sys_vars/t/character_set_client_func.test @@ -38,8 +38,6 @@ SELECT @@global.character_set_client; SELECT @@session.character_set_client; disconnect con1; ---echo 'Bug# 35372: session character_set_client is not effected by global character_set_client' - --echo '#--------------------FN_DYNVARS_010_02-------------------------#' ############################################################# # Begin the functionality Testing of character_set_client # @@ -62,13 +60,13 @@ CREATE TABLE t1(a CHAR(3) character set utf8); --echo 'For latin1 characterset'; SET @@session.character_set_client = latin1; INSERT INTO t1 values('è'); -SELECT a,CHAR_LENGTH(a) FROM t1; +SELECT hex(a),CHAR_LENGTH(a) FROM t1; DELETE FROM t1; --echo 'For utf8 characterset'; SET @@session.character_set_client = utf8; INSERT INTO t1 values('è'); -SELECT a,CHAR_LENGTH(a) FROM t1; +SELECT hex(a),CHAR_LENGTH(a) FROM t1; DELETE FROM t1; --disable_warnings diff --git a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test index 5e28d43ce3e..1a51843e0e8 100644 --- a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test @@ -182,9 +182,6 @@ SET @@global.character_set_connection = 100; SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following '; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround'; ---echo 'several times.'; --echo '#--------------------FN_DYNVARS_011_10-------------------------#' ################################################################################ diff --git a/mysql-test/suite/sys_vars/t/character_set_database_basic.test b/mysql-test/suite/sys_vars/t/character_set_database_basic.test index 08069c00ae0..07b4b31b25c 100644 --- a/mysql-test/suite/sys_vars/t/character_set_database_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_database_basic.test @@ -182,8 +182,6 @@ SET @@global.character_set_database = 100; SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following'; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround several times.'; --echo '#--------------------FN_DYNVARS_012_10-------------------------#' ############################################################################## diff --git a/mysql-test/suite/sys_vars/t/character_set_database_func.test b/mysql-test/suite/sys_vars/t/character_set_database_func.test index 78b1f1ab49b..d3da8660766 100644 --- a/mysql-test/suite/sys_vars/t/character_set_database_func.test +++ b/mysql-test/suite/sys_vars/t/character_set_database_func.test @@ -38,7 +38,6 @@ connect (con1,localhost,root,,,,); connection con1; SELECT @@global.character_set_database; SELECT @@session.character_set_database; ---echo 'Bug#35356: session character_set_database differ from global character_set_database' disconnect con1; --echo '#--------------------FN_DYNVARS_008_02-------------------------#' @@ -70,8 +69,6 @@ SHOW CREATE TABLE t1; DROP TABLE t1; DROP DATABASE db1; ---echo 'Bug#35357: character_set_database does not effects CREATE DATABASE without characater set' - #============================================================================== --echo '--ascii character set specified--' #============================================================================== @@ -109,9 +106,6 @@ DROP TABLE IF EXISTS t1; #============================================================================== ---echo 'Bug#27208: If no current database, character_set_database !=character_set_server' -#============================================================================== - SET GLOBAL character_set_server=latin5; connect (con2, localhost, root,,); diff --git a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test index 3ba9c269a84..928d02ee46b 100644 --- a/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test @@ -165,8 +165,6 @@ SET @@character_set_filesystem = 100; SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); SELECT @total_charset; -echo 'Bug # 34843: character sets are mapped in such a way that 100 and following '; -echo 'numbers give error, and before 100 the 36 mapped wraps arround several times.'; --echo '#--------------------FN_DYNVARS_008_10-------------------------#' ################################################################################ diff --git a/mysql-test/suite/sys_vars/t/character_set_server_basic.test b/mysql-test/suite/sys_vars/t/character_set_server_basic.test index 21eb3fb36dc..d692c1f633c 100644 --- a/mysql-test/suite/sys_vars/t/character_set_server_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_server_basic.test @@ -72,6 +72,9 @@ SET global character_set_server=utf8; --Error ER_BAD_FIELD_ERROR SELECT global character_set_server; +--error ER_WRONG_VALUE_FOR_VAR +SET @@character_set_server = null; + --echo '#--------------------FN_DYNVARS_009_02-------------------------#' ############################################################################### # Check the DEFAULT value of character_set_server for session and global # @@ -178,12 +181,6 @@ SELECT @@global.character_set_server; --Error ER_UNKNOWN_CHARACTER_SET SET @@global.character_set_server = 100; -SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); -SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following '; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround '; ---echo 'several times.'; - --echo '#--------------------FN_DYNVARS_009_10-------------------------#' ############################################################################### # Change the value of character_set_server to an invalid value for session # diff --git a/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test new file mode 100644 index 00000000000..30befb5b0f1 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test @@ -0,0 +1,24 @@ +# +# show the global and session values; +# +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +select @@global.character_sets_dir; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.character_sets_dir; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +show global variables like 'character_sets_dir'; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +show session variables like 'character_sets_dir'; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +select * from information_schema.global_variables where variable_name='character_sets_dir'; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +select * from information_schema.session_variables where variable_name='character_sets_dir'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global character_sets_dir="foo"; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session character_sets_dir="foo"; + diff --git a/mysql-test/suite/sys_vars/t/collation_connection_basic.test b/mysql-test/suite/sys_vars/t/collation_connection_basic.test index bf82ea321b7..92f1766fc9c 100644 --- a/mysql-test/suite/sys_vars/t/collation_connection_basic.test +++ b/mysql-test/suite/sys_vars/t/collation_connection_basic.test @@ -121,7 +121,7 @@ SET @@collation_connection = latin7_general_ci + latin7_general_cs; # Change the value of collation_connection to a valid value for session # ############################################################################### -let collation_variable = @@session.collation_connection; +let $collation_variable = @@session.collation_connection; --source suite/sys_vars/inc/collation_basic.inc @@ -130,7 +130,7 @@ let collation_variable = @@session.collation_connection; # Change the value of collation_connection to a valid value for global # ############################################################################### -let collation_variable = @@global.collation_connection; +let $collation_variable = @@global.collation_connection; --source suite/sys_vars/inc/collation_basic.inc diff --git a/mysql-test/suite/sys_vars/t/collation_database_basic.test b/mysql-test/suite/sys_vars/t/collation_database_basic.test index 557f32b86a0..da06778bb68 100644 --- a/mysql-test/suite/sys_vars/t/collation_database_basic.test +++ b/mysql-test/suite/sys_vars/t/collation_database_basic.test @@ -78,6 +78,7 @@ SELECT global collation_database; ############################################################################## SET @@collation_database = latin1_bin; SET @@collation_database = DEFAULT; +SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME=DATABASE(); SELECT @@collation_database AS DEFAULT_VALUE; SET @@global.collation_database = latin1_bin; @@ -120,7 +121,7 @@ SET @@collation_database = latin7_general_ci + latin7_general_cs; # Change the value of collation_database to a valid value for session # ########################################################################### -let collation_variable = @@session.collation_database; +let $collation_variable = @@session.collation_database; --source suite/sys_vars/inc/collation_basic.inc @@ -129,7 +130,7 @@ let collation_variable = @@session.collation_database; # Change the value of collation_database to a valid value for global # ############################################################################### -let collation_variable = @@global.collation_database; +let $collation_variable = @@global.collation_database; --source suite/sys_vars/inc/collation_basic.inc diff --git a/mysql-test/suite/sys_vars/t/collation_database_func.test b/mysql-test/suite/sys_vars/t/collation_database_func.test index ba8fc5a3d5e..aa8716408f7 100644 --- a/mysql-test/suite/sys_vars/t/collation_database_func.test +++ b/mysql-test/suite/sys_vars/t/collation_database_func.test @@ -38,8 +38,6 @@ SELECT @@global.collation_database; SELECT @@session.collation_database; disconnect con1; ---echo 'Bug#35378: New session collation_database is not change by global collation_database' - --echo '#--------------------FN_DYNVARS_011_02-------------------------#' ######################################################### # Begin the functionality Testing of collation_database # @@ -69,7 +67,6 @@ SET @@session.collation_database = latin2_croatian_ci; CREATE DATABASE db1; USE db1; SHOW CREATE DATABASE db1; ---echo 'Bug#35380: collation_database does not effects CREATE DATABASE without characater set' CREATE TABLE t1(a CHAR(20)); SHOW CREATE TABLE t1; diff --git a/mysql-test/suite/sys_vars/t/collation_server_basic.test b/mysql-test/suite/sys_vars/t/collation_server_basic.test index a8af13c13ae..0d01c7d3076 100644 --- a/mysql-test/suite/sys_vars/t/collation_server_basic.test +++ b/mysql-test/suite/sys_vars/t/collation_server_basic.test @@ -120,7 +120,7 @@ SET @@collation_server = latin7_general_ci + latin7_general_cs; # Change the value of collation_server to a valid value for session # ############################################################################## -let collation_variable = @@session.collation_server; +let $collation_variable = @@session.collation_server; --source suite/sys_vars/inc/collation_basic.inc @@ -129,7 +129,7 @@ let collation_variable = @@session.collation_server; # Change the value of collation_server to a valid value for global # ############################################################################# -let collation_variable = @@global.collation_server; +let $collation_variable = @@global.collation_server; --source suite/sys_vars/inc/collation_basic.inc diff --git a/mysql-test/suite/sys_vars/t/completion_type_basic.test b/mysql-test/suite/sys_vars/t/completion_type_basic.test index 7ffc1aa593b..927654cd32a 100644 --- a/mysql-test/suite/sys_vars/t/completion_type_basic.test +++ b/mysql-test/suite/sys_vars/t/completion_type_basic.test @@ -53,18 +53,6 @@ SET @@session.completion_type = DEFAULT; SELECT @@session.completion_type; ---echo '#--------------------FN_DYNVARS_017_02-------------------------#' -############################################################### -# Check the DEFAULT value of completion_type # -############################################################### - -SET @@global.completion_type = @start_global_value; -SELECT @@global.completion_type = 0; - -SET @@session.completion_type = @start_session_value; -SELECT @@session.completion_type = 0; - - --echo '#--------------------FN_DYNVARS_017_03-------------------------#' ######################################################################### # Change the value of completion_type to a valid value for GLOBAL Scope # @@ -77,6 +65,12 @@ SELECT @@global.completion_type; SET @@global.completion_type = 2; SELECT @@global.completion_type; +SET @@global.completion_type = NO_CHAIN; +SELECT @@global.completion_type; +SET @@global.completion_type = CHAIN; +SELECT @@global.completion_type; +SET @@global.completion_type = 'RELEASE'; +SELECT @@global.completion_type; --echo '#--------------------FN_DYNVARS_017_04-------------------------#' ########################################################################## @@ -90,19 +84,25 @@ SELECT @@session.completion_type; SET @@session.completion_type = 2; SELECT @@session.completion_type; +SET @@session.completion_type = 'NO_CHAIN'; +SELECT @@session.completion_type; +SET @@session.completion_type = 'CHAIN'; +SELECT @@session.completion_type; +SET @@session.completion_type = 'RELEASE'; +SELECT @@session.completion_type; --echo '#------------------FN_DYNVARS_017_05-----------------------#' ########################################################### # Change the value of completion_type to an invalid value # ########################################################### - +set sql_mode=TRADITIONAL; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.completion_type = 10; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.completion_type = -1024; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.completion_type = 2.4; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.completion_type = OFF; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.completion_type = 10; @@ -110,7 +110,7 @@ SET @@session.completion_type = 10; SET @@session.completion_type = -2; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.completion_type = 1.2; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.completion_type = ON; @@ -177,6 +177,7 @@ SET @@global.completion_type = @start_global_value; SELECT @@global.completion_type; SET @@session.completion_type = @start_session_value; SELECT @@session.completion_type; +set sql_mode=''; ############################################ # END OF completion_type TESTS # diff --git a/mysql-test/suite/sys_vars/t/completion_type_func.test b/mysql-test/suite/sys_vars/t/completion_type_func.test index 8e363ed2a7d..9495a8e118c 100644 --- a/mysql-test/suite/sys_vars/t/completion_type_func.test +++ b/mysql-test/suite/sys_vars/t/completion_type_func.test @@ -156,7 +156,7 @@ COMMIT; --echo ## Inserting rows should give error here because connection should ## --echo ## disconnect after using COMMIT ## ---Error 2006,2013,ER_SERVER_SHUTDOWN +--Error 2006,2013,ER_QUERY_INTERRUPTED INSERT INTO t1 VALUES(4,'Record_4'); --echo switch to connection test_con2 @@ -171,7 +171,7 @@ INSERT INTO t1 VALUES(12,'Record_12'); ROLLBACK; --echo ## Expect a failure due to COMMIT/ROLLBACK AND RELEASE behavior ## ---Error 2006,2013,ER_SERVER_SHUTDOWN, +--Error 2006,2013,ER_QUERY_INTERRUPTED INSERT INTO t1 VALUES(4,'Record_4'); connection default; diff --git a/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test index bc401ef22a3..5be569e52d3 100644 --- a/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test +++ b/mysql-test/suite/sys_vars/t/concurrent_insert_basic.test @@ -67,35 +67,41 @@ SELECT @@global.concurrent_insert; SET @@global.concurrent_insert = 2; SELECT @@global.concurrent_insert; +SET @@global.concurrent_insert = NEVER; +SELECT @@global.concurrent_insert; +SET @@global.concurrent_insert = AUTO; +SELECT @@global.concurrent_insert; +SET @@global.concurrent_insert = ALWAYS; +SELECT @@global.concurrent_insert; + --echo '#--------------------FN_DYNVARS_018_04-------------------------#' ########################################################################### # Change the value of concurrent_insert to invalid value # ########################################################################### +--error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = -1; -Select @@global.concurrent_insert; +--error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = 100; -Select @@global.concurrent_insert; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = TRUEF; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = TRUE_F; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = FALSE0; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = OON; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = ONN; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = OOFF; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = 0FF; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = ' '; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = " "; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = ''; @@ -125,9 +131,9 @@ WHERE VARIABLE_NAME='concurrent_insert'; # Check if ON and OFF values can be used on variable # ################################################################### ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = OFF; ---Error ER_WRONG_TYPE_FOR_VAR +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.concurrent_insert = ON; diff --git a/mysql-test/suite/sys_vars/t/connect_timeout_basic.test b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test index 095c85f8295..d89734a00c2 100644 --- a/mysql-test/suite/sys_vars/t/connect_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/connect_timeout_basic.test @@ -79,7 +79,6 @@ SET @@global.connect_timeout = -1024; SELECT @@global.connect_timeout; SET @@global.connect_timeout = 42949672950; SELECT @@global.connect_timeout; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.connect_timeout = 21221204.10; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/t/date_format_basic.test b/mysql-test/suite/sys_vars/t/date_format_basic.test new file mode 100644 index 00000000000..a69295b405d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/date_format_basic.test @@ -0,0 +1,18 @@ +# +# show the global and session values; +# +select @@global.date_format; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.date_format; +show global variables like 'date_format'; +show session variables like 'date_format'; +select * from information_schema.global_variables where variable_name='date_format'; +select * from information_schema.session_variables where variable_name='date_format'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global date_format="foo"; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session date_format="foo"; diff --git a/mysql-test/suite/sys_vars/t/datetime_format_basic.test b/mysql-test/suite/sys_vars/t/datetime_format_basic.test new file mode 100644 index 00000000000..553d3126328 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/datetime_format_basic.test @@ -0,0 +1,18 @@ +# +# show the global and session values; +# +select @@global.datetime_format; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.datetime_format; +show global variables like 'datetime_format'; +show session variables like 'datetime_format'; +select * from information_schema.global_variables where variable_name='datetime_format'; +select * from information_schema.session_variables where variable_name='datetime_format'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global datetime_format="foo"; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session datetime_format="foo"; diff --git a/mysql-test/suite/sys_vars/t/debug_basic.test b/mysql-test/suite/sys_vars/t/debug_basic.test new file mode 100644 index 00000000000..b54626c38ca --- /dev/null +++ b/mysql-test/suite/sys_vars/t/debug_basic.test @@ -0,0 +1,22 @@ +--source include/have_debug.inc +# +# exists both as global and session +# +set session debug="L"; + +select @@global.debug="1"; # just to show that global.debug exists +select @@session.debug; # here we know the value and can display it +--replace_column 2 # +show global variables like 'debug'; +show session variables like 'debug'; +--replace_column 2 # +select * from information_schema.global_variables where variable_name="debug"; +select * from information_schema.session_variables where variable_name="debug"; + +--error ER_WRONG_TYPE_FOR_VAR +set @@global.debug=1; +--error ER_WRONG_TYPE_FOR_VAR +set @@global.debug=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set @@global.debug=1e1; + diff --git a/mysql-test/suite/sys_vars/t/debug_sync_basic.test b/mysql-test/suite/sys_vars/t/debug_sync_basic.test new file mode 100644 index 00000000000..c2c4df95c32 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/debug_sync_basic.test @@ -0,0 +1,21 @@ +--source include/have_debug_sync.inc +# +# exists as session only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@global.debug_sync; +select @@session.debug_sync; + +show global variables like "debug_sync"; +show session variables like "debug_sync"; + +select * from information_schema.global_variables where variable_name="debug_sync"; +select * from information_schema.session_variables where variable_name="debug_sync"; + +--error ER_WRONG_TYPE_FOR_VAR +set @@session.debug_sync=1; +--error ER_WRONG_TYPE_FOR_VAR +set @@session.debug_sync=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set @@session.debug_sync=1e1; + diff --git a/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test b/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test new file mode 100644 index 00000000000..17f2d2cc852 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test @@ -0,0 +1,183 @@ +############## mysql-test\t\storage_engine_basic.test ################## +# # +# # +# Creation Date: 2008-02-14 # +# Author: Salman Rawala # +# # +# Description: Test Cases of Dynamic System Variable # +# default_storage_engine that check behavior of this # +# variable with valid values, invalid values, accessing # +# variable with scope that is allowed and with scope that # +# is now allowed. # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_storage_engine # +# # +######################################################################## + +--source include/have_innodb.inc +--source include/load_sysvars.inc + +###################################################################### +# START OF default_storage_engine TESTS # +###################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.default_storage_engine; +SELECT @start_global_value; +SET @start_session_value = @@session.default_storage_engine; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +###################################################################### +# Display the DEFAULT value of default_storage_engine # +###################################################################### + +SET @@global.default_storage_engine = INNODB; +SET @@global.default_storage_engine = DEFAULT; +SELECT @@global.default_storage_engine; + +SET @@session.default_storage_engine = INNODB; +SET @@session.default_storage_engine = DEFAULT; +SELECT @@session.default_storage_engine; + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Change the value of default_storage_engine to a valid value for GLOBAL Scope # +######################################################################## + +SET @@global.default_storage_engine = MYISAM; +SELECT @@global.default_storage_engine; +SET @@global.default_storage_engine = MERGE; +SELECT @@global.default_storage_engine; +SET @@global.default_storage_engine = MEMORY; +SELECT @@global.default_storage_engine; +SET @@global.default_storage_engine = INNODB; +SELECT @@global.default_storage_engine; + + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +######################################################################### +# Change the value of default_storage_engine to a valid value for SESSION Scope # +######################################################################### + +SET @@session.default_storage_engine = MYISAM; +SELECT @@session.default_storage_engine; +SET @@session.default_storage_engine = MERGE; +SELECT @@session.default_storage_engine; +SET @@session.default_storage_engine = MEMORY; +SELECT @@session.default_storage_engine; +SET @@session.default_storage_engine = INNODB; +SELECT @@session.default_storage_engine; + + +--echo '#------------------FN_DYNVARS_005_04-----------------------#' +################################################################## +# Change the value of default_storage_engine to an invalid value # +################################################################## + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.default_storage_engine = 8199; + +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.default_storage_engine = NULL; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.default_storage_engine = -1024; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.default_storage_engine = 65530.34; + +--Error ER_UNKNOWN_STORAGE_ENGINE +SET @@global.default_storage_engine = FILE; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.default_storage_engine = 8199; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.default_storage_engine = 65530.34; + +--Error ER_UNKNOWN_STORAGE_ENGINE +SET @@session.default_storage_engine = RECORD; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.default_storage_engine = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='default_storage_engine'; + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.default_storage_engine = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES + WHERE VARIABLE_NAME='default_storage_engine'; + + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.default_storage_engine = TRUE; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.default_storage_engine = FALSE; + + +--echo '#---------------------FN_DYNVARS_001_8----------------------#' +############################################################### +# Check if accessing variable with SESSION,LOCAL and without # +# SCOPE points to same session variable # +############################################################### + +SET @@default_storage_engine = MYISAM; +SELECT @@default_storage_engine = @@local.default_storage_engine; +SELECT @@local.default_storage_engine = @@session.default_storage_engine; + + +--echo '#---------------------FN_DYNVARS_001_9----------------------#' +######################################################################### +# Check if default_storage_engine can be accessed with and without @@ sign # +######################################################################### + +SET default_storage_engine = MEMORY; +SELECT @@default_storage_engine; +--Error ER_UNKNOWN_TABLE +SELECT local.default_storage_engine; +--Error ER_UNKNOWN_TABLE +SELECT session.default_storage_engine; +--Error ER_BAD_FIELD_ERROR +SELECT default_storage_engine = @@session.default_storage_engine; + +# check the old obsolete name +SET @@default_storage_engine = @start_global_value; + +#################################### +# Restore initial value # +#################################### + +SET @@global.default_storage_engine = @start_global_value; +SELECT @@global.default_storage_engine; +SET @@session.default_storage_engine = @start_session_value; +SELECT @@session.default_storage_engine; + + +############################################################# +# END OF default_storage_engine TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/t/default_week_format_basic.test b/mysql-test/suite/sys_vars/t/default_week_format_basic.test index d8b4a09541f..e609cdc53f5 100644 --- a/mysql-test/suite/sys_vars/t/default_week_format_basic.test +++ b/mysql-test/suite/sys_vars/t/default_week_format_basic.test @@ -118,7 +118,6 @@ SET @@session.default_week_format = -2; SELECT @@session.default_week_format; SET @@session.default_week_format = 65550; SELECT @@session.default_week_format; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --echo '#------------------FN_DYNVARS_022_06-----------------------#' ############################################################################### diff --git a/mysql-test/suite/sys_vars/t/delay_key_write_basic.test b/mysql-test/suite/sys_vars/t/delay_key_write_basic.test index faa1cb3cc6e..25176879eb1 100644 --- a/mysql-test/suite/sys_vars/t/delay_key_write_basic.test +++ b/mysql-test/suite/sys_vars/t/delay_key_write_basic.test @@ -44,10 +44,7 @@ SELECT @start_value; ######################################################################## SET @@global.delay_key_write = OFF; ---Error ER_NO_DEFAULT SET @@global.delay_key_write = DEFAULT; ---echo 'Bug # 34878: Documentation specifies a DEFAULT value of ON for variable but'; ---echo 'its not supported'; SELECT @@global.delay_key_write; @@ -92,10 +89,8 @@ SET @@global.delay_key_write = ERROR; SET @@global.delay_key_write = FALSE0; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.delay_key_write = ONN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.delay_key_write = OF; -SELECT @@global.delay_key_write; ---echo 'Bug# 34828: Variable is incorrectly accepting OF as a value' --Error ER_WRONG_VALUE_FOR_VAR SET @@global.delay_key_write = ' '; diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test index 61f7d801a1a..e46ebc1e598 100644 --- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test +++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test @@ -1,11 +1,11 @@ ################################################################################ # # -# Variable Name: sql_low_priority_updates # +# Variable Name: delayed_insert_limit # # Scope: GLOBAL # # Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # +# Data Type: Numeric # +# Default Value: 100 # +# Range: 1 - 4294967295 # # # # # # Creation Date: 2008-02-25 # @@ -13,7 +13,7 @@ # Modified: HHunger 2009-02-26 Replaced 2 sleeps by wait conditions # # Modified: mleich 2009-03-18 Partially reimplemented # # # -# Description: Test Cases of Dynamic System Variable "sql_low_priority_updates"# +# Description: Test Cases of Dynamic System Variable "delayed_insert_limit" # # that checks behavior of this variable in the following ways # # * Functionality based on different values # # # @@ -112,7 +112,6 @@ let $wait_condition= SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name like 'Not_flushed_delayed_rows'; --source include/wait_condition.inc -let $my_select= SELECT COUNT(*) BETWEEN 21 AND 43 FROM t1; let $my_select= SELECT COUNT(*) FROM t1; send; eval $my_select; @@ -136,6 +135,13 @@ connection con0; --echo Asynchronous "reap" result --echo The next result suffers from --echo '# Bug#35386 insert delayed inserts 1 + limit rows instead of just limit rows' +# +# on UNLOCK TABLES both SELECT in the con0 and delayed insert thread in the +# con1 were awaken. There's no FIFO for TL_WRITE_DELAYED and TL_READ, +# so either the first delayed_insert_limit rows will be inserted +# before select (which will see 21 row) or select will go first (and see 6 rows) +# +--replace_result 6 21 reap; --echo ** Connection default ** diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test index 8bad6b2dfe6..2486ff5800f 100644 --- a/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test @@ -79,8 +79,6 @@ SET @@global.delayed_insert_timeout = -1024; SELECT @@global.delayed_insert_timeout; SET @@global.delayed_insert_timeout = 42949672950; SELECT @@global.delayed_insert_timeout; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.delayed_insert_timeout = 429496729.5; diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def new file mode 100644 index 00000000000..483eea9daeb --- /dev/null +++ b/mysql-test/suite/sys_vars/t/disabled.def @@ -0,0 +1,17 @@ +############################################################################## +# +# 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. +# +############################################################################## +query_cache_size_basic_32 : Bug#36747: Allocating a large query cache is not deterministic +query_cache_size_basic_64 : Bug#36747: Allocating a large query cache is not deterministic +transaction_prealloc_size_basic_32 : Bug#36747 +transaction_prealloc_size_basic_64 : Bug#36747 +#thread_cache_size_func : Bug#40575: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads + diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test index 40497e829df..65edf6dd76f 100644 --- a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test +++ b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test @@ -114,7 +114,6 @@ SET @@session.div_precision_increment = -2; SELECT @@session.div_precision_increment; SET @@session.div_precision_increment = 65550; SELECT @@session.div_precision_increment; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.div_precision_increment = 65530.30; diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test index aebca88abf9..1c2cbfc24e9 100644 --- a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test +++ b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test @@ -37,7 +37,7 @@ CREATE TABLE t1 id INT NOT NULL auto_increment, PRIMARY KEY (id), name VARCHAR(30), -salary LONG +salary INT ); --echo '#--------------------FN_DYNVARS_027_01-------------------------#' @@ -55,7 +55,6 @@ INSERT into t1(name, salary) values('Record_2', 501); INSERT into t1(name, salary) values('Record_3', 210); SELECT name, salary, ((salary * 2.5)/1000) AS INCOME from t1; ---echo 'Bug#35374: div_precision is not working with table column' --echo ## Verifying variable's behavior with direct division ## SELECT 1/7; @@ -80,7 +79,7 @@ CREATE TABLE t1 id INT NOT NULL auto_increment, PRIMARY KEY (id), name VARCHAR(30), -salary LONG, +salary INT, income_tax FLOAT ); 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 58ac196d1c2..b153ac50e1e 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 @@ -101,7 +101,7 @@ SELECT @@global.engine_condition_pushdown; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.engine_condition_pushdown = -1; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@session.engine_condition_pushdown = 1.6; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.engine_condition_pushdown = "T"; @@ -111,16 +111,12 @@ SET @@session.engine_condition_pushdown = "Y"; SET @@session.engine_condition_pushdown = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.engine_condition_pushdown = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.engine_condition_pushdown = OF; -SELECT @@session.engine_condition_pushdown; ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.engine_condition_pushdown = ÓFF; - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.engine_condition_pushdown = -1; --Error ER_WRONG_VALUE_FOR_VAR @@ -133,12 +129,8 @@ SET @@global.engine_condition_pushdown = "Y"; SET @@global.engine_condition_pushdown = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.engine_condition_pushdown = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.engine_condition_pushdown = OF; -SELECT @@global.engine_condition_pushdown; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.engine_condition_pushdown = ÓFF; diff --git a/mysql-test/suite/sys_vars/t/event_scheduler_basic.test b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test index f7045651613..2e6aa3cba5c 100644 --- a/mysql-test/suite/sys_vars/t/event_scheduler_basic.test +++ b/mysql-test/suite/sys_vars/t/event_scheduler_basic.test @@ -43,10 +43,8 @@ SELECT @start_value; # Verify default value of variable # ############################################### ---Error ER_NO_DEFAULT SET @@global.event_scheduler = DEFAULT; -#SELECT @@global.event_scheduler = OFF; ---echo 'Bug# 34878: According to documentation the default value of variable is OFF'; +SELECT @@global.event_scheduler; --echo '#--------------------FN_DYNVARS_004_02------------------------#' ####################################################################### diff --git a/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test index 02448d1fd11..f19ab922c72 100644 --- a/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test +++ b/mysql-test/suite/sys_vars/t/expire_logs_days_basic.test @@ -91,7 +91,6 @@ SET @@global.expire_logs_days = -1024; SELECT @@global.expire_logs_days; SET @@global.expire_logs_days = 42949672950; SELECT @@global.expire_logs_days; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.expire_logs_days = ON; diff --git a/mysql-test/suite/sys_vars/t/flush_basic.test b/mysql-test/suite/sys_vars/t/flush_basic.test index 0b8fc0388ee..4eb821e9af1 100644 --- a/mysql-test/suite/sys_vars/t/flush_basic.test +++ b/mysql-test/suite/sys_vars/t/flush_basic.test @@ -43,9 +43,7 @@ SELECT @start_value; ############################################################# SET @@global.flush = ON; ---Error ER_NO_DEFAULT SET @@global.flush = DEFAULT; ---echo 'Bug# 34878: FN_DYNVARS_002_01 - Default value is off according to Documentation of MySQL'; SELECT @@global.flush; diff --git a/mysql-test/suite/sys_vars/t/flush_time_basic.test b/mysql-test/suite/sys_vars/t/flush_time_basic.test new file mode 100644 index 00000000000..9604769d460 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/flush_time_basic.test @@ -0,0 +1,50 @@ + +# +# note, the default is 1800 on windows, 0 everywhere else +# + +SET @start_global_value = @@global.flush_time; + +# +# exists as global only +# +--replace_result 1800 0 +select @@global.flush_time; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.flush_time; +--replace_result 1800 0 +show global variables like 'flush_time'; +--replace_result 1800 0 +show session variables like 'flush_time'; +--replace_result 1800 0 +select * from information_schema.global_variables where variable_name='flush_time'; +--replace_result 1800 0 +select * from information_schema.session_variables where variable_name='flush_time'; + +# +# show that it's writable +# +set global flush_time=1; +select @@global.flush_time; +--error ER_GLOBAL_VARIABLE +set session flush_time=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global flush_time=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global flush_time=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global flush_time="foo"; + +# +# min/max values +# +set global flush_time=0; +select @@global.flush_time; +set global flush_time=cast(-1 as unsigned int); +select @@global.flush_time; + +SET @@global.flush_time = @start_global_value; diff --git a/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test index d7a01f2bf71..8a327ab699b 100644 --- a/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test +++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_basic.test @@ -46,7 +46,6 @@ SET @@session.foreign_key_checks = 1; SET @@session.foreign_key_checks = DEFAULT; SELECT @@session.foreign_key_checks; ---echo 'Bug# 34878: No DEFAULT value for variable. Also setting DEFAULT does not give error' --echo '#---------------------FN_DYNVARS_032_02-------------------------#' ############################################################################# @@ -94,12 +93,8 @@ SET @@session.foreign_key_checks = "Y"; SET @@session.foreign_key_checks = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.foreign_key_checks = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.foreign_key_checks = OF; -SELECT @@session.foreign_key_checks; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.foreign_key_checks = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -113,11 +108,9 @@ SET @@session.foreign_key_checks = NO; # Test if accessing global foreign_key_checks gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE SET @@global.foreign_key_checks = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR SELECT @@global.foreign_key_checks; +SET @@global.foreign_key_checks = 1; --echo '#----------------------FN_DYNVARS_032_06------------------------#' ######################################################################### diff --git a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test index 4d2c63bbce6..5786b9283be 100644 --- a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test +++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test @@ -93,9 +93,6 @@ INSERT INTO t2 values (20,4); SET @@session.foreign_key_checks = 1; UPDATE t2 SET b=4 where a=20; ---echo 'Bug#35358: Updating an incorrect foreign key(inserted by disabling ' ---echo 'foreign_key_checks)to the same value does not raise error after ' ---echo 'enabling foreign_key_checks' #============================================================================== --echo 'Check when foreign_key_checks is enabled and FK constraint is re-created' diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test index 4117605c452..454b5d7477e 100644 --- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test +++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test @@ -145,10 +145,7 @@ WHERE VARIABLE_NAME='ft_boolean_syntax') AS res; ############################################################################# # Content of initial variable SELECT @global_start_value; ---Error ER_WRONG_VALUE_FOR_VAR SET @@global.ft_boolean_syntax = @global_start_value; ---echo 'Bug# 34883: ft_boolean_syntax cant be assigned values from session temporary'; ---echo 'variables'; #################################### # Restore Default value # diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test index 4ea28b015cb..242d404d244 100644 --- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test +++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test @@ -92,15 +92,11 @@ SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"faster than"' IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('+run ~line' IN BOOLEAN MODE); - ---Echo 'Bug#35359: ~ is not working correctly. Its behaving like -' +AGAINST ('+tutorial ~line' IN BOOLEAN MODE); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('10*' IN BOOLEAN MODE); ---Echo 'Bug#35360: * is not working correctly. Not all rows are returned' - SELECT id,title,body, (MATCH (title,body) AGAINST ('+MySQL +(>show @copy_file, left(@orig_file, length(@copy_file)) = @copy_file; --remove_file $MYSQLD_LOGFILE.copy --remove_file $MYSQLD_LOGFILE.orig diff --git a/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test b/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test index 1bc707f4b5d..5a78b4b0571 100644 --- a/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test +++ b/mysql-test/suite/sys_vars/t/group_concat_max_len_basic.test @@ -103,8 +103,8 @@ SET @@global.group_concat_max_len = -1024; SELECT @@global.group_concat_max_len; SET @@global.group_concat_max_len = 65536; SELECT @@global.group_concat_max_len; ---Error ER_PARSE_ERROR -SET @@global.group_concat_max_len = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.group_concat_max_len = 65530.34; SELECT @@global.group_concat_max_len; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.group_concat_max_len = test; @@ -114,11 +114,10 @@ SET @@session.group_concat_max_len = 0; SELECT @@session.group_concat_max_len; SET @@session.group_concat_max_len = -2; SELECT @@session.group_concat_max_len; ---Error ER_PARSE_ERROR -SET @@session.group_concat_max_len = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.group_concat_max_len = 65530.34; SET @@session.group_concat_max_len = 65550; SELECT @@session.group_concat_max_len; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.group_concat_max_len = test; diff --git a/mysql-test/suite/sys_vars/t/have_profiling_basic.test b/mysql-test/suite/sys_vars/t/have_profiling_basic.test new file mode 100644 index 00000000000..da0ca88d2e3 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/have_profiling_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +select @@global.have_profiling="1"; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.have_profiling; +--replace_column 2 # +show global variables like 'have_profiling'; +--replace_column 2 # +show session variables like 'have_profiling'; +--replace_column 2 # +select * from information_schema.global_variables where variable_name='have_profiling'; +--replace_column 2 # +select * from information_schema.session_variables where variable_name='have_profiling'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global have_profiling=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session have_profiling=1; + diff --git a/mysql-test/suite/sys_vars/t/identity_basic.test b/mysql-test/suite/sys_vars/t/identity_basic.test index fa5fc807414..2ddec32a621 100644 --- a/mysql-test/suite/sys_vars/t/identity_basic.test +++ b/mysql-test/suite/sys_vars/t/identity_basic.test @@ -89,7 +89,6 @@ SET @@session.identity = -1024; SELECT @@session.identity; SET @@session.identity = 42949672950; SELECT @@session.identity; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.identity = ON; diff --git a/mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test b/mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test new file mode 100644 index 00000000000..7295c466974 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/ignore_builtin_innodb_basic.test @@ -0,0 +1,19 @@ +# +# only global +# +select @@global.ignore_builtin_innodb; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.ignore_builtin_innodb; +show global variables like 'ignore_builtin_innodb'; +show session variables like 'ignore_builtin_innodb'; +select * from information_schema.global_variables where variable_name='ignore_builtin_innodb'; +select * from information_schema.session_variables where variable_name='ignore_builtin_innodb'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global ignore_builtin_innodb=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session ignore_builtin_innodb=1; + diff --git a/mysql-test/suite/sys_vars/t/init_connect_basic.test b/mysql-test/suite/sys_vars/t/init_connect_basic.test index 8557dfbf4fc..b2f2cb92e40 100644 --- a/mysql-test/suite/sys_vars/t/init_connect_basic.test +++ b/mysql-test/suite/sys_vars/t/init_connect_basic.test @@ -94,6 +94,11 @@ SELECT @@global.init_connect; SET @@global.init_connect="SET autocomit=0;REVOKE ALL ON INFORMATION_SCHEMA.*"; SELECT @@global.init_connect; +SET @@global.init_connect='set @a="12\034"'; +SELECT @@global.init_connect; +SELECT hex(@@global.init_connect); +SHOW VARIABLES LIKE 'init_connect'; + SET @@global.init_connect='SHOW VARIABLES'; SELECT @@global.init_connect; diff --git a/mysql-test/suite/sys_vars/t/init_file_basic.test b/mysql-test/suite/sys_vars/t/init_file_basic.test new file mode 100644 index 00000000000..0b59fcd7be5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/init_file_basic.test @@ -0,0 +1,19 @@ +# +# only global +# +select @@global.init_file; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.init_file; +show global variables like 'init_file'; +show session variables like 'init_file'; +select * from information_schema.global_variables where variable_name='init_file'; +select * from information_schema.session_variables where variable_name='init_file'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global init_file=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session init_file=1; + diff --git a/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test index 1ef69e34999..42d172934d1 100644 --- a/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test @@ -74,29 +74,25 @@ SELECT @@global.innodb_commit_concurrency; SET @@global.innodb_commit_concurrency = 0; SELECT @@global.innodb_commit_concurrency; -SET @@global.innodb_commit_concurrency = 1; -SELECT @@global.innodb_commit_concurrency; -SET @@global.innodb_commit_concurrency = 1000; -SELECT @@global.innodb_commit_concurrency; - --echo '#--------------------FN_DYNVARS_046_04-------------------------#' ########################################################################### # Change the value of innodb_commit_concurrency to invalid value # ########################################################################### +# +# InnoDB doesn't allow innodb_commit_concurrency to change from +# zero to non-zero or vice versa +# +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.innodb_commit_concurrency = 1; +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.innodb_commit_concurrency = -1; -SELECT @@global.innodb_commit_concurrency; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.innodb_commit_concurrency = "T"; -SELECT @@global.innodb_commit_concurrency; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.innodb_commit_concurrency = "Y"; -SELECT @@global.innodb_commit_concurrency; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.innodb_commit_concurrency = 1001; -SELECT @@global.innodb_commit_concurrency; --echo '#----------------------FN_DYNVARS_046_05------------------------#' ######################################################################### @@ -123,17 +119,6 @@ SELECT @@global.innodb_commit_concurrency; SET @@global.innodb_commit_concurrency = ON; SELECT @@global.innodb_commit_concurrency; ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - - -SET @@global.innodb_commit_concurrency = TRUE; -SELECT @@global.innodb_commit_concurrency; -SET @@global.innodb_commit_concurrency = FALSE; -SELECT @@global.innodb_commit_concurrency; - ############################## # Restore initial value # ############################## diff --git a/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test similarity index 100% rename from mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc rename to mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test deleted file mode 100644 index 13e1b205a4d..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test deleted file mode 100644 index fc26c903de5..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc - diff --git a/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test similarity index 100% rename from mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc rename to mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test deleted file mode 100644 index 8396755844e..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test deleted file mode 100644 index 4744cee20d9..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test index 840fd240bde..65681c4a544 100644 --- a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test @@ -105,9 +105,9 @@ SELECT @@global.innodb_support_xa; ########################################################################### # for session ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@session.innodb_support_xa = -0.6; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@session.innodb_support_xa = 1.6; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.innodb_support_xa = "T"; @@ -121,8 +121,6 @@ SET @@session.innodb_support_xa = SET @@session.innodb_support_xa = OF; SELECT @@session.innodb_support_xa; ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.innodb_support_xa = ÓFF; @@ -146,8 +144,6 @@ SET @@global.innodb_support_xa = SET @@global.innodb_support_xa = OF; SELECT @@global.innodb_support_xa; ---echo 'Bug# 34828 : OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.innodb_support_xa = ÓFF; diff --git a/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test similarity index 100% rename from mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc rename to mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test deleted file mode 100644 index 981b6c4e992..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test deleted file mode 100644 index ab7c01c5b6d..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test index f7d06d18ada..7af8f700f39 100644 --- a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test @@ -107,7 +107,7 @@ SELECT @@global.innodb_table_locks; # for session SET @@session.innodb_table_locks = -6; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@session.innodb_table_locks = 1.6; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.innodb_table_locks = "T"; @@ -121,8 +121,6 @@ SET @@session.innodb_table_locks = SET @@session.innodb_table_locks = OF; SELECT @@session.innodb_table_locks; ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.innodb_table_locks = ÓFF; @@ -144,8 +142,6 @@ SET @@global.innodb_table_locks = QN; SET @@global.innodb_table_locks = OF; SELECT @@global.innodb_table_locks; ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_TYPE_FOR_VAR #SET @@global.innodb_table_locks = ÓFF; diff --git a/mysql-test/suite/sys_vars/t/insert_id_basic.test b/mysql-test/suite/sys_vars/t/insert_id_basic.test index cfae87095bc..c9d3e1f4e52 100644 --- a/mysql-test/suite/sys_vars/t/insert_id_basic.test +++ b/mysql-test/suite/sys_vars/t/insert_id_basic.test @@ -90,8 +90,6 @@ SET @@session.insert_id = -1024; SELECT @@session.insert_id; SET @@session.insert_id = 42949672950; SELECT @@session.insert_id; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@session.insert_id = ON; SELECT @@session.insert_id; diff --git a/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test b/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test index 0c1a6716348..5f7d0e157f8 100644 --- a/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/interactive_timeout_basic.test @@ -104,8 +104,8 @@ SET @@global.interactive_timeout = -1024; SELECT @@global.interactive_timeout; SET @@global.interactive_timeout = 1000000000; SELECT @@global.interactive_timeout; ---Error ER_PARSE_ERROR -SET @@global.interactive_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.interactive_timeout = 65530.34; SELECT @@global.interactive_timeout; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.interactive_timeout = test; @@ -115,11 +115,10 @@ SET @@session.interactive_timeout = 0; SELECT @@session.interactive_timeout; SET @@session.interactive_timeout = -2; SELECT @@session.interactive_timeout; ---Error ER_PARSE_ERROR -SET @@session.interactive_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.interactive_timeout = 65530.34; SET @@session.interactive_timeout = 100000000; SELECT @@session.interactive_timeout; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.interactive_timeout = test; diff --git a/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test index bc6ac8687f7..e6141af4bbe 100644 --- a/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test +++ b/mysql-test/suite/sys_vars/t/keep_files_on_create_basic.test @@ -122,7 +122,7 @@ SET @@global.keep_files_on_create = FELSE; SET @@global.keep_files_on_create = -1024; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.keep_files_on_create = 65536; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.keep_files_on_create = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.keep_files_on_create = test; @@ -131,17 +131,14 @@ SET @@global.keep_files_on_create = test; SET @@session.keep_files_on_create = ONN; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.keep_files_on_create = ONF; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.keep_files_on_create = OF; -SELECT @@session.keep_files_on_create; ---echo 'Bug# 34828: FN_DYNVARS_054_05 - OF is also working as OFF and no error is coming'; - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.keep_files_on_create = 'OFN'; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.keep_files_on_create = -2; ---Error ER_PARSE_ERROR -SET @@session.keep_files_on_create = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.keep_files_on_create = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.keep_files_on_create = 65550; diff --git a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc b/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test similarity index 78% rename from mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc rename to mysql-test/suite/sys_vars/t/key_buffer_size_basic.test index e55673fd045..354c65490a4 100644 --- a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc +++ b/mysql-test/suite/sys_vars/t/key_buffer_size_basic.test @@ -28,12 +28,10 @@ --source include/load_sysvars.inc -let $minimum_range= BETWEEN 8 AND 36; ######################################################################## # START OF key_buffer_size TESTS # ######################################################################## ---disable_warnings ######################################################################## # Saving initial value of key_buffer_size in a temporary variable # ######################################################################## @@ -45,10 +43,8 @@ SET @start_value = @@global.key_buffer_size; # Display the DEFAULT value of key_buffer_size # ######################################################################## -SET @@global.key_buffer_size = 99; ---Error ER_NO_DEFAULT SET @@global.key_buffer_size = DEFAULT; -eval SELECT @@global.key_buffer_size $minimum_range; +SELECT @@global.key_buffer_size; --echo '#---------------------FN_DYNVARS_055_02-------------------------#' ############################################### @@ -63,18 +59,6 @@ SELECT @@global.key_buffer_size = @start_value; # Change the value of key_buffer_size to a valid value # ######################################################################## -SET @@global.key_buffer_size = 8 ; -eval SELECT @@global.key_buffer_size $minimum_range; ---disable_warnings -# The next subtest is set to comment because it will -# be tried to allocate the buffer instantly which -# might lead to a message about missing resources, -# excessive runtime etc. especially if the main memory is less than 4GB. -#SET @@global.key_buffer_size = 4294967295; ---enable_warnings -#SELECT @@global.key_buffer_size; -SET @@global.key_buffer_size = 1800; -eval SELECT @@global.key_buffer_size $minimum_range; SET @@global.key_buffer_size = 65535; SELECT @@global.key_buffer_size; @@ -83,31 +67,20 @@ SELECT @@global.key_buffer_size; # Change the value of key_buffer_size to invalid value # ########################################################################### -# The next subtests are set to comment because they will -# be tried to allocate the buffer instantly which -# might lead to a message about missing resources, -# excessive runtime etc. especially if the main memory is less than 4GB. -# The negative values lead to very big numbers, e.g. -1 to -# a size of 18446744073709551615 bytes with a 32bit binary. -# See Bug #42103. -#SET @@global.key_buffer_size = -1; -#SELECT @@global.key_buffer_size; -#SET @@global.key_buffer_size = 100000000000; -#SELECT @@global.key_buffer_size; +--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE +SET @@global.key_buffer_size = -1; +--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE +SET @@global.key_buffer_size = 4; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.key_buffer_size = 10000.01; SELECT @@global.key_buffer_size; -#SET @@global.key_buffer_size = -1024; -#SELECT @@global.key_buffer_size; -SET @@global.key_buffer_size = 4; -eval SELECT @@global.key_buffer_size $minimum_range; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.key_buffer_size = ON; -eval SELECT @@global.key_buffer_size $minimum_range; +SELECT @@global.key_buffer_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.key_buffer_size = 'test'; -eval SELECT @@global.key_buffer_size $minimum_range; +SELECT @@global.key_buffer_size; --echo '#-------------------FN_DYNVARS_055_05----------------------------#' ########################################################################### @@ -116,7 +89,6 @@ eval SELECT @@global.key_buffer_size $minimum_range; --Error ER_GLOBAL_VARIABLE SET @@session.key_buffer_size = 0; -eval SELECT @@global.key_buffer_size $minimum_range; --echo '#----------------------FN_DYNVARS_055_06------------------------#' ############################################################################## @@ -136,13 +108,10 @@ WHERE VARIABLE_NAME='key_buffer_size'; # Check if TRUE and FALSE values can be used on variable # ################################################################### -# The following assignment are accepted, but should be rejected -# like the value ON (see above). -# See Bug #42104 +--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE SET @@global.key_buffer_size = TRUE; -eval SELECT @@global.key_buffer_size $minimum_range; +--Error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE SET @@global.key_buffer_size = FALSE; -eval SELECT @@global.key_buffer_size $minimum_range; --echo '#---------------------FN_DYNVARS_055_08----------------------#' ##################################################################### @@ -150,11 +119,7 @@ eval SELECT @@global.key_buffer_size $minimum_range; # points to same session variable # ##################################################################### -# due to differences in contents of the warnings ---disable_warnings -SET @@global.key_buffer_size = 8 ; SELECT @@key_buffer_size = @@global.key_buffer_size; ---enable_warnings --echo '#---------------------FN_DYNVARS_055_09----------------------#' ########################################################################## @@ -163,7 +128,6 @@ SELECT @@key_buffer_size = @@global.key_buffer_size; --Error ER_GLOBAL_VARIABLE SET key_buffer_size = 8 ; -eval SELECT @@global.key_buffer_size $minimum_range; --Error ER_PARSE_ERROR SET local.key_buffer_size = 10; --Error ER_UNKNOWN_TABLE @@ -181,7 +145,6 @@ SELECT key_buffer_size = @@session.key_buffer_size; SET @@global.key_buffer_size = @start_value; ---enable_warnings ####################################################################### # END OF key_buffer_size TESTS # ####################################################################### diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test deleted file mode 100644 index 086e51e185c..00000000000 --- a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/key_buffer_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test deleted file mode 100644 index 5604c56480b..00000000000 --- a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/key_buffer_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_func.test b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test index 8ee305a3ac1..df0ce62c69c 100644 --- a/mysql-test/suite/sys_vars/t/key_buffer_size_func.test +++ b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test @@ -86,11 +86,6 @@ connection test_con2; --echo ## Key_reads must be zero (no disk access) ## show status like 'Key_reads'; -CONNECTION default; ---disable_warnings -SET @@global.key_buffer_size = 36; ---enable_warnings - --echo ## Connecting with connection test_con1 ## CONNECTION test_con1; diff --git a/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test similarity index 95% rename from mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc rename to mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test index b12ea45b762..99a3c5dc327 100644 --- a/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc +++ b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic.test @@ -43,10 +43,7 @@ SELECT @start_value; # Display the DEFAULT value of key_cache_block_size # ################################################################################ -SET @@global.key_cache_block_size = 600; ---Error ER_NO_DEFAULT SET @@global.key_cache_block_size = DEFAULT; ---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; SELECT @@global.key_cache_block_size; @@ -72,8 +69,6 @@ SET @@global.key_cache_block_size = 1800; SELECT @@global.key_cache_block_size; SET @@global.key_cache_block_size = 16383; SELECT @@global.key_cache_block_size; ---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; - --echo '#--------------------FN_DYNVARS_057_04-------------------------#' ########################################################################### @@ -96,8 +91,6 @@ SELECT @@global.key_cache_block_size; SET @@global.key_cache_block_size = 16385; SELECT @@global.key_cache_block_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.key_cache_block_size = ON; SELECT @@global.key_cache_block_size; diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test deleted file mode 100644 index db0c0bd67a2..00000000000 --- a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/key_cache_block_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test deleted file mode 100644 index 7403d762dc4..00000000000 --- a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/key_cache_block_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test similarity index 97% rename from mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc rename to mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test index a2cc49a1f38..dd41e4d37a0 100644 --- a/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc +++ b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic.test @@ -43,10 +43,7 @@ SELECT @start_value; # Display the DEFAULT value of key_cache_division_limit # ################################################################################ -SET @@global.key_cache_division_limit = 50; ---Error ER_NO_DEFAULT SET @@global.key_cache_division_limit = DEFAULT; ---echo 'Bug# 34878: This variable has default value according to documentation'; SELECT @@global.key_cache_division_limit; @@ -95,8 +92,6 @@ SELECT @@global.key_cache_division_limit; SET @@global.key_cache_division_limit = 65535; SELECT @@global.key_cache_division_limit; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.key_cache_division_limit = ON; SELECT @@global.key_cache_division_limit; diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test deleted file mode 100644 index fcc28438866..00000000000 --- a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/key_cache_division_limit_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test deleted file mode 100644 index ac4dd1c96d3..00000000000 --- a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/key_cache_division_limit_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/large_files_support_basic.test b/mysql-test/suite/sys_vars/t/large_files_support_basic.test new file mode 100644 index 00000000000..690b32fce66 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/large_files_support_basic.test @@ -0,0 +1,19 @@ +# +# only global +# +select @@global.large_files_support; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.large_files_support; +show global variables like 'large_files_support'; +show session variables like 'large_files_support'; +select * from information_schema.global_variables where variable_name='large_files_support'; +select * from information_schema.session_variables where variable_name='large_files_support'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global large_files_support=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session large_files_support=1; + diff --git a/mysql-test/suite/sys_vars/t/large_page_size_basic.test b/mysql-test/suite/sys_vars/t/large_page_size_basic.test new file mode 100644 index 00000000000..cff90336fa0 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/large_page_size_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +select @@global.large_page_size = 1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.large_page_size; +--replace_column 2 # +show global variables like 'large_page_size'; +--replace_column 2 # +show session variables like 'large_page_size'; +--replace_column 2 # +select * from information_schema.global_variables where variable_name='large_page_size'; +--replace_column 2 # +select * from information_schema.session_variables where variable_name='large_page_size'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global large_page_size=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session large_page_size=1; + diff --git a/mysql-test/suite/sys_vars/t/large_pages_basic.test b/mysql-test/suite/sys_vars/t/large_pages_basic.test new file mode 100644 index 00000000000..840b9176832 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/large_pages_basic.test @@ -0,0 +1,19 @@ +# +# show the global and session values; +# +select @@global.large_pages; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.large_pages; +show global variables like 'large_pages'; +show session variables like 'large_pages'; +select * from information_schema.global_variables where variable_name='large_pages'; +select * from information_schema.session_variables where variable_name='large_pages'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global large_pages=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session large_pages=1; + diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_basic.test b/mysql-test/suite/sys_vars/t/last_insert_id_basic.test new file mode 100644 index 00000000000..a2e0116f11d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/last_insert_id_basic.test @@ -0,0 +1,30 @@ + +# +# exists as a session only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@global.last_insert_id; +select @@session.last_insert_id; +show global variables like 'last_insert_id'; +show session variables like 'last_insert_id'; +select * from information_schema.global_variables where variable_name='last_insert_id'; +select * from information_schema.session_variables where variable_name='last_insert_id'; + +# +# show that it's writable +# +set session last_insert_id=1; +select @@session.last_insert_id; +--error ER_LOCAL_VARIABLE +set global last_insert_id=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set session last_insert_id=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set session last_insert_id=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set session last_insert_id="foo"; + diff --git a/mysql-test/suite/sys_vars/t/lc_messages_basic.test b/mysql-test/suite/sys_vars/t/lc_messages_basic.test new file mode 100644 index 00000000000..f8a25738285 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/lc_messages_basic.test @@ -0,0 +1,35 @@ +SET @start_global_value = @@global.lc_messages; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.lc_messages; +select @@session.lc_messages; +show global variables like 'lc_messages'; +show session variables like 'lc_messages'; +select * from information_schema.global_variables where variable_name='lc_messages'; +select * from information_schema.session_variables where variable_name='lc_messages'; + +# +# show that it's writable +# +set global lc_messages=1; +select @@global.lc_messages; +set session lc_messages=2; +select @@session.lc_messages; +set global lc_messages="en_US"; +select @@global.lc_messages; +set session lc_messages="en_GB"; +select @@session.lc_messages; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global lc_messages=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global lc_messages=1e1; + +SET @@global.lc_messages = @start_global_value; +SELECT @@global.lc_messages; diff --git a/mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test b/mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test new file mode 100644 index 00000000000..6d452a3655c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/lc_messages_dir_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +select @@global.lc_messages_dir; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.lc_messages_dir; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +show global variables like 'lc_messages_dir'; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +show session variables like 'lc_messages_dir'; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +select * from information_schema.global_variables where variable_name='lc_messages_dir'; +--replace_result $MYSQL_SHAREDIR MYSQL_SHAREDIR +select * from information_schema.session_variables where variable_name='lc_messages_dir'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global lc_messages_dir=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session lc_messages_dir=1; diff --git a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test index d0aa0c56937..68ee00b6ee0 100644 --- a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test +++ b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test @@ -178,7 +178,7 @@ SELECT @@session.lc_time_names; SET @@session.lc_time_names=de_LU; SELECT @@session.lc_time_names; ---Error ER_UNKNOWN_ERROR +--error ER_UNKNOWN_LOCALE SET @@session.lc_time_names=EE; --echo 'Bug: The locale for Estonian - Estonia is not supported. It is present'; --echo 'in manual'; @@ -322,6 +322,8 @@ SET @@session.lc_time_names=sr_YU; SELECT @@session.lc_time_names; SET @@session.lc_time_names=sv_FI; SELECT @@session.lc_time_names; +SET @@session.lc_time_names=sr_RS; +SELECT @@session.lc_time_names; SET @@session.lc_time_names=sv_SE; SELECT @@session.lc_time_names; SET @@session.lc_time_names=ta_IN; @@ -407,7 +409,7 @@ SELECT @@global.lc_time_names; SET @@global.lc_time_names=de_LU; SELECT @@global.lc_time_names; ---Error ER_UNKNOWN_ERROR +--error ER_UNKNOWN_LOCALE SET @@global.lc_time_names=EE; --echo 'Bug: The locale for Estonian - Estonia is not supported. It is'; --echo 'present in manual'; @@ -553,6 +555,8 @@ SET @@global.lc_time_names=sr_YU; SELECT @@global.lc_time_names; SET @@global.lc_time_names=sv_FI; SELECT @@global.lc_time_names; +SET @@global.lc_time_names=sr_RS; +SELECT @@global.lc_time_names; SET @@global.lc_time_names=sv_SE; SELECT @@global.lc_time_names; SET @@global.lc_time_names=ta_IN; @@ -616,27 +620,27 @@ SET @@lc_time_names = 107; SELECT @@lc_time_names; SET @@lc_time_names = 108; SELECT @@lc_time_names; - ---Error ER_UNKNOWN_ERROR SET @@lc_time_names = 109; - +SELECT @@lc_time_names; +--Error ER_UNKNOWN_LOCALE +SET @@lc_time_names = 110; --echo '#--------------------FN_DYNVARS_060_10-------------------------#' ############################################################################# # Change the value of lc_time_names to an invalid value for session # ############################################################################# ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@lc_time_names = en_EN; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@lc_time_names = US_en; --Error ER_WRONG_TYPE_FOR_VAR SET @@lc_time_names = 1.1; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@lc_time_names = -1; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@lc_time_names = 'en US'; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@lc_time_names = 'enUS'; SET @@lc_time_names = true; @@ -644,7 +648,7 @@ SELECT @@lc_time_names AS res_with_true; SET @@lc_time_names = false; SELECT @@lc_time_names AS res_with_false; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@lc_time_names = ON; @@ -653,17 +657,17 @@ SET @@lc_time_names = ON; # Change the value of lc_time_names to an invalid value for global # ############################################################################ ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@global.lc_time_names = en_EN; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@global.lc_time_names = US_en; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.lc_time_names = 1.1; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@global.lc_time_names = -1; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.lc_time_names = NULL; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@global.lc_time_names = 'enUS'; SET @@global.lc_time_names = true; @@ -671,7 +675,7 @@ SELECT @@global.lc_time_names; SET @@global.lc_time_names = false; SELECT @@global.lc_time_names; ---Error ER_UNKNOWN_ERROR +--Error ER_UNKNOWN_LOCALE SET @@global.lc_time_names = ON; --echo '#--------------------FN_DYNVARS_060_12-------------------------#' diff --git a/mysql-test/suite/sys_vars/t/locked_in_memory_basic.test b/mysql-test/suite/sys_vars/t/locked_in_memory_basic.test new file mode 100644 index 00000000000..97313b7f608 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/locked_in_memory_basic.test @@ -0,0 +1,20 @@ +--source include/not_windows.inc +# +# only global +# +select @@global.locked_in_memory; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.locked_in_memory; +show global variables like 'locked_in_memory'; +show session variables like 'locked_in_memory'; +select * from information_schema.global_variables where variable_name='locked_in_memory'; +select * from information_schema.session_variables where variable_name='locked_in_memory'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global locked_in_memory=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session locked_in_memory=1; + diff --git a/mysql-test/suite/sys_vars/t/log_basic.test b/mysql-test/suite/sys_vars/t/log_basic.test index 98e99fa4e4f..74b344cff6d 100644 --- a/mysql-test/suite/sys_vars/t/log_basic.test +++ b/mysql-test/suite/sys_vars/t/log_basic.test @@ -41,13 +41,9 @@ SELECT @@global.log AS INIT_VALUE; SELECT @@log AS INIT_VALUE; -SET @@global.general_log = ON; - -SET global general_log = 0; - ---echo 'Bug# 34832: log is a system but it is not accessible using SET @@global.log;' ---echo 'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.' +SET @@global.log = ON; +SET global log = 0; --echo '#--------------------FN_DYNVARS_062_02-------------------------#' ################################################################################ diff --git a/mysql-test/suite/sys_vars/t/log_bin_basic.test b/mysql-test/suite/sys_vars/t/log_bin_basic.test new file mode 100644 index 00000000000..0712b42a370 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/log_bin_basic.test @@ -0,0 +1,19 @@ +# +# only global +# +select @@global.log_bin; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.log_bin; +show global variables like 'log_bin'; +show session variables like 'log_bin'; +select * from information_schema.global_variables where variable_name='log_bin'; +select * from information_schema.session_variables where variable_name='log_bin'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global log_bin=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session log_bin=1; + diff --git a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test index e7bdb433971..15ffad2742a 100644 --- a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test +++ b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test @@ -37,10 +37,6 @@ SET @start_global_value = @@global.log_bin_trust_function_creators; SELECT @start_global_value; ---echo 'Bug# 34876: TRUE value is coming as Default' ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @start_session_value = @@session.log_bin_trust_function_creators; ---echo 'Bug# 34881: According to documentation the scope of this variable is GLOBAL as well as SESSION too'; --echo '#--------------------FN_DYNVARS_063_01-------------------------#' ######################################################################## @@ -99,10 +95,8 @@ SELECT @@session.log_bin_trust_function_creators; SET @@global.log_bin_trust_function_creators = 'ONN'; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_bin_trust_function_creators = "OFFF"; +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_bin_trust_function_creators = OF; - ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_bin_trust_function_creators = TTRUE; --Error ER_WRONG_VALUE_FOR_VAR @@ -111,7 +105,7 @@ SET @@global.log_bin_trust_function_creators = FELSE; SET @@global.log_bin_trust_function_creators = -1024; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_bin_trust_function_creators = 65536; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.log_bin_trust_function_creators = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_bin_trust_function_creators = test; diff --git a/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test b/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test deleted file mode 100644 index 1d44c77b1a7..00000000000 --- a/mysql-test/suite/sys_vars/t/log_bin_trust_routine_creators_basic.test +++ /dev/null @@ -1,164 +0,0 @@ -############## mysql-test\t\log_bin_trust_routine_creators_basic.test ######### -# # -# Variable Name: log_bin_trust_routine_creators # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: False # -# Range: # -# # -# # -# Creation Date: 2008-02-12 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable # -# log_bin_trust_routine_creators that checks the # -# behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: (Not given on website) # -# # -############################################################################### - ---source include/load_sysvars.inc -#################################################################### -# START OF log_bin_trust_routine_creators TESTS # -#################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.log_bin_trust_routine_creators; -SELECT @start_global_value; - - ---echo '#--------------------FN_DYNVARS_064_01-------------------------#' -######################################################################## -# Display the DEFAULT value of log_bin_trust_routine_creators # -######################################################################## - -SET @@global.log_bin_trust_routine_creators = TRUE; -SET @@global.log_bin_trust_routine_creators = DEFAULT; -SELECT @@global.log_bin_trust_routine_creators; - - ---echo '#--------------------FN_DYNVARS_064_02-------------------------#' -############################################################################## -# Check the DEFAULT value of log_bin_trust_routine_creators # -############################################################################## - -SET @@global.log_bin_trust_routine_creators = DEFAULT; -SELECT @@global.log_bin_trust_routine_creators = 'FALSE'; - - ---echo '#--------------------FN_DYNVARS_064_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.log_bin_trust_routine_creators = ON; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = OFF; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = 0; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = 1; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = TRUE; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = FALSE; -SELECT @@global.log_bin_trust_routine_creators; - - ---echo '#-------------------FN_DYNVARS_064_04----------------------------#' -########################################################################### -# Test if accessing session log_bin_trust_routine_creators gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.log_bin_trust_routine_creators = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.log_bin_trust_routine_creators; - - ---echo '#------------------FN_DYNVARS_064_05-----------------------#' -########################################################################## -# Change the value of log_bin_trust_routine_creators to an invalid value # -########################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = 'ONN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = "OFFF"; -SET @@global.log_bin_trust_routine_creators = OF; -SELECT @@global.log_bin_trust_routine_creators; ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = TTRUE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = FELSE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = -1024; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = 65536; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = 65530.34; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = test; - - ---echo '#------------------FN_DYNVARS_064_06-----------------------#' -############################################################################### -# Check if the value in GLOBAL & SESSION Tables matches value in variable # -############################################################################### - - -SELECT @@global.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators'; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators'; - - ---echo '#---------------------FN_DYNVARS_064_07----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - - -SET @@global.log_bin_trust_routine_creators = TRUE; -SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators; - - ---echo '#---------------------FN_DYNVARS_064_08----------------------#' -################################################################### -# Check if variable can be accessed with and without @@ sign # -################################################################### - -SET @@global.log_bin_trust_routine_creators = TRUE; -SELECT @@log_bin_trust_routine_creators; ---Error ER_UNKNOWN_TABLE -SELECT local.log_bin_trust_routine_creators; ---Error ER_UNKNOWN_TABLE -SELECT session.log_bin_trust_routine_creators; ---Error ER_BAD_FIELD_ERROR -SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.log_bin_trust_routine_creators = @start_global_value; -SELECT @@global.log_bin_trust_routine_creators; - - -################################################################### -# END OF log_bin_trust_routine_creators TESTS # -################################################################### - diff --git a/mysql-test/suite/sys_vars/t/log_error_basic.test b/mysql-test/suite/sys_vars/t/log_error_basic.test new file mode 100644 index 00000000000..67bd33cb31b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/log_error_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.log_error; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.log_error; +show global variables like 'log_error'; +show session variables like 'log_error'; +select * from information_schema.global_variables where variable_name='log_error'; +select * from information_schema.session_variables where variable_name='log_error'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global log_error=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session log_error=1; diff --git a/mysql-test/suite/sys_vars/t/log_output_basic.test b/mysql-test/suite/sys_vars/t/log_output_basic.test index 45998e85480..b45d30f16a3 100644 --- a/mysql-test/suite/sys_vars/t/log_output_basic.test +++ b/mysql-test/suite/sys_vars/t/log_output_basic.test @@ -46,10 +46,6 @@ SELECT @start_value; SET @@global.log_output = FILE; SET @@global.log_output = DEFAULT; SELECT @@global.log_output; ---echo 'Bug# 34876: Documentation specifies a DEFAULT value of TABLE whereas'; ---echo 'DEFAULT value is FILE. Also note that initial value is different'; ---echo 'from DEFAULT'; - --echo '#---------------------FN_DYNVARS_065_02-------------------------#' ################################################## @@ -61,9 +57,6 @@ SET @@global.log_output = NULL; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = ""; -SELECT @@global.log_output; ---echo 'Bug# 34838: Empty value is allowed where as it is not specified in'; ---echo 'documentation'; --echo '#--------------------FN_DYNVARS_065_03------------------------#' ######################################################################## @@ -103,9 +96,6 @@ SELECT @@global.log_output; SET @@global.log_output = ',TABLE'; SELECT @@global.log_output; -SET @@global.log_output = ','; -SELECT @@global.log_output; - SET @@global.log_output = 'TABLE,,FILE,,,'; SELECT @@global.log_output; @@ -117,34 +107,26 @@ SELECT @@global.log_output; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = -1; + --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = TAB; + --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = NIL; + --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = 'FIL'; + --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = 'T'; # use of space in value --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = 'TABLE, FILE'; + --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = ' TABLE,FILE'; -SET @@global.log_output = ', '; -SELECT @@global.log_output; -SET @@global.log_output = ' '; -SELECT @@global.log_output; -SET @@global.log_output = ' '; -SELECT @@global.log_output; - ---echo 'Bug: The behavior of space in value is not consistent.'; ---echo 'Some times it is trimmed and some times not.'; ---echo 'The space before and after value is not accepted where as space'; ---echo 'between comma is accepted.'; - - --echo '#-------------------FN_DYNVARS_065_05----------------------------#' ###################################################################### # Test if accessing session log_output gives error # @@ -208,6 +190,7 @@ SET @@global.log_output = 8; SET @@global.log_output = TRUE; SELECT @@global.log_output; + --Error ER_WRONG_VALUE_FOR_VAR SET @@global.log_output = FALSE; SELECT @@global.log_output; diff --git a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test index f7e6e8df640..a726bff08d7 100644 --- a/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test +++ b/mysql-test/suite/sys_vars/t/log_queries_not_using_indexes_basic.test @@ -56,30 +56,12 @@ SELECT @@global.log_queries_not_using_indexes; SET GLOBAL log_queries_not_using_indexes= -0; SELECT @@global.log_queries_not_using_indexes; +--error ER_WRONG_TYPE_FOR_VAR SET GLOBAL log_queries_not_using_indexes= 0.00; -SELECT @@global.log_queries_not_using_indexes; - -SET GLOBAL log_queries_not_using_indexes= -0.0; -SELECT @@global.log_queries_not_using_indexes; - -SET GLOBAL log_queries_not_using_indexes= 001.00; -SELECT @@global.log_queries_not_using_indexes; - -SET GLOBAL log_queries_not_using_indexes= +1.0; -SELECT @@global.log_queries_not_using_indexes; SET GLOBAL log_queries_not_using_indexes= +0; SELECT @@global.log_queries_not_using_indexes; -SET GLOBAL log_queries_not_using_indexes= +0.000000; -SELECT @@global.log_queries_not_using_indexes; - -SET GLOBAL log_queries_not_using_indexes= 0000.00000; -SELECT @@global.log_queries_not_using_indexes; - -SET GLOBAL log_queries_not_using_indexes= .0; -SELECT @@global.log_queries_not_using_indexes; - ################################################################# # Check if the value in GLOBAL Table matches value in variable # ################################################################# @@ -96,9 +78,6 @@ SET @@global.log_queries_not_using_indexes= BLABLA; --error ER_WRONG_VALUE_FOR_VAR SET @@global.log_queries_not_using_indexes= 25; ---error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_queries_not_using_indexes= 12.34; - --error ER_WRONG_VALUE_FOR_VAR SET GLOBAL log_queries_not_using_indexes= -1; @@ -127,7 +106,5 @@ SET @@global log_queries_not_using_indexes= TRUE; --error ER_PARSE_ERROR SET @@SESSION log_queries_not_using_indexes= TRUE; - SET @@global.log_queries_not_using_indexes= @start_value; -SELECT IF(@@GLOBAL.log_queries_not_using_indexes, "ON", "OFF") = VARIABLE_VALUE diff --git a/mysql-test/suite/sys_vars/t/log_slave_updates_basic.test b/mysql-test/suite/sys_vars/t/log_slave_updates_basic.test new file mode 100644 index 00000000000..93212e4f1ae --- /dev/null +++ b/mysql-test/suite/sys_vars/t/log_slave_updates_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.log_slave_updates; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.log_slave_updates; +show global variables like 'log_slave_updates'; +show session variables like 'log_slave_updates'; +select * from information_schema.global_variables where variable_name='log_slave_updates'; +select * from information_schema.session_variables where variable_name='log_slave_updates'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global log_slave_updates=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session log_slave_updates=1; diff --git a/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test b/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test new file mode 100644 index 00000000000..95dda5b73c9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test @@ -0,0 +1,170 @@ +##################### mysql-test\t\slow_query_log_basic.test ################### +# # +# Variable Name: log_slow_queries # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: BOOLEAN # +# Default Value: OFF # +# Valid Values: ON, OFF # +# # +# # +# Creation Date: 2008-03-16 # +# Author: Salman Rawala # +# # +# Description: Test Cases of Dynamic System Variable "log_slow_queries" # +# that checks behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-options.html#option_mysqld_event-scheduler # +# # +################################################################################ + +--source include/load_sysvars.inc + +########################################################### +# START OF log_slow_queries TESTS # +########################################################### + + +###################################################################### +# Saving initial value of log_slow_queries in a temporary variable # +###################################################################### + +SET @start_value = @@global.log_slow_queries; +SELECT @start_value; + + +--echo '#---------------------FN_DYNVARS_004_01-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.log_slow_queries = DEFAULT; +SELECT @@global.log_slow_queries = 0; + + +--echo '#--------------------FN_DYNVARS_004_02------------------------#' +###################################################################### +# Change the value of log_slow_queries to a valid value # +###################################################################### + +SET @@global.log_slow_queries = ON; +SELECT @@global.log_slow_queries; +SET @@global.log_slow_queries = OFF; +SELECT @@global.log_slow_queries; + +--echo '#--------------------FN_DYNVARS_004_03-------------------------#' +###################################################################### +# Change the value of log_slow_queries to invalid value # +###################################################################### + +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = 2; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = -1; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = TRUEF; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = TRUE_F; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = FALSE0; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = OON; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = ONN; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = OOFF; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = 0FF; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = ' '; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = " "; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.log_slow_queries = ''; + + +--echo '#-------------------FN_DYNVARS_004_04----------------------------#' +################################################################## +# Test if accessing session log_slow_queries gives error # +################################################################## + +--Error ER_GLOBAL_VARIABLE +SET @@session.log_slow_queries = OFF; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.log_slow_queries; + + +--echo '#----------------------FN_DYNVARS_004_05------------------------#' +############################################################################## +# Check if the value in GLOBAL Tables matches values in variable # +############################################################################## + +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; + + +--echo '#---------------------FN_DYNVARS_004_06----------------------#' +################################################################ +# Check if 0 and 1 values can be used on variable # +################################################################ + +SET @@global.log_slow_queries = 0; +SELECT @@global.log_slow_queries; +SET @@global.log_slow_queries = 1; +SELECT @@global.log_slow_queries; + +--echo '#---------------------FN_DYNVARS_004_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.log_slow_queries = TRUE; +SELECT @@global.log_slow_queries; +SET @@global.log_slow_queries = FALSE; +SELECT @@global.log_slow_queries; + +--echo '#---------------------FN_DYNVARS_004_08----------------------#' +############################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points # +# to same session variable # +############################################################################## + +SET @@global.log_slow_queries = ON; +SELECT @@log_slow_queries = @@global.log_slow_queries; + +--echo '#---------------------FN_DYNVARS_004_09----------------------#' +###################################################################### +# Check if log_slow_queries can be accessed with and without @@ sign # +###################################################################### +--Error ER_GLOBAL_VARIABLE +SET log_slow_queries = ON; +--Error ER_PARSE_ERROR +SET local.log_slow_queries = OFF; +--Error ER_UNKNOWN_TABLE +SELECT local.log_slow_queries; +--Error ER_PARSE_ERROR +SET global.log_slow_queries = ON; +--Error ER_UNKNOWN_TABLE +SELECT global.log_slow_queries; +--Error ER_BAD_FIELD_ERROR +SELECT log_slow_queries = @@session.log_slow_queries; + + + +############################## +# Restore initial value # +############################## + +SET @@global.log_slow_queries = @start_value; +SELECT @@global.log_slow_queries; + + +#################################################### +# END OF log_slow_queries TESTS # +#################################################### diff --git a/mysql-test/suite/sys_vars/t/long_query_time_basic.test b/mysql-test/suite/sys_vars/t/long_query_time_basic.test index c21e0a751c1..25b4a698008 100644 --- a/mysql-test/suite/sys_vars/t/long_query_time_basic.test +++ b/mysql-test/suite/sys_vars/t/long_query_time_basic.test @@ -105,24 +105,25 @@ SELECT @@session.long_query_time; # Change the value of long_query_time to an invalid value # ######################################################## +# windows *is* different +--replace_result +011 +11 SET @@global.long_query_time = 100000000000; SELECT @@global.long_query_time; SET @@global.long_query_time = -1; SELECT @@global.long_query_time; ---Error ER_PARSE_ERROR -SET @@global.long_query_time = 65530.34.; +SET @@global.long_query_time = 65530.34; SELECT @@global.long_query_time; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.long_query_time = test; SELECT @@global.long_query_time; +--replace_result +011 +11 SET @@session.long_query_time = 100000000000; SELECT @@session.long_query_time; SET @@session.long_query_time = -2; SELECT @@session.long_query_time; ---Error ER_PARSE_ERROR -SET @@session.long_query_time = 65530.34.; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.long_query_time = 65530.34; +SELECT @@session.long_query_time; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.long_query_time = test; diff --git a/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test index 762fa726f1f..e00688ef974 100644 --- a/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test +++ b/mysql-test/suite/sys_vars/t/low_priority_updates_basic.test @@ -122,7 +122,7 @@ SET @@global.low_priority_updates = FELSE; SET @@global.low_priority_updates = -1024; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.low_priority_updates = 65536; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.low_priority_updates = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.low_priority_updates = test; @@ -131,20 +131,16 @@ SET @@global.low_priority_updates = test; SET @@session.low_priority_updates = ONN; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.low_priority_updates = ONF; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.low_priority_updates = OF; -SELECT @@session.low_priority_updates; ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.low_priority_updates = 'OFN'; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.low_priority_updates = -2; ---Error ER_PARSE_ERROR -SET @@session.low_priority_updates = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.low_priority_updates = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.low_priority_updates = 65550; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.low_priority_updates = test; diff --git a/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test b/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test new file mode 100644 index 00000000000..6c15f188880 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +select @@global.lower_case_file_system=2; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.lower_case_file_system; +--replace_column 2 # +show global variables like 'lower_case_file_system'; +--replace_column 2 # +show session variables like 'lower_case_file_system'; +--replace_column 2 # +select * from information_schema.global_variables where variable_name='lower_case_file_system'; +--replace_column 2 # +select * from information_schema.session_variables where variable_name='lower_case_file_system'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global lower_case_file_system=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session lower_case_file_system=1; + diff --git a/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test b/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test new file mode 100644 index 00000000000..8d6a3bb5ca6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +select @@global.lower_case_table_names=20; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.lower_case_table_names; +--replace_column 2 # +show global variables like 'lower_case_table_names'; +--replace_column 2 # +show session variables like 'lower_case_table_names'; +--replace_column 2 # +select * from information_schema.global_variables where variable_name='lower_case_table_names'; +--replace_column 2 # +select * from information_schema.session_variables where variable_name='lower_case_table_names'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global lower_case_table_names=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session lower_case_table_names=1; + diff --git a/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test index 8be0e5f670e..93303b78639 100644 --- a/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test +++ b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test @@ -56,7 +56,7 @@ SELECT @@global.max_allowed_packet; --Error ER_VARIABLE_IS_READONLY SET @@session.max_allowed_packet = 20000; ---Error ER_NO_DEFAULT +--Error ER_VARIABLE_IS_READONLY SET @@session.max_allowed_packet = DEFAULT; SELECT @@session.max_allowed_packet; @@ -79,7 +79,6 @@ SET @@global.max_allowed_packet = 1024; SELECT @@global.max_allowed_packet; SET @@global.max_allowed_packet = 1025; SELECT @@global.max_allowed_packet; ---echo : 'Bug# 34841: "Invalid values are coming in variable on assigning valid value'; SET @@global.max_allowed_packet = 1073741824; SELECT @@global.max_allowed_packet; SET @@global.max_allowed_packet = 1073741823; @@ -120,8 +119,8 @@ SET @@global.max_allowed_packet = 1023; SELECT @@global.max_allowed_packet; SET @@global.max_allowed_packet = 10737418241; SELECT @@global.max_allowed_packet; ---Error ER_PARSE_ERROR -SET @@global.max_allowed_packet = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_allowed_packet = 65530.34; SELECT @@global.max_allowed_packet; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_allowed_packet = test; @@ -136,12 +135,11 @@ SELECT @@session.max_allowed_packet; --Error ER_VARIABLE_IS_READONLY SET @@session.max_allowed_packet = -2; SELECT @@session.max_allowed_packet; ---Error ER_PARSE_ERROR -SET @@session.max_allowed_packet = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_allowed_packet = 65530.34; --Error ER_VARIABLE_IS_READONLY SET @@session.max_allowed_packet = 10737418241; SELECT @@session.max_allowed_packet; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.max_allowed_packet = test; diff --git a/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test similarity index 97% rename from mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc rename to mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test index 9f3416d2e31..158c21a9489 100644 --- a/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc +++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test @@ -58,7 +58,6 @@ SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = @start_value; SELECT @@global.max_binlog_cache_size = 4294967295; ---echo 'Bug# 34876: Incorrect Default Value is assigned to variable'; --echo '#--------------------FN_DYNVARS_072_03------------------------#' ######################################################################## @@ -75,7 +74,6 @@ SET @@global.max_binlog_cache_size = 4097; SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = 65535; SELECT @@global.max_binlog_cache_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#--------------------FN_DYNVARS_072_04-------------------------#' @@ -99,8 +97,6 @@ SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = 4095; SELECT @@global.max_binlog_cache_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_binlog_cache_size = ON; SELECT @@global.max_binlog_cache_size; diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test deleted file mode 100644 index 51386b1f994..00000000000 --- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/max_binlog_cache_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test deleted file mode 100644 index c7c757341fa..00000000000 --- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/max_binlog_cache_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test index 11d01b5c10f..4d2574a7890 100644 --- a/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test +++ b/mysql-test/suite/sys_vars/t/max_binlog_size_basic.test @@ -45,7 +45,6 @@ SELECT @start_value; SET @@global.max_binlog_size = 5000; SET @@global.max_binlog_size = DEFAULT; SELECT @@global.max_binlog_size; ---echo 'Bug# 34878: This variable has invalid default value as compared to documentation'; --echo '#---------------------FN_DYNVARS_072_02-------------------------#' ############################################### @@ -70,7 +69,6 @@ SET @@global.max_binlog_size = 4097; SELECT @@global.max_binlog_size; SET @@global.max_binlog_size = 65535; SELECT @@global.max_binlog_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#--------------------FN_DYNVARS_072_04-------------------------#' @@ -94,8 +92,6 @@ SELECT @@global.max_binlog_size; SET @@global.max_binlog_size = 4095; SELECT @@global.max_binlog_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_binlog_size = ON; SELECT @@global.max_binlog_size; diff --git a/mysql-test/suite/sys_vars/t/max_connections_basic.test b/mysql-test/suite/sys_vars/t/max_connections_basic.test index ffc964db28f..346f7d8f460 100644 --- a/mysql-test/suite/sys_vars/t/max_connections_basic.test +++ b/mysql-test/suite/sys_vars/t/max_connections_basic.test @@ -46,8 +46,6 @@ SELECT @start_value; SET @@global.max_connections = 5000; SET @@global.max_connections = DEFAULT; SELECT @@global.max_connections; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - --echo '#---------------------FN_DYNVARS_074_02-------------------------#' ############################################### @@ -73,7 +71,6 @@ SET @@global.max_connections = 1; SELECT @@global.max_connections; SET @@global.max_connections = 2; SELECT @@global.max_connections; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#--------------------FN_DYNVARS_074_04-------------------------#' @@ -95,8 +92,6 @@ SELECT @@global.max_connections; SET @@global.max_connections = 100001; SELECT @@global.max_connections; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_connections = ON; SELECT @@global.max_connections; diff --git a/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test b/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test index dc908c8396b..43947500339 100644 --- a/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test +++ b/mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test @@ -51,7 +51,6 @@ SELECT @@global.max_delayed_threads; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_delayed_threads = 1000; ---echo 'Bug# 34882: Valid values are not allowed to assign in this variable'; SET @@session.max_delayed_threads = DEFAULT; SELECT @@session.max_delayed_threads; @@ -77,7 +76,6 @@ SET @@global.max_delayed_threads = 1; SELECT @@global.max_delayed_threads; SET @@global.max_delayed_threads = 1025; SELECT @@global.max_delayed_threads; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; SET @@global.max_delayed_threads = 0; SELECT @@global.max_delayed_threads; @@ -119,24 +117,20 @@ SET @@global.max_delayed_threads = -1; SELECT @@global.max_delayed_threads; SET @@global.max_delayed_threads = 16385; SELECT @@global.max_delayed_threads; ---Error ER_PARSE_ERROR -SET @@global.max_delayed_threads = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_delayed_threads = 65530.34; SELECT @@global.max_delayed_threads; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_delayed_threads = test; SELECT @@global.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_delayed_threads = 16385; SELECT @@session.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_delayed_threads = -1; SELECT @@session.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_delayed_threads = -2; SELECT @@session.max_delayed_threads; ---Error ER_PARSE_ERROR -SET @@session.max_delayed_threads = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_delayed_threads = 65530.34; SET @@session.max_delayed_threads = 10737418241; SELECT @@session.max_delayed_threads; diff --git a/mysql-test/suite/sys_vars/t/max_error_count_basic.test b/mysql-test/suite/sys_vars/t/max_error_count_basic.test index 2b1e12843cf..987cc1592df 100644 --- a/mysql-test/suite/sys_vars/t/max_error_count_basic.test +++ b/mysql-test/suite/sys_vars/t/max_error_count_basic.test @@ -75,7 +75,6 @@ SET @@global.max_error_count = 1; SELECT @@global.max_error_count; SET @@global.max_error_count = 0; SELECT @@global.max_error_count; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; SET @@global.max_error_count = 65535; SELECT @@global.max_error_count; @@ -110,8 +109,8 @@ SET @@global.max_error_count = 65536; SELECT @@global.max_error_count; SET @@global.max_error_count = 10737418241; SELECT @@global.max_error_count; ---Error ER_PARSE_ERROR -SET @@global.max_error_count = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_error_count = 65530.34; SELECT @@global.max_error_count; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_error_count = test; @@ -123,11 +122,10 @@ SET @@session.max_error_count = 65536; SELECT @@session.max_error_count; SET @@session.max_error_count = -2; SELECT @@session.max_error_count; ---Error ER_PARSE_ERROR -SET @@session.max_error_count = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_error_count = 65530.34; SET @@session.max_error_count = 10737418241; SELECT @@session.max_error_count; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.max_error_count = test; diff --git a/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic.test similarity index 95% rename from mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc rename to mysql-test/suite/sys_vars/t/max_heap_table_size_basic.test index d07ae094cde..4b9c7cf3b8e 100644 --- a/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc +++ b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic.test @@ -81,8 +81,6 @@ SET @@global.max_heap_table_size = 4294967294; SELECT @@global.max_heap_table_size; SET @@global.max_heap_table_size = 4294967295; SELECT @@global.max_heap_table_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - --echo '#--------------------FN_DYNVARS_077_04-------------------------#' ############################################################################# @@ -99,8 +97,6 @@ SET @@session.max_heap_table_size = 4294967294; SELECT @@session.max_heap_table_size; SET @@session.max_heap_table_size = 4294967295; SELECT @@session.max_heap_table_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - --echo '#------------------FN_DYNVARS_077_05-----------------------#' ############################################################## @@ -117,8 +113,8 @@ SET @@global.max_heap_table_size = 16383; SELECT @@global.max_heap_table_size; SET @@global.max_heap_table_size = 4294967296; SELECT @@global.max_heap_table_size; ---Error ER_PARSE_ERROR -SET @@global.max_heap_table_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_heap_table_size = 65530.34; SELECT @@global.max_heap_table_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_heap_table_size = test; @@ -130,11 +126,10 @@ SET @@session.max_heap_table_size = 16383; SELECT @@session.max_heap_table_size; SET @@session.max_heap_table_size = 4294967296; SELECT @@session.max_heap_table_size; ---Error ER_PARSE_ERROR -SET @@session.max_heap_table_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_heap_table_size = 65530.34; SET @@session.max_heap_table_size = 10737418241; SELECT @@session.max_heap_table_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.max_heap_table_size = test; diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test deleted file mode 100644 index 180c41a5ecf..00000000000 --- a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/max_heap_table_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test deleted file mode 100644 index 89d234f5399..00000000000 --- a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/max_heap_table_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test b/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test index d165ddc11fe..3646743a9ae 100644 --- a/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test +++ b/mysql-test/suite/sys_vars/t/max_insert_delayed_threads_basic.test @@ -1,17 +1,17 @@ ############## mysql-test\t\max_insert_delayed_threads_basic.test ############### # # -# Variable Name: max_insert_delayed_threads # +# Variable Name: max_insert_delayed_threads # # Scope: GLOBAL | SESSION # # Access Type: Dynamic # -# Data Type: numeric # -# Default Value: - # -# Range: - # +# Data Type: numeric # +# Default Value: 20 # +# Range: 0-16384 # # # # # # Creation Date: 2008-02-07 # -# Author: Salman # +# Author: Salman # # # -# Description: Test Cases of Dynamic System Variable max_insert_delayed_threads # +# Description: Test Cases of Dynamic System Variable max_insert_delayed_threads # # that checks the behavior of this variable in the following ways# # * Default Value # # * Valid & Invalid values # @@ -26,7 +26,7 @@ --source include/load_sysvars.inc ################################################################## -# START OF max_insert_delayed_threads TESTS # +# START OF max_insert_delayed_threads TESTS # ################################################################## @@ -40,47 +40,42 @@ SET @start_session_value = @@session.max_insert_delayed_threads; SELECT @start_session_value; ---echo '#--------------------FN_DYNVARS_078_01-------------------------#' +--echo '#--------------------FN_DYNVARS_075_01-------------------------#' ################################################################## -# Display the DEFAULT value of max_insert_delayed_threads # +# Display the DEFAULT value of max_insert_delayed_threads # ################################################################## SET @@global.max_insert_delayed_threads = 1000; ---Error ER_NO_DEFAULT SET @@global.max_insert_delayed_threads = DEFAULT; SELECT @@global.max_insert_delayed_threads; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_insert_delayed_threads = 1000; SET @@session.max_insert_delayed_threads = DEFAULT; SELECT @@session.max_insert_delayed_threads; ---echo '#--------------------FN_DYNVARS_078_02-------------------------#' +--echo '#--------------------FN_DYNVARS_075_02-------------------------#' ################################################################## -# Check the DEFAULT value of max_insert_delayed_threads # +# Check the DEFAULT value of max_insert_delayed_threads # ################################################################## ---Error ER_NO_DEFAULT SET @@global.max_insert_delayed_threads = DEFAULT; SELECT @@global.max_insert_delayed_threads = 20; SET @@session.max_insert_delayed_threads = DEFAULT; SELECT @@session.max_insert_delayed_threads = 20; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; ---echo '#--------------------FN_DYNVARS_078_03-------------------------#' -###############################################################$$$$$$$$############# +--echo '#--------------------FN_DYNVARS_075_03-------------------------#' +############################################################################ # Change the value of max_insert_delayed_threads to a valid value for GLOBAL Scope # -###############################################################$$$$$$$$############# +############################################################################ SET @@global.max_insert_delayed_threads = 1; SELECT @@global.max_insert_delayed_threads; SET @@global.max_insert_delayed_threads = 1025; SELECT @@global.max_insert_delayed_threads; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - SET @@global.max_insert_delayed_threads = 0; SELECT @@global.max_insert_delayed_threads; SET @@global.max_insert_delayed_threads = 16384; @@ -88,10 +83,10 @@ SELECT @@global.max_insert_delayed_threads; SET @@global.max_insert_delayed_threads = 16383; SELECT @@global.max_insert_delayed_threads; ---echo '#--------------------FN_DYNVARS_078_04-------------------------#' -##################################################################################### +--echo '#--------------------FN_DYNVARS_075_04-------------------------#' +############################################################################# # Change the value of max_insert_delayed_threads to a valid value for SESSION Scope # -##################################################################################### +############################################################################# --Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_insert_delayed_threads = 1; @@ -99,7 +94,7 @@ SELECT @@session.max_insert_delayed_threads; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_insert_delayed_threads = 1025; SELECT @@session.max_insert_delayed_threads; - + SET @@session.max_insert_delayed_threads = 0; SELECT @@session.max_insert_delayed_threads; --Error ER_WRONG_VALUE_FOR_VAR @@ -110,10 +105,10 @@ SET @@session.max_insert_delayed_threads = 16383; SELECT @@session.max_insert_delayed_threads; ---echo '#------------------FN_DYNVARS_078_05-----------------------#' -###################################################################### +--echo '#------------------FN_DYNVARS_075_05-----------------------#' +############################################################## # Change the value of max_insert_delayed_threads to an invalid value # -###################################################################### +############################################################## SET @@global.max_insert_delayed_threads = -1024; SELECT @@global.max_insert_delayed_threads; @@ -121,24 +116,20 @@ SET @@global.max_insert_delayed_threads = -1; SELECT @@global.max_insert_delayed_threads; SET @@global.max_insert_delayed_threads = 16385; SELECT @@global.max_insert_delayed_threads; ---Error ER_PARSE_ERROR -SET @@global.max_insert_delayed_threads = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_insert_delayed_threads = 65530.34; SELECT @@global.max_insert_delayed_threads; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_insert_delayed_threads = test; SELECT @@global.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_insert_delayed_threads = 16385; SELECT @@session.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_insert_delayed_threads = -1; SELECT @@session.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR SET @@session.max_insert_delayed_threads = -2; SELECT @@session.max_insert_delayed_threads; ---Error ER_PARSE_ERROR -SET @@session.max_insert_delayed_threads = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_insert_delayed_threads = 65530.34; SET @@session.max_insert_delayed_threads = 10737418241; SELECT @@session.max_insert_delayed_threads; @@ -148,7 +139,7 @@ SET @@session.max_insert_delayed_threads = test; SELECT @@session.max_insert_delayed_threads; ---echo '#------------------FN_DYNVARS_078_06-----------------------#' +--echo '#------------------FN_DYNVARS_075_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # #################################################################### @@ -158,7 +149,7 @@ SELECT @@global.max_insert_delayed_threads = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='max_insert_delayed_threads'; ---echo '#------------------FN_DYNVARS_078_07-----------------------#' +--echo '#------------------FN_DYNVARS_075_07-----------------------#' #################################################################### # Check if the value in SESSION Table matches value in variable # #################################################################### @@ -168,7 +159,7 @@ FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='max_insert_delayed_threads'; ---echo '#------------------FN_DYNVARS_078_08-----------------------#' +--echo '#------------------FN_DYNVARS_075_08-----------------------#' #################################################################### # Check if TRUE and FALSE values can be used on variable # #################################################################### @@ -179,7 +170,7 @@ SET @@global.max_insert_delayed_threads = FALSE; SELECT @@global.max_insert_delayed_threads; ---echo '#---------------------FN_DYNVARS_078_09----------------------#' +--echo '#---------------------FN_DYNVARS_001_09----------------------#' ################################################################################# # Check if accessing variable with and without GLOBAL point to same variable # ################################################################################# @@ -188,7 +179,7 @@ SET @@global.max_insert_delayed_threads = 2048; SELECT @@max_insert_delayed_threads = @@global.max_insert_delayed_threads; ---echo '#---------------------FN_DYNVARS_078_10----------------------#' +--echo '#---------------------FN_DYNVARS_001_10----------------------#' ######################################################################################################## # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # ######################################################################################################## @@ -199,10 +190,10 @@ SELECT @@max_insert_delayed_threads = @@local.max_insert_delayed_threads; SELECT @@local.max_insert_delayed_threads = @@session.max_insert_delayed_threads; ---echo '#---------------------FN_DYNVARS_078_11----------------------#' -##################################################################################### +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +############################################################################# # Check if max_insert_delayed_threads can be accessed with and without @@ sign # -##################################################################################### +############################################################################# --Error ER_WRONG_VALUE_FOR_VAR SET max_insert_delayed_threads = 1024; @@ -225,7 +216,7 @@ SET @@session.max_insert_delayed_threads = @start_session_value; SELECT @@session.max_insert_delayed_threads; -############################################################### +####################################################### # END OF max_insert_delayed_threads TESTS # -############################################################### +####################################################### diff --git a/mysql-test/suite/sys_vars/t/max_join_size_basic.test b/mysql-test/suite/sys_vars/t/max_join_size_basic.test new file mode 100644 index 00000000000..7566ab11520 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_join_size_basic.test @@ -0,0 +1,42 @@ +SET @start_global_value = @@global.max_join_size; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.max_join_size; +select @@session.max_join_size; +show global variables like 'max_join_size'; +show session variables like 'max_join_size'; +select * from information_schema.global_variables where variable_name='max_join_size'; +select * from information_schema.session_variables where variable_name='max_join_size'; + +# +# show that it's writable +# +set global max_join_size=10; +select @@global.max_join_size; +set session max_join_size=20; +select @@session.max_join_size; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global max_join_size=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global max_join_size=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global max_join_size="foo"; + +# +# affects OPTION_BIG_SELECTS +# +select @@sql_big_selects; +set max_join_size=cast(-1 as unsigned int); +select @@sql_big_selects; +set max_join_size=100; +select @@sql_big_selects; + +SET @@global.max_join_size = @start_global_value; +SELECT @@global.max_join_size; diff --git a/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test b/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test index 682e14146d7..167c2052d11 100644 --- a/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test +++ b/mysql-test/suite/sys_vars/t/max_length_for_sort_data_basic.test @@ -118,8 +118,8 @@ SET @@global.max_length_for_sort_data = 8388609; SELECT @@global.max_length_for_sort_data; SET @@global.max_length_for_sort_data = 0; SELECT @@global.max_length_for_sort_data; ---Error ER_PARSE_ERROR -SET @@global.max_length_for_sort_data = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_length_for_sort_data = 65530.34; SELECT @@global.max_length_for_sort_data; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_length_for_sort_data = test; @@ -133,8 +133,8 @@ SET @@session.max_length_for_sort_data = 3; SELECT @@session.max_length_for_sort_data; SET @@session.max_length_for_sort_data = 0; SELECT @@session.max_length_for_sort_data; ---Error ER_PARSE_ERROR -SET @@session.max_length_for_sort_data = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_length_for_sort_data = 65530.34; SET @@session.max_length_for_sort_data = 10737418241; SELECT @@session.max_length_for_sort_data; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test index 2206a388abb..5bf5d9c8834 100644 --- a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test +++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_basic.test @@ -97,8 +97,6 @@ SELECT @@global.max_prepared_stmt_count; SET @@global.max_prepared_stmt_count = 104857612; SELECT @@global.max_prepared_stmt_count; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_prepared_stmt_count = ON; SELECT @@global.max_prepared_stmt_count; diff --git a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test index b780aa2b444..e39778baca8 100644 --- a/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test +++ b/mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test @@ -56,8 +56,6 @@ SELECT @@global.max_relay_log_size; SET @@global.max_relay_log_size = @start_value; SELECT @@global.max_relay_log_size = 1024; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - --echo '#--------------------FN_DYNVARS_082_03------------------------#' ##################################################################### @@ -74,7 +72,6 @@ SET @@global.max_relay_log_size = 1073741823; SELECT @@global.max_relay_log_size; SET @@global.max_relay_log_size = 65535; SELECT @@global.max_relay_log_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; --echo '#--------------------FN_DYNVARS_082_04-------------------------#' ######################################################################## @@ -95,8 +92,6 @@ SELECT @@global.max_relay_log_size; SET @@global.max_relay_log_size = 10737418241; SELECT @@global.max_relay_log_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_relay_log_size = ON; SELECT @@global.max_relay_log_size; diff --git a/mysql-test/suite/sys_vars/t/max_sort_length_basic.test b/mysql-test/suite/sys_vars/t/max_sort_length_basic.test index 1198d7b1851..9c3b88d3c3c 100644 --- a/mysql-test/suite/sys_vars/t/max_sort_length_basic.test +++ b/mysql-test/suite/sys_vars/t/max_sort_length_basic.test @@ -119,8 +119,8 @@ SET @@global.max_sort_length = 8388609; SELECT @@global.max_sort_length; SET @@global.max_sort_length = 0; SELECT @@global.max_sort_length; ---Error ER_PARSE_ERROR -SET @@global.max_sort_length = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_sort_length = 65530.34; SELECT @@global.max_sort_length; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_sort_length = test; @@ -134,8 +134,8 @@ SET @@session.max_sort_length = 3; SELECT @@session.max_sort_length; SET @@session.max_sort_length = 0; SELECT @@session.max_sort_length; ---Error ER_PARSE_ERROR -SET @@session.max_sort_length = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_sort_length = 65530.34; SET @@session.max_sort_length = 10737418241; SELECT @@session.max_sort_length; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test index 8089951c8a2..1d3d69548f8 100644 --- a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test +++ b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_basic.test @@ -119,8 +119,8 @@ SET @@global.max_sp_recursion_depth = -1; SELECT @@global.max_sp_recursion_depth; SET @@global.max_sp_recursion_depth = 3000; SELECT @@global.max_sp_recursion_depth; ---Error ER_PARSE_ERROR -SET @@global.max_sp_recursion_depth = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_sp_recursion_depth = 65530.34; SELECT @@global.max_sp_recursion_depth; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_sp_recursion_depth = test; @@ -134,8 +134,8 @@ SET @@session.max_sp_recursion_depth = 500000; SELECT @@session.max_sp_recursion_depth; SET @@session.max_sp_recursion_depth = -001; SELECT @@session.max_sp_recursion_depth; ---Error ER_PARSE_ERROR -SET @@session.max_sp_recursion_depth = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_sp_recursion_depth = 65530.34; SET @@session.max_sp_recursion_depth = 10737418241; SELECT @@session.max_sp_recursion_depth; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/t/max_user_connections_basic.test b/mysql-test/suite/sys_vars/t/max_user_connections_basic.test index eb231bd8076..1adcc012bc4 100644 --- a/mysql-test/suite/sys_vars/t/max_user_connections_basic.test +++ b/mysql-test/suite/sys_vars/t/max_user_connections_basic.test @@ -49,12 +49,8 @@ SET @@global.max_user_connections = 1000; SET @@global.max_user_connections = DEFAULT; SELECT @@global.max_user_connections; ---Error ER_GLOBAL_VARIABLE +--Error ER_VARIABLE_IS_READONLY SET @@session.max_user_connections = 1000; ---Error ER_NO_DEFAULT -SET @@session.max_user_connections = DEFAULT; -SELECT @@session.max_user_connections; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --echo '#--------------------FN_DYNVARS_087_02-------------------------#' @@ -65,10 +61,9 @@ SELECT @@session.max_user_connections; SET @@global.max_user_connections = DEFAULT; SELECT @@global.max_user_connections = 0; ---Error ER_NO_DEFAULT +--Error ER_VARIABLE_IS_READONLY SET @@session.max_user_connections = DEFAULT; -SELECT @@session.max_user_connections = 0; - +SELECT @@session.max_user_connections; --echo '#--------------------FN_DYNVARS_087_03-------------------------#' @@ -102,8 +97,8 @@ SET @@global.max_user_connections = -1; SELECT @@global.max_user_connections; SET @@global.max_user_connections = 429496729500; SELECT @@global.max_user_connections; ---Error ER_PARSE_ERROR -SET @@global.max_user_connections = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_user_connections = 65530.34; SELECT @@global.max_user_connections; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_user_connections = test; diff --git a/mysql-test/suite/sys_vars/t/maximum_basic-master.opt b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt new file mode 100644 index 00000000000..b6e5666f4fb --- /dev/null +++ b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt @@ -0,0 +1,3 @@ +--maximum-auto-increment-increment=8192 +--maximum-tmp-table-size=8192 +--maximum-max-join-size=8192 diff --git a/mysql-test/suite/sys_vars/t/maximum_basic.test b/mysql-test/suite/sys_vars/t/maximum_basic.test new file mode 100644 index 00000000000..9961f65883a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/maximum_basic.test @@ -0,0 +1,20 @@ +# +# test for --maximum- my_getopt prefix +# + +# +# ulong +# +SET @@session.auto_increment_increment=40960; +SELECT @@session.auto_increment_increment; +# +# ulonglong +# +SET @@session.tmp_table_size=40960; +SELECT @@session.tmp_table_size; +# +# ha_rows +# +SET @@session.max_join_size=40960; +SELECT @@session.max_join_size; + diff --git a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test index d151c6000b8..bd1992500d3 100644 --- a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_basic.test @@ -101,16 +101,13 @@ SET @@global.myisam_data_pointer_size = 1; SELECT @@global.myisam_data_pointer_size; SET @@global.myisam_data_pointer_size = 4294967296; SELECT @@global.myisam_data_pointer_size; ---Error ER_PARSE_ERROR -SET @@global.myisam_data_pointer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_data_pointer_size = 65530.34; SELECT @@global.myisam_data_pointer_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_data_pointer_size = two; SELECT @@global.myisam_data_pointer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - --echo '#------------------FN_DYNVARS_093_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # diff --git a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test index 37dd3a5a297..6f1a50cf64e 100644 --- a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test +++ b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test @@ -19,6 +19,8 @@ # # ################################################################################ +call mtr.add_suppression("The table 't1' is full"); + --echo '#--------------------FN_DYNVARS_093_01-------------------------#' ############################################################################### # Check if setting myisam_data_pointer_size is changed in every new connection# diff --git a/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test new file mode 100644 index 00000000000..ac887711514 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.myisam_mmap_size; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.myisam_mmap_size; +show global variables like 'myisam_mmap_size'; +show session variables like 'myisam_mmap_size'; +select * from information_schema.global_variables where variable_name='myisam_mmap_size'; +select * from information_schema.session_variables where variable_name='myisam_mmap_size'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global myisam_mmap_size=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session myisam_mmap_size=1; diff --git a/mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test b/mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test new file mode 100644 index 00000000000..4d1b07844b6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_recover_options_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.myisam_recover_options; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.myisam_recover_options; +show global variables like 'myisam_recover_options'; +show session variables like 'myisam_recover_options'; +select * from information_schema.global_variables where variable_name='myisam_recover_options'; +select * from information_schema.session_variables where variable_name='myisam_recover_options'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global myisam_recover_options=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session myisam_recover_options=1; diff --git a/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test index 0045842269b..f70431b5580 100644 --- a/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test +++ b/mysql-test/suite/sys_vars/t/myisam_stats_method_basic.test @@ -154,30 +154,8 @@ SELECT @@global.myisam_stats_method; # use of decimal values +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_stats_method = 0.4; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 1.0; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 1.1; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 1.5; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 2.49; -SELECT @@global.myisam_stats_method; - -SET @@session.myisam_stats_method = 0.5; -SELECT @@session.myisam_stats_method; - -SET @@session.myisam_stats_method = 1.6; -SELECT @@session.myisam_stats_method; - - ---echo 'Bug# 34877: Decimal values can be used within the range [0.0-2.5). Values'; ---echo 'are rounded to 0,1,2 as evident from outcome.'; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.myisam_stats_method = 3; diff --git a/mysql-test/suite/sys_vars/t/named_pipe_basic.test b/mysql-test/suite/sys_vars/t/named_pipe_basic.test new file mode 100644 index 00000000000..f3b83a71974 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/named_pipe_basic.test @@ -0,0 +1,19 @@ +--source include/windows.inc +# +# only global +# +select @@global.named_pipe; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.named_pipe; +show global variables like 'named_pipe'; +show session variables like 'named_pipe'; +select * from information_schema.global_variables where variable_name='named_pipe'; +select * from information_schema.session_variables where variable_name='named_pipe'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global named_pipe=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session named_pipe=1; diff --git a/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test b/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test index 6e1e0559c61..b8336910021 100644 --- a/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test +++ b/mysql-test/suite/sys_vars/t/net_buffer_length_basic.test @@ -57,7 +57,7 @@ SELECT @@global.net_buffer_length; --Error ER_VARIABLE_IS_READONLY SET @@session.net_buffer_length = 20000; ---Error ER_NO_DEFAULT +--Error ER_VARIABLE_IS_READONLY SET @@session.net_buffer_length = DEFAULT; SELECT @@session.net_buffer_length; @@ -86,15 +86,13 @@ SET @@global.net_buffer_length = 1048575; SELECT @@global.net_buffer_length; SET @@global.net_buffer_length = 65535; SELECT @@global.net_buffer_length; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - --echo '#--------------------FN_DYNVARS_109_04-------------------------#' ############################################################################ # Change the value of net_buffer_length to a valid value for SESSION Scope # ############################################################################ -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped +# SESSION net_buffer_length is now read-only; assignments skipped --echo '#------------------FN_DYNVARS_109_05-----------------------#' @@ -112,16 +110,14 @@ SET @@global.net_buffer_length = 1048577; SELECT @@global.net_buffer_length; SET @@global.net_buffer_length = 104857633; SELECT @@global.net_buffer_length; ---Error ER_PARSE_ERROR -SET @@global.net_buffer_length = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.net_buffer_length = 65530.34; SELECT @@global.net_buffer_length; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.net_buffer_length = test; SELECT @@global.net_buffer_length; -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +# SESSION net_buffer_length is now read-only; assignments skipped --Error ER_WRONG_TYPE_FOR_VAR SET @@session.net_buffer_length = test; @@ -173,7 +169,7 @@ SELECT @@net_buffer_length = @@global.net_buffer_length; # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # ######################################################################################################## -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped +# SESSION net_buffer_length is now read-only; assignments skipped --echo '#---------------------FN_DYNVARS_109_11----------------------#' @@ -181,7 +177,7 @@ SELECT @@net_buffer_length = @@global.net_buffer_length; # Check if net_buffer_length can be accessed with and without @@ sign # ############################################################################ -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped +# SESSION net_buffer_length is now read-only; assignments skipped SELECT @@net_buffer_length; --Error ER_UNKNOWN_TABLE SELECT local.net_buffer_length; diff --git a/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test b/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test index f0d32302e4f..0eb78e412e3 100644 --- a/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/net_read_timeout_basic.test @@ -104,8 +104,8 @@ SET @@global.net_read_timeout = -1024; SELECT @@global.net_read_timeout; SET @@global.net_read_timeout = 655360354; SELECT @@global.net_read_timeout; ---Error ER_PARSE_ERROR -SET @@global.net_read_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.net_read_timeout = 65530.34; SELECT @@global.net_read_timeout; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.net_read_timeout = test; @@ -115,11 +115,10 @@ SET @@session.net_read_timeout = 0; SELECT @@session.net_read_timeout; SET @@session.net_read_timeout = -2; SELECT @@session.net_read_timeout; ---Error ER_PARSE_ERROR -SET @@session.net_read_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.net_read_timeout = 65530.34; SET @@session.net_read_timeout = 6555015425; SELECT @@session.net_read_timeout; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.net_read_timeout = test; diff --git a/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test b/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test index 84c682561e3..bd8a8b0530d 100644 --- a/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/net_write_timeout_basic.test @@ -104,8 +104,8 @@ SET @@global.net_write_timeout = -1024; SELECT @@global.net_write_timeout; SET @@global.net_write_timeout = 655360354; SELECT @@global.net_write_timeout; ---Error ER_PARSE_ERROR -SET @@global.net_write_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.net_write_timeout = 65530.34; SELECT @@global.net_write_timeout; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.net_write_timeout = test; @@ -115,11 +115,10 @@ SET @@session.net_write_timeout = 0; SELECT @@session.net_write_timeout; SET @@session.net_write_timeout = -2; SELECT @@session.net_write_timeout; ---Error ER_PARSE_ERROR -SET @@session.net_write_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.net_write_timeout = 65530.34; SET @@session.net_write_timeout = 6555015425; SELECT @@session.net_write_timeout; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.net_write_timeout = test; diff --git a/mysql-test/suite/sys_vars/t/new_basic.test b/mysql-test/suite/sys_vars/t/new_basic.test index cf0ba08dfdb..017ba2eb264 100644 --- a/mysql-test/suite/sys_vars/t/new_basic.test +++ b/mysql-test/suite/sys_vars/t/new_basic.test @@ -121,7 +121,7 @@ SET @@global.new = FELSE; SET @@global.new = -1024; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.new = 65536; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.new = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.new = test; @@ -130,17 +130,14 @@ SET @@global.new = test; SET @@session.new = ONN; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.new = ONF; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.new = OF; -SELECT @@session.new; ---echo 'Bug# 34828: FN_DYNVARS_113_05 - OF is also working as OFF and no error is coming'; - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.new = 'OFN'; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.new = -2; ---Error ER_PARSE_ERROR -SET @@session.new = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.new = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.new = 65550; diff --git a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test new file mode 100644 index 00000000000..32d0f45ad25 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test @@ -0,0 +1,33 @@ +SET @start_global_value = @@global.old_alter_table; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.old_alter_table; +select @@session.old_alter_table; +show global variables like 'old_alter_table'; +show session variables like 'old_alter_table'; +select * from information_schema.global_variables where variable_name='old_alter_table'; +select * from information_schema.session_variables where variable_name='old_alter_table'; + +# +# show that it's writable +# +set global old_alter_table=1; +select @@global.old_alter_table; +set session old_alter_table=ON; +select @@session.old_alter_table; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global old_alter_table=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global old_alter_table=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global old_alter_table="foo"; + +SET @@global.old_alter_table = @start_global_value; +SELECT @@global.old_alter_table; diff --git a/mysql-test/suite/sys_vars/t/old_basic.test b/mysql-test/suite/sys_vars/t/old_basic.test new file mode 100644 index 00000000000..2c123d17165 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/old_basic.test @@ -0,0 +1,19 @@ +# +# show the global and session values; +# +select @@global.old; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.old; +show global variables like 'old'; +show session variables like 'old'; +select * from information_schema.global_variables where variable_name='old'; +select * from information_schema.session_variables where variable_name='old'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global old=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session old=1; + diff --git a/mysql-test/suite/sys_vars/t/old_passwords_basic.test b/mysql-test/suite/sys_vars/t/old_passwords_basic.test index 34a9394a1e7..f4965ad7528 100644 --- a/mysql-test/suite/sys_vars/t/old_passwords_basic.test +++ b/mysql-test/suite/sys_vars/t/old_passwords_basic.test @@ -121,7 +121,7 @@ SET @@global.old_passwords = FELSE; SET @@global.old_passwords = -1024; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.old_passwords = 65536; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.old_passwords = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.old_passwords = test; @@ -130,17 +130,14 @@ SET @@global.old_passwords = test; SET @@session.old_passwords = ONN; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.old_passwords = ONF; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.old_passwords = OF; -SELECT @@session.old_passwords; ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.old_passwords = 'OFN'; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.old_passwords = -2; ---Error ER_PARSE_ERROR -SET @@session.old_passwords = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.old_passwords = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.old_passwords = 65550; diff --git a/mysql-test/suite/sys_vars/t/open_files_limit_basic.test b/mysql-test/suite/sys_vars/t/open_files_limit_basic.test new file mode 100644 index 00000000000..50c0b2d5b6e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/open_files_limit_basic.test @@ -0,0 +1,24 @@ +# +# show the global and session values; +# +--replace_result 3072 1024 16384 1024 +select @@global.open_files_limit; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.open_files_limit; +--replace_result 3072 1024 16384 1024 +show global variables like 'open_files_limit'; +--replace_result 3072 1024 16384 1024 +show session variables like 'open_files_limit'; +--replace_result 3072 1024 16384 1024 +select * from information_schema.global_variables where variable_name='open_files_limit'; +--replace_result 3072 1024 16384 1024 +select * from information_schema.session_variables where variable_name='open_files_limit'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global open_files_limit=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session open_files_limit=1; + diff --git a/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test b/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test index 58c074d7d5e..1e3a8bc3d7f 100644 --- a/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test +++ b/mysql-test/suite/sys_vars/t/optimizer_prune_level_basic.test @@ -146,12 +146,11 @@ SET @@session.optimizer_prune_level = OF; SET @@session.optimizer_prune_level = 'OFN'; SET @@session.optimizer_prune_level = -2; SELECT @@session.optimizer_prune_level; ---Error ER_PARSE_ERROR -SET @@session.optimizer_prune_level = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.optimizer_prune_level = 65530.34; SET @@session.optimizer_prune_level = 65550; SELECT @@session.optimizer_prune_level; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.optimizer_prune_level = test; diff --git a/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test b/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test index 42548c59d40..eda7992bbd5 100644 --- a/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test +++ b/mysql-test/suite/sys_vars/t/optimizer_search_depth_basic.test @@ -107,8 +107,8 @@ SET @@global.optimizer_search_depth = -1; SELECT @@global.optimizer_search_depth; SET @@global.optimizer_search_depth = 65536; SELECT @@global.optimizer_search_depth; ---Error ER_PARSE_ERROR -SET @@global.optimizer_search_depth = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.optimizer_search_depth = 65530.34; SELECT @@global.optimizer_search_depth; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.optimizer_search_depth = test; @@ -118,11 +118,10 @@ SET @@session.optimizer_search_depth = 64; SELECT @@session.optimizer_search_depth; SET @@session.optimizer_search_depth = -2; SELECT @@session.optimizer_search_depth; ---Error ER_PARSE_ERROR -SET @@session.optimizer_search_depth = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.optimizer_search_depth = 65530.34; SET @@session.optimizer_search_depth = 65550; SELECT @@session.optimizer_search_depth; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.optimizer_search_depth = test; diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test new file mode 100644 index 00000000000..32a77c90b34 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test @@ -0,0 +1,41 @@ +SET @start_global_value = @@global.optimizer_switch; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.optimizer_switch; +select @@session.optimizer_switch; +show global variables like 'optimizer_switch'; +show session variables like 'optimizer_switch'; +select * from information_schema.global_variables where variable_name='optimizer_switch'; +select * from information_schema.session_variables where variable_name='optimizer_switch'; + +# +# show that it's writable +# +set global optimizer_switch=10; +select @@global.optimizer_switch; +set session optimizer_switch=5; +select @@session.optimizer_switch; +set global optimizer_switch="index_merge_sort_union=on"; +select @@global.optimizer_switch; +set session optimizer_switch="index_merge=off"; +select @@session.optimizer_switch; +set session optimizer_switch="default"; +select @@session.optimizer_switch; + +# +# incorrect assignments +# +--error ER_WRONG_TYPE_FOR_VAR +set global optimizer_switch=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global optimizer_switch=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set session optimizer_switch="index_merge"; +--error ER_WRONG_VALUE_FOR_VAR +set session optimizer_switch="foobar"; + +SET @@global.optimizer_switch = @start_global_value; +SELECT @@global.optimizer_switch; diff --git a/mysql-test/suite/sys_vars/t/pid_file_basic.test b/mysql-test/suite/sys_vars/t/pid_file_basic.test new file mode 100644 index 00000000000..f4253593bc6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pid_file_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select @@global.pid_file; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.pid_file; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +show global variables like 'pid_file'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +show session variables like 'pid_file'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select * from information_schema.global_variables where variable_name='pid_file'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select * from information_schema.session_variables where variable_name='pid_file'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global pid_file=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session pid_file=1; diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test new file mode 100644 index 00000000000..d714950c807 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test @@ -0,0 +1,29 @@ +# +# only global +# + +# +# on windows it's /lib/plugin +# on unix it's /lib/mysql/plugin +# +--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +select @@global.plugin_dir; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.plugin_dir; +--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +show global variables like 'plugin_dir'; +--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +show session variables like 'plugin_dir'; +--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +select * from information_schema.global_variables where variable_name='plugin_dir'; +--replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +select * from information_schema.session_variables where variable_name='plugin_dir'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global plugin_dir=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session plugin_dir=1; + diff --git a/mysql-test/suite/sys_vars/t/port_basic.test b/mysql-test/suite/sys_vars/t/port_basic.test new file mode 100644 index 00000000000..e20ee119f5e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/port_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +--replace_result $MASTER_MYPORT MASTER_MYPORT +select @@global.port; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.port; +--replace_result $MASTER_MYPORT MASTER_MYPORT +show global variables like 'port'; +--replace_result $MASTER_MYPORT MASTER_MYPORT +show session variables like 'port'; +--replace_result $MASTER_MYPORT MASTER_MYPORT +select * from information_schema.global_variables where variable_name='port'; +--replace_result $MASTER_MYPORT MASTER_MYPORT +select * from information_schema.session_variables where variable_name='port'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global port=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session port=1; diff --git a/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test index 48b1e32676a..8eba7bba079 100644 --- a/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/preload_buffer_size_basic.test @@ -112,8 +112,8 @@ SET @@global.preload_buffer_size = 1023; SELECT @@global.preload_buffer_size; SET @@global.preload_buffer_size = 1073741825; SELECT @@global.preload_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.preload_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.preload_buffer_size = 65530.34; SELECT @@global.preload_buffer_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.preload_buffer_size = test; @@ -123,13 +123,12 @@ SET @@session.preload_buffer_size = 64; SELECT @@session.preload_buffer_size; SET @@session.preload_buffer_size = -2; SELECT @@session.preload_buffer_size; ---Error ER_PARSE_ERROR -SET @@session.preload_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.preload_buffer_size = 65530.34; SET @@session.preload_buffer_size = 1023; SELECT @@session.preload_buffer_size; SET @@session.preload_buffer_size = 1073741825; SELECT @@session.preload_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.preload_buffer_size = test; diff --git a/mysql-test/suite/sys_vars/t/profiling_basic.test b/mysql-test/suite/sys_vars/t/profiling_basic.test new file mode 100644 index 00000000000..aef56e50900 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/profiling_basic.test @@ -0,0 +1,35 @@ +--source include/have_profiling.inc + +SET @start_global_value = @@global.profiling; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.profiling; +select @@session.profiling; +show global variables like 'profiling'; +show session variables like 'profiling'; +select * from information_schema.global_variables where variable_name='profiling'; +select * from information_schema.session_variables where variable_name='profiling'; + +# +# show that it's writable +# +set global profiling=1; +select @@global.profiling; +set session profiling=ON; +select @@session.profiling; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global profiling=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global profiling=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global profiling="foo"; + +SET @@global.profiling = @start_global_value; +SELECT @@global.profiling; diff --git a/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test b/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test new file mode 100644 index 00000000000..01d3533be3d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test @@ -0,0 +1,43 @@ +--source include/have_profiling.inc + +SET @start_global_value = @@global.profiling_history_size; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.profiling_history_size; +select @@session.profiling_history_size; +show global variables like 'profiling_history_size'; +show session variables like 'profiling_history_size'; +select * from information_schema.global_variables where variable_name='profiling_history_size'; +select * from information_schema.session_variables where variable_name='profiling_history_size'; + +# +# show that it's writable +# +set global profiling_history_size=10; +select @@global.profiling_history_size; +set session profiling_history_size=20; +select @@session.profiling_history_size; + +# +# incorrect assignments +# +--error ER_WRONG_TYPE_FOR_VAR +set global profiling_history_size=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global profiling_history_size=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global profiling_history_size="foo"; + +# +# min/max +# +set session profiling_history_size=0; +select @@profiling_history_size; +set session profiling_history_size=101; +select @@profiling_history_size; + +SET @@global.profiling_history_size = @start_global_value; +SELECT @@global.profiling_history_size; diff --git a/mysql-test/suite/sys_vars/t/protocol_version_basic.test b/mysql-test/suite/sys_vars/t/protocol_version_basic.test new file mode 100644 index 00000000000..3446932b7e1 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/protocol_version_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.protocol_version; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.protocol_version; +show global variables like 'protocol_version'; +show session variables like 'protocol_version'; +select * from information_schema.global_variables where variable_name='protocol_version'; +select * from information_schema.session_variables where variable_name='protocol_version'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global protocol_version=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session protocol_version=1; diff --git a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test new file mode 100644 index 00000000000..a948f2a8ff0 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test @@ -0,0 +1,32 @@ + +# +# exists as a session only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@global.pseudo_thread_id; +select @@session.pseudo_thread_id=0; +show global variables like 'pseudo_thread_id'; +--replace_column 2 # +show session variables like 'pseudo_thread_id'; +select * from information_schema.global_variables where variable_name='pseudo_thread_id'; +--replace_column 2 # +select * from information_schema.session_variables where variable_name='pseudo_thread_id'; + +# +# show that it's writable +# +set session pseudo_thread_id=1; +select @@session.pseudo_thread_id; +--error ER_LOCAL_VARIABLE +set global pseudo_thread_id=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set session pseudo_thread_id=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set session pseudo_thread_id=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set session pseudo_thread_id="foo"; + diff --git a/mysql-test/suite/sys_vars/t/query_cache_type_basic.test b/mysql-test/suite/sys_vars/t/query_cache_type_basic.test index ba7e26a3065..5c395fde1e6 100644 --- a/mysql-test/suite/sys_vars/t/query_cache_type_basic.test +++ b/mysql-test/suite/sys_vars/t/query_cache_type_basic.test @@ -107,15 +107,10 @@ SET @@global.query_cache_type = -1; SET @@global.query_cache_type = ONDEMAND; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_type = 'ON,OFF'; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_type = 'OF'; -SELECT @@global.query_cache_type; - ---echo 'Bug# 34828: OF is taken as OFF.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_type = YES; - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_type = ' '; @@ -156,30 +151,8 @@ SELECT @@global.query_cache_type; # use of decimal values +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.query_cache_type = 0.4; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 1.0; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 1.1; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 1.5; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 2.49; -SELECT @@global.query_cache_type; - -SET @@session.query_cache_type = 0.5; -SELECT @@session.query_cache_type; - -SET @@session.query_cache_type = 1.6; -SELECT @@session.query_cache_type; - - ---echo 'Bug: Decimal values can be used within the range [0.0-2.5). Values'; ---echo 'are rounded to 0,1,2 as evident from outcome.'; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_type = 3; diff --git a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test index 5acb36961af..055c3629d15 100644 --- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test +++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_basic.test @@ -105,7 +105,7 @@ SELECT @@global.query_cache_wlock_invalidate; # for session --Error ER_WRONG_VALUE_FOR_VAR SET @@session.query_cache_wlock_invalidate = -1; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@session.query_cache_wlock_invalidate = 1.6; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.query_cache_wlock_invalidate = "T"; @@ -115,12 +115,8 @@ SET @@session.query_cache_wlock_invalidate = "Y"; SET @@session.query_cache_wlock_invalidate = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.query_cache_wlock_invalidate = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.query_cache_wlock_invalidate = OF; -SELECT @@session.query_cache_wlock_invalidate; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.query_cache_wlock_invalidate = ÓFF; @@ -138,12 +134,8 @@ SET @@global.query_cache_wlock_invalidate = "Y"; SET @@global.query_cache_wlock_invalidate = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_wlock_invalidate = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_wlock_invalidate = OF; -SELECT @@global.query_cache_wlock_invalidate; - ---echo 'Bug 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.query_cache_wlock_invalidate = ÓFF; diff --git a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test similarity index 98% rename from mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc rename to mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test index 64eb3c4b329..3914bff4ca9 100644 --- a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc +++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test @@ -113,8 +113,8 @@ SELECT @@global.query_prealloc_size ; #SELECT @@global.query_prealloc_size ; ---Error ER_PARSE_ERROR -SET @@global.query_prealloc_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_prealloc_size = 65530.34; SELECT @@global.query_prealloc_size ; --Error ER_WRONG_TYPE_FOR_VAR @@ -140,9 +140,8 @@ SELECT @@session.query_prealloc_size ; #SET @@session.query_prealloc_size = -2; #SELECT @@session.query_prealloc_size ; ---Error ER_PARSE_ERROR - -SET @@session.query_prealloc_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.query_prealloc_size = 65530.34; SELECT @@session.query_prealloc_size ; diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test deleted file mode 100644 index 34dafc71c9c..00000000000 --- a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/query_prealloc_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test deleted file mode 100644 index c1f04c0788c..00000000000 --- a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/query_prealloc_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/rand_seed1_basic.test b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test new file mode 100644 index 00000000000..79c946a3d2f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test @@ -0,0 +1,30 @@ + +# +# exists as a session only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@global.rand_seed1; +select @@session.rand_seed1; +show global variables like 'rand_seed1'; +show session variables like 'rand_seed1'; +select * from information_schema.global_variables where variable_name='rand_seed1'; +select * from information_schema.session_variables where variable_name='rand_seed1'; + +# +# show that it's writable +# +set session rand_seed1=1; +select @@session.rand_seed1; +--error ER_LOCAL_VARIABLE +set global rand_seed1=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set session rand_seed1=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set session rand_seed1=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set session rand_seed1="foo"; + diff --git a/mysql-test/suite/sys_vars/t/rand_seed2_basic.test b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test new file mode 100644 index 00000000000..18e2a62557c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test @@ -0,0 +1,30 @@ + +# +# exists as a session only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@global.rand_seed2; +select @@session.rand_seed2; +show global variables like 'rand_seed2'; +show session variables like 'rand_seed2'; +select * from information_schema.global_variables where variable_name='rand_seed2'; +select * from information_schema.session_variables where variable_name='rand_seed2'; + +# +# show that it's writable +# +set session rand_seed2=1; +select @@session.rand_seed2; +--error ER_LOCAL_VARIABLE +set global rand_seed2=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set session rand_seed2=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set session rand_seed2=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set session rand_seed2="foo"; + diff --git a/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test index 405bb9da6d8..8ce826bf327 100644 --- a/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/read_buffer_size_basic.test @@ -72,9 +72,9 @@ SELECT @@session.read_buffer_size = 131072; ################################################################################ SET @@global.read_buffer_size = 8201; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; +SELECT @@global.read_buffer_size; SET @@global.read_buffer_size = 8200; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; +SELECT @@global.read_buffer_size; SET @@global.read_buffer_size = 2147479552; SELECT @@global.read_buffer_size; SET @@global.read_buffer_size = 2147479551; @@ -86,9 +86,9 @@ SELECT @@global.read_buffer_size; ################################################################################### SET @@session.read_buffer_size = 8200; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; +SELECT @@session.read_buffer_size; SET @@session.read_buffer_size = 8201; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; +SELECT @@session.read_buffer_size; SET @@session.read_buffer_size = 2147479552; SELECT @@session.read_buffer_size; SET @@session.read_buffer_size = 2147479551; @@ -101,27 +101,26 @@ SELECT @@session.read_buffer_size; ################################################################## SET @@global.read_buffer_size = 8199; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; +SELECT @@global.read_buffer_size; SET @@global.read_buffer_size = -1024; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; +SELECT @@global.read_buffer_size; SET @@global.read_buffer_size = 2147479553; SELECT @@global.read_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.read_buffer_size = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.read_buffer_size = 65530.34; SELECT @@global.read_buffer_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.read_buffer_size = test; SELECT @@global.read_buffer_size; SET @@session.read_buffer_size = 8199; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; +SELECT @@session.read_buffer_size; SET @@session.read_buffer_size = -2; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; ---Error ER_PARSE_ERROR -SET @@session.read_buffer_size = 65530.34.; +SELECT @@session.read_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.read_buffer_size = 65530.34; SET @@session.read_buffer_size = 2147479553; SELECT @@session.read_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.read_buffer_size = test; @@ -154,11 +153,9 @@ WHERE VARIABLE_NAME='read_buffer_size'; #################################################################### SET @@global.read_buffer_size = TRUE; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; +SELECT @@global.read_buffer_size; SET @@global.read_buffer_size = FALSE; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; -echo 'Bug: FN_DYNVARS_138_08- Errors are not coming on assigning TRUE/FALSE to variable'; - +SELECT @@global.read_buffer_size; --echo '#---------------------FN_DYNVARS_138_09----------------------#' #################################################################################### @@ -185,7 +182,7 @@ SELECT @@local.read_buffer_size = @@session.read_buffer_size; ################################################################################### SET read_buffer_size = 9100; -SELECT @@read_buffer_size= 8200 OR @@read_buffer_size= 8228 ; +SELECT @@read_buffer_size; --Error ER_UNKNOWN_TABLE SELECT local.read_buffer_size; --Error ER_UNKNOWN_TABLE diff --git a/mysql-test/suite/sys_vars/t/read_only_basic.test b/mysql-test/suite/sys_vars/t/read_only_basic.test index 9d8078b8c68..0f77e983f92 100644 --- a/mysql-test/suite/sys_vars/t/read_only_basic.test +++ b/mysql-test/suite/sys_vars/t/read_only_basic.test @@ -90,7 +90,7 @@ SELECT @@global.read_only; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.read_only = 10240022115; SELECT @@global.read_only; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.read_only = 10000.01; SELECT @@global.read_only; --Error ER_WRONG_VALUE_FOR_VAR @@ -99,7 +99,6 @@ SELECT @@global.read_only; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.read_only = 42949672950; SELECT @@global.read_only; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.read_only = 'test'; diff --git a/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test index e3d2a4b89f7..f883a1bed3f 100644 --- a/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/read_rnd_buffer_size_basic.test @@ -54,35 +54,19 @@ SET @@session.read_rnd_buffer_size = 2000; SET @@session.read_rnd_buffer_size = DEFAULT; SELECT @@session.read_rnd_buffer_size; - ---echo '#--------------------FN_DYNVARS_140_02-------------------------#' -###################################################################### -# Check the DEFAULT value of read_rnd_buffer_size # -###################################################################### - -SET @@global.read_rnd_buffer_size = DEFAULT; -SELECT @@global.read_rnd_buffer_size = 262144; - -SET @@session.read_rnd_buffer_size = DEFAULT; -SELECT @@session.read_rnd_buffer_size = 262144; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - - --echo '#--------------------FN_DYNVARS_140_03-------------------------#' ################################################################################ # Change the value of read_rnd_buffer_size to a valid value for GLOBAL Scope # ################################################################################ SET @@global.read_rnd_buffer_size = 8201; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; +SELECT @@global.read_rnd_buffer_size; SET @@global.read_rnd_buffer_size = 8200; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; +SELECT @@global.read_rnd_buffer_size; SET @@global.read_rnd_buffer_size = 2147479552; SELECT @@global.read_rnd_buffer_size; SET @@global.read_rnd_buffer_size = 2147479551; SELECT @@global.read_rnd_buffer_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - --echo '#--------------------FN_DYNVARS_140_04-------------------------#' ################################################################################### @@ -90,9 +74,9 @@ SELECT @@global.read_rnd_buffer_size; ################################################################################### SET @@session.read_rnd_buffer_size = 8200; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; +SELECT @@session.read_rnd_buffer_size; SET @@session.read_rnd_buffer_size = 8201; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; +SELECT @@session.read_rnd_buffer_size; SET @@session.read_rnd_buffer_size = 2147479552; SELECT @@session.read_rnd_buffer_size; SET @@session.read_rnd_buffer_size = 2147479551; @@ -105,32 +89,24 @@ SELECT @@session.read_rnd_buffer_size; ################################################################## SET @@global.read_rnd_buffer_size = 8199; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; +SELECT @@global.read_rnd_buffer_size; SET @@global.read_rnd_buffer_size = -1024; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; +SELECT @@global.read_rnd_buffer_size; SET @@global.read_rnd_buffer_size = 2147479553; SELECT @@global.read_rnd_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.read_rnd_buffer_size = 65530.34.; -SELECT @@global.read_rnd_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.read_rnd_buffer_size = 65530.34; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.read_rnd_buffer_size = test; -SELECT @@global.read_rnd_buffer_size; SET @@session.read_rnd_buffer_size = 8199; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; -SET @@session.read_rnd_buffer_size = -2; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; ---Error ER_PARSE_ERROR -SET @@session.read_rnd_buffer_size = 65530.34.; -SET @@session.read_rnd_buffer_size = 2147479553; SELECT @@session.read_rnd_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - +SET @@session.read_rnd_buffer_size = -2; +SELECT @@session.read_rnd_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.read_rnd_buffer_size = 65530.34; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.read_rnd_buffer_size = test; -SELECT @@session.read_rnd_buffer_size; - --echo '#------------------FN_DYNVARS_140_06-----------------------#' #################################################################### @@ -155,9 +131,9 @@ VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='re #################################################################### SET @@global.read_rnd_buffer_size = TRUE; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; +SELECT @@global.read_rnd_buffer_size; SET @@global.read_rnd_buffer_size = FALSE; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; +SELECT @@global.read_rnd_buffer_size; --echo '#---------------------FN_DYNVARS_140_09----------------------#' @@ -185,7 +161,7 @@ SELECT @@local.read_rnd_buffer_size = @@session.read_rnd_buffer_size; ################################################################################### SET read_rnd_buffer_size = 9100; -SELECT @@read_rnd_buffer_size= 8200 OR @@read_rnd_buffer_size= 8228; +SELECT @@read_rnd_buffer_size; --Error ER_UNKNOWN_TABLE SELECT local.read_rnd_buffer_size; --Error ER_UNKNOWN_TABLE diff --git a/mysql-test/suite/sys_vars/t/relay_log_basic.test b/mysql-test/suite/sys_vars/t/relay_log_basic.test new file mode 100644 index 00000000000..1ea60577556 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/relay_log_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.relay_log; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.relay_log; +show global variables like 'relay_log'; +show session variables like 'relay_log'; +select * from information_schema.global_variables where variable_name='relay_log'; +select * from information_schema.session_variables where variable_name='relay_log'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global relay_log=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session relay_log=1; diff --git a/mysql-test/suite/sys_vars/t/relay_log_index_basic.test b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test new file mode 100644 index 00000000000..fa69d978016 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.relay_log_index; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.relay_log_index; +show global variables like 'relay_log_index'; +show session variables like 'relay_log_index'; +select * from information_schema.global_variables where variable_name='relay_log_index'; +select * from information_schema.session_variables where variable_name='relay_log_index'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global relay_log_index=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session relay_log_index=1; diff --git a/mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test b/mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test new file mode 100644 index 00000000000..4709b8e3e47 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/relay_log_info_file_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.relay_log_info_file; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.relay_log_info_file; +show global variables like 'relay_log_info_file'; +show session variables like 'relay_log_info_file'; +select * from information_schema.global_variables where variable_name='relay_log_info_file'; +select * from information_schema.session_variables where variable_name='relay_log_info_file'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global relay_log_info_file=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session relay_log_info_file=1; diff --git a/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test b/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test new file mode 100644 index 00000000000..57c28468bd1 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test @@ -0,0 +1,39 @@ +--source include/not_embedded.inc + +SET @start_global_value = @@global.relay_log_recovery; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.relay_log_recovery; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.relay_log_recovery; +show global variables like 'relay_log_recovery'; +show session variables like 'relay_log_recovery'; +select * from information_schema.global_variables where variable_name='relay_log_recovery'; +select * from information_schema.session_variables where variable_name='relay_log_recovery'; + +# +# show that it's writable +# +set global relay_log_recovery=1; +select @@global.relay_log_recovery; +set global relay_log_recovery=OFF; +select @@global.relay_log_recovery; +--error ER_GLOBAL_VARIABLE +set session relay_log_recovery=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global relay_log_recovery=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global relay_log_recovery=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global relay_log_recovery="foo"; + +SET @@global.relay_log_recovery = @start_global_value; +SELECT @@global.relay_log_recovery; + diff --git a/mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test b/mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test new file mode 100644 index 00000000000..99c9fb37493 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/relay_log_space_limit_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.relay_log_space_limit; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.relay_log_space_limit; +show global variables like 'relay_log_space_limit'; +show session variables like 'relay_log_space_limit'; +select * from information_schema.global_variables where variable_name='relay_log_space_limit'; +select * from information_schema.session_variables where variable_name='relay_log_space_limit'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global relay_log_space_limit=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session relay_log_space_limit=1; diff --git a/mysql-test/suite/sys_vars/t/report_host_basic.test b/mysql-test/suite/sys_vars/t/report_host_basic.test new file mode 100644 index 00000000000..5565370f88c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/report_host_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.report_host; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.report_host; +show global variables like 'report_host'; +show session variables like 'report_host'; +select * from information_schema.global_variables where variable_name='report_host'; +select * from information_schema.session_variables where variable_name='report_host'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global report_host=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session report_host=1; diff --git a/mysql-test/suite/sys_vars/t/report_password_basic.test b/mysql-test/suite/sys_vars/t/report_password_basic.test new file mode 100644 index 00000000000..ed564cfe2ad --- /dev/null +++ b/mysql-test/suite/sys_vars/t/report_password_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.report_password; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.report_password; +show global variables like 'report_password'; +show session variables like 'report_password'; +select * from information_schema.global_variables where variable_name='report_password'; +select * from information_schema.session_variables where variable_name='report_password'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global report_password=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session report_password=1; diff --git a/mysql-test/suite/sys_vars/t/report_port_basic.test b/mysql-test/suite/sys_vars/t/report_port_basic.test new file mode 100644 index 00000000000..122c92c5446 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/report_port_basic.test @@ -0,0 +1,24 @@ +--source include/not_embedded.inc +# +# only global +# +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +select @@global.report_port; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.report_port; +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +show global variables like 'report_port'; +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +show session variables like 'report_port'; +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +select * from information_schema.global_variables where variable_name='report_port'; +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +select * from information_schema.session_variables where variable_name='report_port'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global report_port=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session report_port=1; diff --git a/mysql-test/suite/sys_vars/t/report_user_basic.test b/mysql-test/suite/sys_vars/t/report_user_basic.test new file mode 100644 index 00000000000..192e6b772b8 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/report_user_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.report_user; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.report_user; +show global variables like 'report_user'; +show session variables like 'report_user'; +select * from information_schema.global_variables where variable_name='report_user'; +select * from information_schema.session_variables where variable_name='report_user'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global report_user=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session report_user=1; 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 f2c66eb3a0a..2a241b58807 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 @@ -39,8 +39,9 @@ SET @start_init_slave= @@global.init_slave; # setting of a global value with an effect on the next start of the slave server # check that @@global.init_slave could be set +SET NAMES utf8; let $my_init_slave= - 'SET @@global.max_connections = @@global.max_connections + 1'; + 'SET @@global.max_connections = @@global.max_connections + 1 -- комментарий'; eval SET @@global.init_slave = $my_init_slave; # show the data type of the variable @@ -49,6 +50,7 @@ DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE t1 AS SELECT @@global.init_slave AS my_column; --enable_warnings DESCRIBE t1; +select length(my_column) from t1; DROP TABLE t1; # # check that the new setting of @@global.init_slave becomes immediately visible diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test new file mode 100644 index 00000000000..fee18e441d1 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/secure_file_priv_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select @@global.secure_file_priv; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.secure_file_priv; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +show global variables like 'secure_file_priv'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +show session variables like 'secure_file_priv'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select * from information_schema.global_variables where variable_name='secure_file_priv'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select * from information_schema.session_variables where variable_name='secure_file_priv'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global secure_file_priv=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session secure_file_priv=1; diff --git a/mysql-test/suite/sys_vars/inc/server_id_basic.inc b/mysql-test/suite/sys_vars/t/server_id_basic.test similarity index 98% rename from mysql-test/suite/sys_vars/inc/server_id_basic.inc rename to mysql-test/suite/sys_vars/t/server_id_basic.test index 47afadb5016..9d41823053a 100644 --- a/mysql-test/suite/sys_vars/inc/server_id_basic.inc +++ b/mysql-test/suite/sys_vars/t/server_id_basic.test @@ -107,8 +107,8 @@ SELECT @@global.server_id; SET @@global.server_id = 2147483649*2; SELECT @@global.server_id; ---Error ER_PARSE_ERROR -SET @@global.server_id = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.server_id = 65530.34; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.server_id = '125'; --Error ER_WRONG_TYPE_FOR_VAR @@ -116,9 +116,6 @@ SET @@global.server_id = 7483649.56; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.server_id = 1G; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - --echo '#------------------FN_DYNVARS_144_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_32.test b/mysql-test/suite/sys_vars/t/server_id_basic_32.test deleted file mode 100644 index e01b271e002..00000000000 --- a/mysql-test/suite/sys_vars/t/server_id_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/server_id_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_64.test b/mysql-test/suite/sys_vars/t/server_id_basic_64.test deleted file mode 100644 index 4ef870aa977..00000000000 --- a/mysql-test/suite/sys_vars/t/server_id_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/server_id_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test b/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test new file mode 100644 index 00000000000..591f3cec5e5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test @@ -0,0 +1,24 @@ +--source include/windows.inc +# +# only global +# +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select @@global.shared_memory_base_name; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.shared_memory_base_name; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +show global variables like 'shared_memory_base_name'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +show session variables like 'shared_memory_base_name'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select * from information_schema.global_variables where variable_name='shared_memory_base_name'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +select * from information_schema.session_variables where variable_name='shared_memory_base_name'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global shared_memory_base_name=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session shared_memory_base_name=1; diff --git a/mysql-test/suite/sys_vars/t/shared_memory_basic.test b/mysql-test/suite/sys_vars/t/shared_memory_basic.test new file mode 100644 index 00000000000..ff2c5fad81d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/shared_memory_basic.test @@ -0,0 +1,19 @@ +--source include/windows.inc +# +# only global +# +select @@global.shared_memory; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.shared_memory; +show global variables like 'shared_memory'; +show session variables like 'shared_memory'; +select * from information_schema.global_variables where variable_name='shared_memory'; +select * from information_schema.session_variables where variable_name='shared_memory'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global shared_memory=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session shared_memory=1; diff --git a/mysql-test/suite/sys_vars/t/skip_external_locking_basic.test b/mysql-test/suite/sys_vars/t/skip_external_locking_basic.test new file mode 100644 index 00000000000..67b58ab8ff4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/skip_external_locking_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.skip_external_locking; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.skip_external_locking; +show global variables like 'skip_external_locking'; +show session variables like 'skip_external_locking'; +select * from information_schema.global_variables where variable_name='skip_external_locking'; +select * from information_schema.session_variables where variable_name='skip_external_locking'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global skip_external_locking=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session skip_external_locking=1; diff --git a/mysql-test/suite/sys_vars/t/skip_networking_basic.test b/mysql-test/suite/sys_vars/t/skip_networking_basic.test new file mode 100644 index 00000000000..09a775cc257 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/skip_networking_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.skip_networking; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.skip_networking; +show global variables like 'skip_networking'; +show session variables like 'skip_networking'; +select * from information_schema.global_variables where variable_name='skip_networking'; +select * from information_schema.session_variables where variable_name='skip_networking'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global skip_networking=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session skip_networking=1; diff --git a/mysql-test/suite/sys_vars/t/skip_show_database_basic.test b/mysql-test/suite/sys_vars/t/skip_show_database_basic.test new file mode 100644 index 00000000000..9e0fddd120c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/skip_show_database_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.skip_show_database; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.skip_show_database; +show global variables like 'skip_show_database'; +show session variables like 'skip_show_database'; +select * from information_schema.global_variables where variable_name='skip_show_database'; +select * from information_schema.session_variables where variable_name='skip_show_database'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global skip_show_database=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session skip_show_database=1; diff --git a/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test index 020fd9c84c2..e8b52259051 100644 --- a/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test +++ b/mysql-test/suite/sys_vars/t/slave_allow_batching_basic.test @@ -37,8 +37,6 @@ --Error ER_UNKNOWN_SYSTEM_VARIABLE SET @global_start_value = @@global.slave_allow_batching; ---echo 'Bug: This variable is not supported in mysql version 5.1.22' - --echo '#--------------------FN_DYNVARS_145_01------------------------#' ######################################################################## # Display the DEFAULT value of slave_allow_batching # diff --git a/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test b/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test index 5c5b4e7da1b..503fb382602 100644 --- a/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test +++ b/mysql-test/suite/sys_vars/t/slave_exec_mode_basic.test @@ -23,6 +23,7 @@ # # ################################################################################ +--source include/not_embedded.inc --source include/load_sysvars.inc ######################################################################## diff --git a/mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test b/mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test new file mode 100644 index 00000000000..4121c881ee5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_load_tmpdir_basic.test @@ -0,0 +1,24 @@ +--source include/not_embedded.inc +# +# only global +# +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +select @@global.slave_load_tmpdir; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.slave_load_tmpdir; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +show global variables like 'slave_load_tmpdir'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +show session variables like 'slave_load_tmpdir'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +select * from information_schema.global_variables where variable_name='slave_load_tmpdir'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +select * from information_schema.session_variables where variable_name='slave_load_tmpdir'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global slave_load_tmpdir=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session slave_load_tmpdir=1; diff --git a/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test index 5662eec3957..f534bd2f28c 100644 --- a/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test @@ -105,8 +105,8 @@ SELECT @@global.slave_net_timeout; SET @@global.slave_net_timeout = 2147483649*2; SELECT @@global.slave_net_timeout; ---Error ER_PARSE_ERROR -SET @@global.slave_net_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_net_timeout = 65530.34; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.slave_net_timeout = 100s; --Error ER_WRONG_TYPE_FOR_VAR @@ -114,9 +114,6 @@ SET @@global.slave_net_timeout = 7483649.56; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.slave_net_timeout = 0.6; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - --echo '#------------------FN_DYNVARS_146_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # diff --git a/mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test b/mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test new file mode 100644 index 00000000000..c5c8aba7e3a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_skip_errors_basic.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +# +# only global +# +select @@global.slave_skip_errors; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.slave_skip_errors; +show global variables like 'slave_skip_errors'; +show session variables like 'slave_skip_errors'; +select * from information_schema.global_variables where variable_name='slave_skip_errors'; +select * from information_schema.session_variables where variable_name='slave_skip_errors'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global slave_skip_errors=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session slave_skip_errors=1; diff --git a/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test index 6289a91abb3..bedcb6201b1 100644 --- a/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test +++ b/mysql-test/suite/sys_vars/t/slow_launch_time_basic.test @@ -90,7 +90,6 @@ SET @@global.slow_launch_time = -1024; SELECT @@global.slow_launch_time; SET @@global.slow_launch_time = 42949672950; SELECT @@global.slow_launch_time; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.slow_launch_time = ON; diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test index 9125b686cad..bac0d0c8198 100644 --- a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test +++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test @@ -43,7 +43,8 @@ SET @start_value = @@global.slow_query_log_file; ############################################### SET @@global.slow_query_log_file = DEFAULT; -SELECT RIGHT(@@global.slow_query_log_file,15); +SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '-slow.log'); +SELECT RIGHT(@@global.slow_query_log_file, length(@a)) = @a; --echo '#--------------------FN_DYNVARS_004_02------------------------#' diff --git a/mysql-test/suite/sys_vars/t/socket_basic.test b/mysql-test/suite/sys_vars/t/socket_basic.test new file mode 100644 index 00000000000..f96a863a216 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/socket_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +select @@global.socket; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.socket; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +show global variables like 'socket'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +show session variables like 'socket'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +select * from information_schema.global_variables where variable_name='socket'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +select * from information_schema.session_variables where variable_name='socket'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global socket=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session socket=1; diff --git a/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test index da01a3b4459..07bf38773af 100644 --- a/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_auto_is_null_basic.test @@ -27,75 +27,36 @@ # Displaying default value # #################################################################### -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected +SELECT @@session.sql_auto_is_null; --echo '#---------------------BS_STVARS_044_02----------------------#' -# -# Test case for Bug #35433 -# #################################################################### # Check if Value can set # #################################################################### - -#--error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@SESSION.sql_auto_is_null=1; ---ECHO "BUG:It should give error on setting this variable as it is readonly variable" ---echo Expected error 'Read only variable' - -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected - - - +SET @@session.sql_auto_is_null=1; +SELECT @@session.sql_auto_is_null; --echo '#---------------------BS_STVARS_044_03----------------------#' ################################################################# -# Check if the value in SESSION Table matches value in variable # +# Check if the value in session Table matches value in variable # ################################################################# -SELECT IF(@@SESSION.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE +SELECT IF(@@session.sql_auto_is_null, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sql_auto_is_null'; ---echo 1 Expected -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sql_auto_is_null'; ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_044_04----------------------#' -################################################################################ -# Check if accessing variable with and without SESSION point to same variable # -################################################################################ -SELECT @@sql_auto_is_null = @@SESSION.sql_auto_is_null; ---echo 1 Expected - - --echo '#---------------------BS_STVARS_044_05----------------------#' ################################################################################ # Check if sql_auto_is_null can be accessed with and without @@ sign # ################################################################################ -SELECT COUNT(@@sql_auto_is_null); ---echo 1 Expected -SELECT COUNT(@@local.sql_auto_is_null); ---echo 1 Expected -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@GLOBAL.sql_auto_is_null); ---echo Expected error 'Variable is a SESSION variable' - ---error ER_BAD_FIELD_ERROR -SELECT COUNT(sql_auto_is_null = @@GLOBAL.sql_auto_is_null); ---echo Expected error 'Readonly variable' +SELECT @@sql_auto_is_null; +SELECT @@local.sql_auto_is_null; +SELECT @@session.sql_auto_is_null; +SELECT @@global.sql_auto_is_null; diff --git a/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test index dd9b585cc84..42331d766be 100644 --- a/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_big_selects_basic.test @@ -93,12 +93,8 @@ SET @@session.sql_big_selects = "Y"; SET @@session.sql_big_selects = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_big_selects = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_big_selects = OF; -SELECT @@session.sql_big_selects; - ---echo 'Bug # 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_big_selects = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -112,11 +108,9 @@ SET @@session.sql_big_selects = NO; # Test if accessing global sql_big_selects gives error # ######################################################################## ---Error ER_LOCAL_VARIABLE -SET @@global.sql_big_selects = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_big_selects = 1-@@global.sql_big_selects; SELECT @@global.sql_big_selects; +SET @@global.sql_big_selects = 1-@@global.sql_big_selects; --echo '#----------------------FN_DYNVARS_153_06------------------------#' ######################################################################### diff --git a/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test index 64ce47b044b..373ae06c850 100644 --- a/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test @@ -96,12 +96,8 @@ SET @@session.sql_big_tables = "Y"; SET @@session.sql_big_tables = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_big_tables = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_big_tables = OF; -SELECT @@session.sql_big_tables; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_big_tables = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -115,10 +111,9 @@ SET @@session.sql_big_tables = NO; # Test if accessing global sql_big_tables gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE -SET @@global.sql_big_tables = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_big_tables = 1-@@global.sql_big_tables; +SELECT @@global.sql_big_tables; +SET @@global.sql_big_tables = 1-@@global.sql_big_tables; SELECT @@global.sql_big_tables; --echo '#----------------------FN_DYNVARS_154_06------------------------#' diff --git a/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test index 04e65239ccb..f5f99efeb0a 100644 --- a/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_basic.test @@ -92,25 +92,15 @@ SET @@session.sql_buffer_result = 2; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_buffer_result = "TRU"; +--Error ER_WRONG_TYPE_FOR_VAR SET @@session.sql_buffer_result = 0.4; -SELECT @@session.sql_buffer_result; - -SET @@session.sql_buffer_result = 1.4; -SELECT @@session.sql_buffer_result; - ---echo 'Bug: Decimal values are accepted and rounded to an integer before'; ---echo 'assingment.'; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_buffer_result = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_buffer_result = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_buffer_result = OF; -SELECT @@session.sql_buffer_result; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_buffer_result = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -124,10 +114,9 @@ SET @@session.sql_buffer_result = NO; # Test if accessing global sql_buffer_result gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE -SET @@global.sql_buffer_result = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_buffer_result = 1-@@global.sql_buffer_result; +SELECT @@global.sql_buffer_result; +SET @@global.sql_buffer_result = 1-@@global.sql_buffer_result; SELECT @@global.sql_buffer_result; --echo '#----------------------FN_DYNVARS_155_06------------------------#' diff --git a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test index 9ac0474f982..153a0be0b8f 100644 --- a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test @@ -97,12 +97,8 @@ SET @@session.sql_log_bin = "Y"; SET @@session.sql_log_bin = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_log_bin = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_log_bin = OF; -SELECT @@session.sql_log_bin; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_log_bin = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -116,11 +112,9 @@ SET @@session.sql_log_bin = NO; # Test if accessing global sql_log_bin gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE SET @@global.sql_log_bin = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR SELECT @@global.sql_log_bin; +SET @@global.sql_log_bin = 1; --echo '#----------------------FN_DYNVARS_156_06------------------------#' ######################################################################### diff --git a/mysql-test/suite/sys_vars/t/sql_log_off_basic.test b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test index a208d30a39b..38549ac35d2 100644 --- a/mysql-test/suite/sys_vars/t/sql_log_off_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_log_off_basic.test @@ -96,12 +96,8 @@ SET @@session.sql_log_off = "Y"; SET @@session.sql_log_off = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_log_off = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_log_off = OF; -SELECT @@session.sql_log_off; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_log_off = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -115,10 +111,9 @@ SET @@session.sql_log_off = NO; # Test if accessing global sql_log_off gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE -SET @@global.sql_log_off = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_log_off = 1-@@global.sql_log_off; +SELECT @@global.sql_log_off; +SET @@global.sql_log_off = 1-@@global.sql_log_off; SELECT @@global.sql_log_off; --echo '#----------------------FN_DYNVARS_157_06------------------------#' diff --git a/mysql-test/suite/sys_vars/t/sql_log_update_basic.test b/mysql-test/suite/sys_vars/t/sql_log_update_basic.test new file mode 100644 index 00000000000..c48840d4a81 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sql_log_update_basic.test @@ -0,0 +1,35 @@ +--source include/have_profiling.inc + +SET @start_global_value = @@global.sql_log_update; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.sql_log_update; +select @@session.sql_log_update; +show global variables like 'sql_log_update'; +show session variables like 'sql_log_update'; +select * from information_schema.global_variables where variable_name='sql_log_update'; +select * from information_schema.session_variables where variable_name='sql_log_update'; + +# +# show that it's writable +# +set global sql_log_update=1; +select @@global.sql_log_update; +set session sql_log_update=ON; +select @@session.sql_log_update; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global sql_log_update=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global sql_log_update=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global sql_log_update="foo"; + +SET @@global.sql_log_update = @start_global_value; +SELECT @@global.sql_log_update; diff --git a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test index 8d75349b851..5b21bd4c79a 100644 --- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test @@ -50,12 +50,8 @@ SET @@session.sql_low_priority_updates = DEFAULT; SELECT @@session.sql_low_priority_updates; SET @@global.sql_low_priority_updates = 1; ---Error ER_NO_DEFAULT SET @@global.sql_low_priority_updates = DEFAULT; ---echo 'Bug: DEFAULT value is only associated with session' - - --echo '#---------------------FN_DYNVARS_159_02-------------------------#' #################################################################################### # Check if sql_low_priority_updates can be accessed with and without @@ sign # @@ -106,7 +102,7 @@ SELECT @@global.sql_low_priority_updates; # for session --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_low_priority_updates = -1; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@session.sql_low_priority_updates = 1.6; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_low_priority_updates = "T"; @@ -116,12 +112,8 @@ SET @@session.sql_low_priority_updates = "Y"; SET @@session.sql_low_priority_updates = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_low_priority_updates = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_low_priority_updates = OF; -SELECT @@session.sql_low_priority_updates; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_low_priority_updates = ÓFF; @@ -139,12 +131,8 @@ SET @@global.sql_low_priority_updates = "Y"; SET @@global.sql_low_priority_updates = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_low_priority_updates = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_low_priority_updates = OF; -SELECT @@global.sql_low_priority_updates; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_low_priority_updates = ÓFF; diff --git a/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test b/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test new file mode 100644 index 00000000000..bafa11379aa --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test @@ -0,0 +1,42 @@ +SET @start_global_value = @@global.sql_max_join_size; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.sql_max_join_size; +select @@session.sql_max_join_size; +show global variables like 'sql_max_join_size'; +show session variables like 'sql_max_join_size'; +select * from information_schema.global_variables where variable_name='sql_max_join_size'; +select * from information_schema.session_variables where variable_name='sql_max_join_size'; + +# +# show that it's writable +# +set global sql_max_join_size=10; +select @@global.sql_max_join_size; +set session sql_max_join_size=20; +select @@session.sql_max_join_size; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global sql_max_join_size=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global sql_max_join_size=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global sql_max_join_size="foo"; + +# +# affects OPTION_BIG_SELECTS +# +select @@sql_big_selects; +set sql_max_join_size=cast(-1 as unsigned int); +select @@sql_big_selects; +set sql_max_join_size=100; +select @@sql_big_selects; + +SET @@global.sql_max_join_size = @start_global_value; +SELECT @@global.sql_max_join_size; diff --git a/mysql-test/suite/sys_vars/t/sql_mode_basic.test b/mysql-test/suite/sys_vars/t/sql_mode_basic.test index 24f1e8aefcb..83f938925d5 100644 --- a/mysql-test/suite/sys_vars/t/sql_mode_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_mode_basic.test @@ -57,9 +57,6 @@ SET @@session.sql_mode = ANSI; SET @@session.sql_mode = DEFAULT; SELECT @@session.sql_mode; ---echo 'Bug# 34876: Default values for both session and global sql_mode is ""'; ---echo 'and not OFF.'; - --echo '#---------------------FN_DYNVARS_152_02-------------------------#' ######################################################### # Check if NULL or empty value is accepeted # @@ -92,9 +89,6 @@ SELECT @@session.sql_mode; # sql modes ref: http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html ---echo 'Bug: Incomplete sql modes valid values at:'; ---echo 'http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html'; - # check valid values for global SET @@global.sql_mode = ANSI; @@ -164,7 +158,6 @@ SELECT @@global.sql_mode; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_mode = OFF; ---echo 'Bug: OFF is documented as an sql mode but infact it is not'; #check valid values for session SET @@session.sql_mode = ANSI; @@ -235,15 +228,10 @@ SELECT @@session.sql_mode; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_mode = OFF; +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_mode = '?'; SELECT @@global.sql_mode; -SET @@session.sql_mode = '?'; -SELECT @@session.sql_mode; - ---echo 'Bug# 34834: ? is acceptable as a valid sql mode.' - - --echo '#--------------------FN_DYNVARS_152_04-------------------------#' ########################################################################### # Change the value of sql_mode to invalid value # @@ -327,30 +315,8 @@ SET @@global.sql_mode = 4294967296; # use of decimal values +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.sql_mode = 0.4; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 1.0; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 40000.1; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 1.5; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 124567.49; -SELECT @@global.sql_mode; - -SET @@session.sql_mode = 50000000.5; -SELECT @@session.sql_mode; - -SET @@session.sql_mode = 4294967295.4; -SELECT @@session.sql_mode; - ---echo 'Bug: Decimal values can be used within the range [0.0-4294967295.5).'; ---echo 'Values are rounded to numeric values as evident from outcome.'; - --echo '#---------------------FN_DYNVARS_152_08----------------------#' ################################################################### @@ -394,8 +360,16 @@ SELECT @@global.sql_mode; #try combining invalid mode with correct mode --Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,HIGH_OR_PRECEDENCE, -IGNORE_SPACE'; +SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,FOOBAR,IGNORE_SPACE'; + +#zero-length values are ok +SET @@sql_mode=','; +SELECT @@sql_mode; +SET @@sql_mode=',,,,ANSI_QUOTES,,,'; +SELECT @@sql_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@sql_mode=',,,,FOOBAR,,,,,'; +SELECT @@sql_mode; ############################## # Restore initial value # diff --git a/mysql-test/suite/sys_vars/t/sql_notes_basic.test b/mysql-test/suite/sys_vars/t/sql_notes_basic.test index 461e5d35e4f..9af5fa35ea2 100644 --- a/mysql-test/suite/sys_vars/t/sql_notes_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_notes_basic.test @@ -98,12 +98,8 @@ SET @@session.sql_notes = "Y"; SET @@session.sql_notes = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_notes = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_notes = OF; -SELECT @@session.sql_notes; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_notes = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -117,10 +113,9 @@ SET @@session.sql_notes = NO; # Test if accessing global sql_notes gives error # ######################################################################### ---Error ER_LOCAL_VARIABLE -SET @@global.sql_notes = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_notes = 1-@@global.sql_notes; +SELECT @@global.sql_notes; +SET @@global.sql_notes = 1-@@global.sql_notes; SELECT @@global.sql_notes; --echo '#----------------------FN_DYNVARS_161_06------------------------#' diff --git a/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test index 5e0edef55e5..020b5f51e9f 100644 --- a/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_quote_show_create_basic.test @@ -97,12 +97,8 @@ SET @@session.sql_quote_show_create = "Y"; SET @@session.sql_quote_show_create = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_quote_show_create = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_quote_show_create = OF; -SELECT @@session.sql_quote_show_create; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_quote_show_create = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -116,10 +112,9 @@ SET @@session.sql_quote_show_create = NO; # Test if accessing global sql_quote_show_create gives error # ########################################################################## ---Error ER_LOCAL_VARIABLE -SET @@global.sql_quote_show_create = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_quote_show_create = 1-@@global.sql_quote_show_create; +SELECT @@global.sql_quote_show_create; +SET @@global.sql_quote_show_create = 1-@@global.sql_quote_show_create; SELECT @@global.sql_quote_show_create; --echo '#----------------------FN_DYNVARS_162_06------------------------#' diff --git a/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test index 4f2c57bdb81..66148b65aaf 100644 --- a/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_safe_updates_basic.test @@ -96,12 +96,8 @@ SET @@session.sql_safe_updates = "Y"; SET @@session.sql_safe_updates = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_safe_updates = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_safe_updates = OF; -SELECT @@session.sql_safe_updates; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_safe_updates = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -115,10 +111,9 @@ SET @@session.sql_safe_updates = NO; # Test if accessing global sql_safe_updates gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE -SET @@global.sql_safe_updates = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_safe_updates = 1-@@global.sql_safe_updates; +SELECT @@global.sql_safe_updates; +SET @@global.sql_safe_updates = 1-@@global.sql_safe_updates; SELECT @@global.sql_safe_updates; --echo '#----------------------FN_DYNVARS_163_06------------------------#' diff --git a/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test b/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test new file mode 100644 index 00000000000..0b941d25f42 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test @@ -0,0 +1,33 @@ +SET @start_global_value = @@global.sql_select_limit; +SELECT @start_global_value; + +# +# exists as global and session +# +select @@global.sql_select_limit; +select @@session.sql_select_limit; +show global variables like 'sql_select_limit'; +show session variables like 'sql_select_limit'; +select * from information_schema.global_variables where variable_name='sql_select_limit'; +select * from information_schema.session_variables where variable_name='sql_select_limit'; + +# +# show that it's writable +# +set global sql_select_limit=10; +select @@global.sql_select_limit; +set session sql_select_limit=20; +select @@session.sql_select_limit; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global sql_select_limit=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global sql_select_limit=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global sql_select_limit="foo"; + +SET @@global.sql_select_limit = @start_global_value; +SELECT @@global.sql_select_limit; diff --git a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test index e7d9098aee9..86cb3824d07 100644 --- a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test @@ -35,22 +35,16 @@ # Try accessing initial value # ############################################################# ---Error ER_VAR_CANT_BE_READ SET @start_global_value = @@global.sql_slave_skip_counter; ---Error ER_VAR_CANT_BE_READ SELECT @@global.sql_slave_skip_counter; ---echo 'Info:This value is write only. Value can not be read' - --echo '#--------------------FN_DYNVARS_165_02-------------------------#' ################################################################### # Try setting DEFAULT value to variable # ################################################################### ---Error ER_NO_DEFAULT SET @@global.sql_slave_skip_counter = DEFAULT; - --echo '#--------------------FN_DYNVARS_165_03-------------------------#' ################################################################### # Try setting any valid value to variable # @@ -64,7 +58,6 @@ SET @@global.sql_slave_skip_counter = 2147483648*2; SET @@global.sql_slave_skip_counter = 2147483648*2-1; SET @@global.sql_slave_skip_counter = 4294967295*4294967295; - --echo '#--------------------FN_DYNVARS_165_03-------------------------#' ################################################################### # Checking invalid value for variable # @@ -90,7 +83,6 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sql_slave_skip_counter'; - --echo '#--------------------FN_DYNVARS_165_03-------------------------#' ################################################################### # Checking if variable is accessible with session scope # @@ -103,6 +95,7 @@ SET @@session.sql_slave_skip_counter = 12; --Error ER_GLOBAL_VARIABLE SET @@local.sql_slave_skip_counter = 13; +SET @@global.sql_slave_skip_counter = 0; ######################################################## # END OF sql_slave_skip_counter TESTS # ######################################################## diff --git a/mysql-test/suite/sys_vars/t/sql_warnings_basic.test b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test index 99a9ad8dda2..ced58f96e15 100644 --- a/mysql-test/suite/sys_vars/t/sql_warnings_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_warnings_basic.test @@ -87,10 +87,8 @@ SELECT @@session.sql_warnings; # Change the value of sql_warnings to invalid value # ########################################################################### ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = -0.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = 1.9; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.sql_warnings = 0.6; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_warnings = "T"; --Error ER_WRONG_VALUE_FOR_VAR @@ -99,12 +97,8 @@ SET @@session.sql_warnings = "Y"; SET @@session.sql_warnings = TRÜE; --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_warnings = ÕN; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_warnings = OF; -SELECT @@session.sql_warnings; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - --Error ER_WRONG_VALUE_FOR_VAR SET @@session.sql_warnings = ÓFF; --Error ER_WRONG_VALUE_FOR_VAR @@ -118,10 +112,9 @@ SET @@session.sql_warnings = NO; # Test if accessing global sql_warnings gives error # ########################################################################### ---Error ER_LOCAL_VARIABLE -SET @@global.sql_warnings = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@global.sql_warnings = 1-@@global.sql_warnings; +SELECT @@global.sql_warnings; +SET @@global.sql_warnings = 1-@@global.sql_warnings; SELECT @@global.sql_warnings; @@ -147,7 +140,6 @@ SELECT @@session.sql_warnings; SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sql_warnings'; ---echo 'Bug: value in information schema does not match' --echo '#---------------------FN_DYNVARS_166_08-------------------------#' ################################################################### diff --git a/mysql-test/suite/sys_vars/t/storage_engine_basic.test b/mysql-test/suite/sys_vars/t/storage_engine_basic.test index 689afcd1010..e62390cb384 100644 --- a/mysql-test/suite/sys_vars/t/storage_engine_basic.test +++ b/mysql-test/suite/sys_vars/t/storage_engine_basic.test @@ -38,9 +38,7 @@ SELECT @start_session_value; # Display the DEFAULT value of storage_engine # ###################################################################### -SET @@global.storage_engine = MYISAM; - ---Error ER_NO_DEFAULT +SET @@global.storage_engine = INNODB; SET @@global.storage_engine = DEFAULT; SELECT @@global.storage_engine; @@ -87,11 +85,14 @@ SELECT @@session.storage_engine; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.storage_engine = 8199; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.storage_engine = NULL; + --Error ER_WRONG_TYPE_FOR_VAR SET @@global.storage_engine = -1024; ---Error ER_PARSE_ERROR -SET @@global.storage_engine = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.storage_engine = 65530.34; --Error ER_UNKNOWN_STORAGE_ENGINE SET @@global.storage_engine = FILE; @@ -99,8 +100,8 @@ SET @@global.storage_engine = FILE; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.storage_engine = 8199; ---Error ER_PARSE_ERROR -SET @@session.storage_engine = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.storage_engine = 65530.34; --Error ER_UNKNOWN_STORAGE_ENGINE SET @@session.storage_engine = RECORD; @@ -163,6 +164,8 @@ SELECT session.storage_engine; --Error ER_BAD_FIELD_ERROR SELECT storage_engine = @@session.storage_engine; +# check the old obsolete name +SET @@storage_engine = @start_global_value; #################################### # Restore initial value # diff --git a/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc b/mysql-test/suite/sys_vars/t/sync_binlog_basic.test similarity index 98% rename from mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc rename to mysql-test/suite/sys_vars/t/sync_binlog_basic.test index 04adab85ac8..71a35a30c58 100644 --- a/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc +++ b/mysql-test/suite/sys_vars/t/sync_binlog_basic.test @@ -93,7 +93,6 @@ SET @@global.sync_binlog = -1024; SELECT @@global.sync_binlog; SET @@global.sync_binlog = 42949672950; SELECT @@global.sync_binlog; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.sync_binlog = ON; diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test deleted file mode 100644 index 275b95cf775..00000000000 --- a/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/sync_binlog_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test deleted file mode 100644 index e6f9bf668a0..00000000000 --- a/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/sync_binlog_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/sync_master_info_basic.test b/mysql-test/suite/sys_vars/t/sync_master_info_basic.test new file mode 100644 index 00000000000..a080aa4c880 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sync_master_info_basic.test @@ -0,0 +1,43 @@ + +SET @start_global_value = @@global.sync_master_info; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.sync_master_info; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.sync_master_info; +show global variables like 'sync_master_info'; +show session variables like 'sync_master_info'; +select * from information_schema.global_variables where variable_name='sync_master_info'; +select * from information_schema.session_variables where variable_name='sync_master_info'; + +# +# show that it's writable +# +set global sync_master_info=1; +select @@global.sync_master_info; +--error ER_GLOBAL_VARIABLE +set session sync_master_info=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global sync_master_info=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global sync_master_info=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global sync_master_info="foo"; + +# +# min/max values +# +set global sync_master_info=0; +select @@global.sync_master_info; +set global sync_master_info=cast(-1 as unsigned int); +select @@global.sync_master_info; + +SET @@global.sync_master_info = @start_global_value; +SELECT @@global.sync_master_info; diff --git a/mysql-test/suite/sys_vars/t/sync_relay_log_basic.test b/mysql-test/suite/sys_vars/t/sync_relay_log_basic.test new file mode 100644 index 00000000000..112eaca7538 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sync_relay_log_basic.test @@ -0,0 +1,44 @@ +--source include/not_embedded.inc + +SET @start_global_value = @@global.sync_relay_log; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.sync_relay_log; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.sync_relay_log; +show global variables like 'sync_relay_log'; +show session variables like 'sync_relay_log'; +select * from information_schema.global_variables where variable_name='sync_relay_log'; +select * from information_schema.session_variables where variable_name='sync_relay_log'; + +# +# show that it's writable +# +set global sync_relay_log=1; +select @@global.sync_relay_log; +--error ER_GLOBAL_VARIABLE +set session sync_relay_log=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global sync_relay_log=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global sync_relay_log=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global sync_relay_log="foo"; + +# +# min/max values +# +set global sync_relay_log=0; +select @@global.sync_relay_log; +set global sync_relay_log=cast(-1 as unsigned int); +select @@global.sync_relay_log; + +SET @@global.sync_relay_log = @start_global_value; +SELECT @@global.sync_relay_log; diff --git a/mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test b/mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test new file mode 100644 index 00000000000..2ef4b3c0880 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sync_relay_log_info_basic.test @@ -0,0 +1,44 @@ +--source include/not_embedded.inc + +SET @start_global_value = @@global.sync_relay_log_info; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.sync_relay_log_info; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.sync_relay_log_info; +show global variables like 'sync_relay_log_info'; +show session variables like 'sync_relay_log_info'; +select * from information_schema.global_variables where variable_name='sync_relay_log_info'; +select * from information_schema.session_variables where variable_name='sync_relay_log_info'; + +# +# show that it's writable +# +set global sync_relay_log_info=1; +select @@global.sync_relay_log_info; +--error ER_GLOBAL_VARIABLE +set session sync_relay_log_info=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global sync_relay_log_info=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global sync_relay_log_info=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global sync_relay_log_info="foo"; + +# +# min/max values +# +set global sync_relay_log_info=0; +select @@global.sync_relay_log_info; +set global sync_relay_log_info=cast(-1 as unsigned int); +select @@global.sync_relay_log_info; + +SET @@global.sync_relay_log_info = @start_global_value; +SELECT @@global.sync_relay_log_info; diff --git a/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test index 741079091bc..69f29108645 100644 --- a/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test +++ b/mysql-test/suite/sys_vars/t/table_definition_cache_basic.test @@ -83,7 +83,6 @@ SET @@global.table_definition_cache = 524289; SELECT @@global.table_definition_cache; SET @@global.table_definition_cache = 42949672950; SELECT @@global.table_definition_cache; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.table_definition_cache = 21221204.10; diff --git a/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test index 43186c70874..f33e5660c5d 100644 --- a/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/table_lock_wait_timeout_basic.test @@ -87,7 +87,6 @@ SET @@global.table_lock_wait_timeout= 100000000000; SET @@global.table_lock_wait_timeout= -1024; SET @@global.table_lock_wait_timeout= 0; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.table_lock_wait_timeout= 10000.01; diff --git a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test index c32463ca030..7d2549cd87f 100644 --- a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test +++ b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test @@ -95,9 +95,6 @@ SELECT @@global.table_open_cache ; SET @@global.table_open_cache = 0; SELECT @@global.table_open_cache ; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.table_open_cache = 10000.01; diff --git a/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test b/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test new file mode 100644 index 00000000000..48a4c0797e5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test @@ -0,0 +1,43 @@ + +SET @start_global_value = @@global.thread_cache_size; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.thread_cache_size; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.thread_cache_size; +show global variables like 'thread_cache_size'; +show session variables like 'thread_cache_size'; +select * from information_schema.global_variables where variable_name='thread_cache_size'; +select * from information_schema.session_variables where variable_name='thread_cache_size'; + +# +# show that it's writable +# +set global thread_cache_size=1; +select @@global.thread_cache_size; +--error ER_GLOBAL_VARIABLE +set session thread_cache_size=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global thread_cache_size=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global thread_cache_size=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global thread_cache_size="foo"; + +# +# min/max values +# +set global thread_cache_size=0; +select @@global.thread_cache_size; +set global thread_cache_size=cast(-1 as unsigned int); +select @@global.thread_cache_size; + +SET @@global.thread_cache_size = @start_global_value; +SELECT @@global.thread_cache_size; diff --git a/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test b/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test new file mode 100644 index 00000000000..d4acc961752 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test @@ -0,0 +1,19 @@ +--source include/have_thread_concurrency.inc +# +# only global +# +select @@global.thread_concurrency; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.thread_concurrency; +show global variables like 'thread_concurrency'; +show session variables like 'thread_concurrency'; +select * from information_schema.global_variables where variable_name='thread_concurrency'; +select * from information_schema.session_variables where variable_name='thread_concurrency'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global thread_concurrency=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session thread_concurrency=1; diff --git a/mysql-test/suite/sys_vars/t/thread_stack_basic.test b/mysql-test/suite/sys_vars/t/thread_stack_basic.test new file mode 100644 index 00000000000..2d4d144572d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/thread_stack_basic.test @@ -0,0 +1,23 @@ +# +# only global +# +--replace_result 196608 262144 +select @@global.thread_stack; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.thread_stack; +--replace_result 196608 262144 +show global variables like 'thread_stack'; +--replace_result 196608 262144 +show session variables like 'thread_stack'; +--replace_result 196608 262144 +select * from information_schema.global_variables where variable_name='thread_stack'; +--replace_result 196608 262144 +select * from information_schema.session_variables where variable_name='thread_stack'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global thread_stack=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session thread_stack=1; diff --git a/mysql-test/suite/sys_vars/t/time_format_basic.test b/mysql-test/suite/sys_vars/t/time_format_basic.test new file mode 100644 index 00000000000..ec737b8c621 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/time_format_basic.test @@ -0,0 +1,18 @@ +# +# only global +# +select @@global.time_format; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.time_format; +show global variables like 'time_format'; +show session variables like 'time_format'; +select * from information_schema.global_variables where variable_name='time_format'; +select * from information_schema.session_variables where variable_name='time_format'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global time_format=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session time_format=1; diff --git a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc b/mysql-test/suite/sys_vars/t/timestamp_basic.test similarity index 94% rename from mysql-test/suite/sys_vars/inc/timestamp_basic.inc rename to mysql-test/suite/sys_vars/t/timestamp_basic.test index 9ef57c97043..a5baf304bf3 100644 --- a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc +++ b/mysql-test/suite/sys_vars/t/timestamp_basic.test @@ -1,4 +1,4 @@ -################## mysql-test\t\timestamp_basic.test ########################## +################## mysql-test/t/timestamp_basic.test ########################## # # # Variable Name: timestamp # # Scope: SESSION # @@ -43,9 +43,7 @@ SET @session_start_value = @@session.timestamp; SET @@timestamp = DEFAULT; -#SELECT @@timestamp; - ---echo 'timestamp does not have any DEFAULT value' +SELECT @@timestamp = UNIX_TIMESTAMP(); --echo '#---------------------FN_DYNVARS_001_02-------------------------#' ############################################################## @@ -55,23 +53,18 @@ SET @@timestamp = DEFAULT; --Error ER_LOCAL_VARIABLE SET @@global.timestamp = "1000"; - --echo '#--------------------FN_DYNVARS_001_03------------------------#' ######################################################################## # Change the value of timestamp to a valid value # ######################################################################## SET @@timestamp = 0; -#SELECT @@timestamp; +SELECT @@timestamp = UNIX_TIMESTAMP(); --echo 'Setting 0 resets timestamp to session default timestamp' -SET @@timestamp = 123456789123456; -SELECT @@timestamp; -SET @@timestamp = 60*60*60*60*365; -SELECT @@timestamp; SET @@timestamp = -1000000000; -SELECT @@timestamp; +SELECT @@timestamp = UNIX_TIMESTAMP(); SET @temp_ts = @@timestamp - @@timestamp; SELECT @temp_ts; @@ -84,7 +77,6 @@ SELECT @temp_ts; # for session scope --Error ER_WRONG_TYPE_FOR_VAR SET @@timestamp = "100"; ---echo 'Bug# 34836: Documentation says its a string variable but infact its numeric' --Error ER_WRONG_TYPE_FOR_VAR SET @@timestamp = " "; diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_32.test b/mysql-test/suite/sys_vars/t/timestamp_basic_32.test deleted file mode 100644 index a2b6139aef9..00000000000 --- a/mysql-test/suite/sys_vars/t/timestamp_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/timestamp_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_64.test b/mysql-test/suite/sys_vars/t/timestamp_basic_64.test deleted file mode 100644 index fbc86316ed9..00000000000 --- a/mysql-test/suite/sys_vars/t/timestamp_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/timestamp_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test index 136a9b4331e..0a15aa08b6b 100644 --- a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test +++ b/mysql-test/suite/sys_vars/t/tx_isolation_basic.test @@ -46,16 +46,11 @@ SELECT @session_start_value; #################################################################### SET @@global.tx_isolation = 'READ-UNCOMMITTED'; ---Error ER_NO_DEFAULT SET @@global.tx_isolation = DEFAULT; ---echo 'Bug# 34878: Documentation specifies a DEFAULT value of REPEATABLE-READ'; ---echo 'where as DEFAULT is not supported here.'; +SELECT @@global.tx_isolation; -SET @@session.tx_isolation = 'SERIALIZABLE'; SET @@session.tx_isolation = DEFAULT; SELECT @@session.tx_isolation; ---echo 'Bug# 34876: Documentation specifies a DEFAULT value of REPEATABLE-READ'; ---echo 'where as DEFAULT here as no effect.'; --echo '#---------------------FN_DYNVARS_183_02-------------------------#' ######################################################### @@ -115,18 +110,12 @@ SELECT @@session.tx_isolation; SET @@global.tx_isolation = -1; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.tx_isolation = READUNCOMMITTED; - - +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.tx_isolation = 'REPEATABLE'; -SELECT @@global.tx_isolation; ---echo 'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level' - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.tx_isolation = OFF; - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.tx_isolation = ON; - --Error ER_WRONG_VALUE_FOR_VAR SET @@global.tx_isolation = 'NON-SERIALIZABLE'; @@ -136,11 +125,8 @@ SET @@global.tx_isolation = 'NON-SERIALIZABLE'; SET @@tx_isolation = -1; --Error ER_WRONG_VALUE_FOR_VAR SET @@tx_isolation = READUNCOMMITTED; - +--Error ER_WRONG_VALUE_FOR_VAR SET @@tx_isolation = 'REPEATABLE'; -SELECT @@tx_isolation; ---echo 'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level' - --Error ER_WRONG_VALUE_FOR_VAR SET @@tx_isolation = 'NONE'; --Error ER_WRONG_VALUE_FOR_VAR @@ -183,29 +169,8 @@ SELECT @@global.tx_isolation; SET @@global.tx_isolation = 3; SELECT @@global.tx_isolation; -# use of decimal values - +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.tx_isolation = 0.4; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 1.1; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 1.5; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 2.9; -SELECT @@global.tx_isolation; - -SET @@session.tx_isolation = 3.49; -SELECT @@session.tx_isolation; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.tx_isolation = 3.6; - ---echo 'Bug: Decimal values can be used within the range [0.0-3.5).'; ---echo 'Values are rounded to 0,1,2,3 as evident from outcome.'; - --echo '#---------------------FN_DYNVARS_183_08----------------------#' ################################################################### diff --git a/mysql-test/suite/sys_vars/t/unique_checks_basic.test b/mysql-test/suite/sys_vars/t/unique_checks_basic.test index 364dfc07cd1..af2ab6e58bd 100644 --- a/mysql-test/suite/sys_vars/t/unique_checks_basic.test +++ b/mysql-test/suite/sys_vars/t/unique_checks_basic.test @@ -46,16 +46,6 @@ SET @@session.unique_checks= 1; SET @@session.unique_checks= DEFAULT; SELECT @@session.unique_checks; ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -############################################################# -# Check the DEFAULT value of unique_checks # -############################################################# - - -SET @@session.unique_checks = DEFAULT; -SELECT @@session.unique_checks =1; - - --echo '#--------------------FN_DYNVARS_005_04-------------------------#' ######################################################################## # Change the value of unique_checks to a valid value for SESSION Scope # diff --git a/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test index 61a45793d39..941eb1db61a 100644 --- a/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test +++ b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_basic.test @@ -166,7 +166,7 @@ SET @@global.updatable_views_with_limit = 2345; SET @@global.updatable_views_with_limit = "FALSE"; ---Error ER_WRONG_VALUE_FOR_VAR +--Error ER_WRONG_TYPE_FOR_VAR SET @@global.updatable_views_with_limit = 65530.34; --Error ER_WRONG_VALUE_FOR_VAR diff --git a/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test similarity index 98% rename from mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc rename to mysql-test/suite/sys_vars/t/wait_timeout_basic.test index b6e19e235ba..e92a3294b86 100644 --- a/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc +++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test @@ -104,8 +104,6 @@ SELECT @@session.wait_timeout; SET @@global.wait_timeout = 0; SET @@global.wait_timeout = -1024; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.wait_timeout = ON; diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test deleted file mode 100644 index 613a5543b14..00000000000 --- a/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/wait_timeout_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test deleted file mode 100644 index d1138cbc105..00000000000 --- a/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/wait_timeout_basic.inc - diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index bd5f8c96518..a4a4bafcc5a 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1615,7 +1615,7 @@ DROP TABLE t1; # BUG#46961 - archive engine loses rows during self joining select! # SET @save_join_buffer_size= @@join_buffer_size; -SET @@join_buffer_size= 8228; +SET @@join_buffer_size= 8192; CREATE TABLE t1(a CHAR(255)) ENGINE=archive; INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), diff --git a/mysql-test/t/bug46080-master.opt b/mysql-test/t/bug46080-master.opt index f59740afe60..edcc54fa428 100644 --- a/mysql-test/t/bug46080-master.opt +++ b/mysql-test/t/bug46080-master.opt @@ -1 +1 @@ ---skip-grant-tables --skip-name-resolve --safemalloc-mem-limit=4000000 +--skip-grant-tables --skip-name-resolve --loose-safemalloc-mem-limit=4000000 diff --git a/mysql-test/t/bug46080.test b/mysql-test/t/bug46080.test index 8b4cee4d8b0..6daf12cf1c5 100644 --- a/mysql-test/t/bug46080.test +++ b/mysql-test/t/bug46080.test @@ -3,6 +3,8 @@ --echo # sort_buffer_size cannot allocate --echo # +--source include/have_debug.inc + call mtr.add_suppression("Out of memory at line .*, 'my_alloc.c'"); call mtr.add_suppression("needed .* byte .*k., memory in use: .* bytes .*k"); diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index 89f35116a2c..3ed798e8d36 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -20,7 +20,7 @@ SET @@session.max_join_size = default; SELECT @@session.sql_big_selects; # On some machines the following will result into a warning --disable_warnings -SET @@global.max_join_size = -1; +SET @@global.max_join_size = 18446744073709551615; --enable_warnings SET @@session.max_join_size = default; --echo change_user diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index e5dc7ffa53e..a83e18c44d9 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -16,83 +16,78 @@ FROM information_schema.session_variables WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') ORDER BY variable_name; -# -# Test setting a lot of different formats to see which formats are accepted and -# which aren't -# - -SET time_format='%H%i%s'; -SET time_format='%H:%i:%s.%f'; -SET time_format='%h-%i-%s.%f%p'; -SET time_format='%h:%i:%s.%f %p'; -SET time_format='%h:%i:%s%p'; - -SET date_format='%Y%m%d'; -SET date_format='%Y.%m.%d'; -SET date_format='%d.%m.%Y'; -SET date_format='%m-%d-%Y'; - -set datetime_format= '%Y%m%d%H%i%s'; -set datetime_format= '%Y-%m-%d %H:%i:%s'; -set datetime_format= '%m-%d-%y %H:%i:%s.%f'; -set datetime_format= '%d-%m-%Y %h:%i:%s%p'; -set datetime_format= '%H:%i:%s %Y-%m-%d'; -set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; -set datetime_format= '%h:%i:%s %p %Y-%m-%d'; -set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; - -SELECT variable_name, variable_value -FROM information_schema.session_variables -WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') -ORDER BY variable_name; - ---error 1231 -SET time_format='%h:%i:%s'; ---error 1231 -SET time_format='%H %i:%s'; ---error 1231 -SET time_format='%H::%i:%s'; ---error 1231 -SET time_format='%H:%i:%s%f'; ---error 1231 -SET time_format='%H:%i.%f:%s'; ---error 1231 -SET time_format='%H:%i:%s%p'; ---error 1231 -SET time_format='%h:%i:%s.%f %p %Y-%m-%d'; ---error 1231 -SET time_format='%H%i%s.%f'; ---error 1231 -SET time_format='%H:%i-%s.%f'; ---error 1231 -SET date_format='%d.%m.%d'; ---error 1231 -SET datetime_format='%h.%m.%y %d.%i.%s'; ---error 1231 -set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d'; - -# -# Test GLOBAL values - -set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d'; -SET SESSION datetime_format=default; -select @@global.datetime_format, @@session.datetime_format; -SET GLOBAL datetime_format=default; -SET SESSION datetime_format=default; -select @@global.datetime_format, @@session.datetime_format; - -SET GLOBAL date_format=default; -SET GLOBAL time_format=default; -SET GLOBAL datetime_format=default; -SET time_format=default; -SET date_format=default; -SET datetime_format=default; - # # The following tests will work only when we at some point will enable # dynamic changing of formats # +# SET time_format='%H%i%s'; +# SET time_format='%H:%i:%s.%f'; +# SET time_format='%h-%i-%s.%f%p'; +# SET time_format='%h:%i:%s.%f %p'; +# SET time_format='%h:%i:%s%p'; +# +# SET date_format='%Y%m%d'; +# SET date_format='%Y.%m.%d'; +# SET date_format='%d.%m.%Y'; +# SET date_format='%m-%d-%Y'; +# +# set datetime_format= '%Y%m%d%H%i%s'; +# set datetime_format= '%Y-%m-%d %H:%i:%s'; +# set datetime_format= '%m-%d-%y %H:%i:%s.%f'; +# set datetime_format= '%d-%m-%Y %h:%i:%s%p'; +# set datetime_format= '%H:%i:%s %Y-%m-%d'; +# set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; +# set datetime_format= '%h:%i:%s %p %Y-%m-%d'; +# set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; +# +# SELECT variable_name, variable_value +# FROM information_schema.session_variables +# WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +# ORDER BY variable_name; +# +# --error 1231 +# SET time_format='%h:%i:%s'; +# --error 1231 +# SET time_format='%H %i:%s'; +# --error 1231 +# SET time_format='%H::%i:%s'; +# --error 1231 +# SET time_format='%H:%i:%s%f'; +# --error 1231 +# SET time_format='%H:%i.%f:%s'; +# --error 1231 +# SET time_format='%H:%i:%s%p'; +# --error 1231 +# SET time_format='%h:%i:%s.%f %p %Y-%m-%d'; +# --error 1231 +# SET time_format='%H%i%s.%f'; +# --error 1231 +# SET time_format='%H:%i-%s.%f'; +# --error 1231 +# SET date_format='%d.%m.%d'; +# --error 1231 +# SET datetime_format='%h.%m.%y %d.%i.%s'; +# --error 1231 +# set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d'; +# +# # +# # Test GLOBAL values +# +# set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d'; +# SET SESSION datetime_format=default; +# select @@global.datetime_format, @@session.datetime_format; +# SET GLOBAL datetime_format=default; +# SET SESSION datetime_format=default; +# select @@global.datetime_format, @@session.datetime_format; +# +# SET GLOBAL date_format=default; +# SET GLOBAL time_format=default; +# SET GLOBAL datetime_format=default; +# SET time_format=default; +# SET date_format=default; +# SET datetime_format=default; + # SET date_format='%d.%m.%Y'; # select CAST('01.01.2001' as DATE) as a; # SET datetime_format='%d.%m.%Y %H.%i.%s'; diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test index fecef2f95d5..7ad46ae5f61 100644 --- a/mysql-test/t/ddl_i18n_koi8r.test +++ b/mysql-test/t/ddl_i18n_koi8r.test @@ -148,7 +148,7 @@ set names koi8r| --echo --echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $views_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $views_dump1 # - Clean mysqltest1; @@ -408,22 +408,22 @@ set names koi8r| --echo --echo ---> Dump of mysqltest1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 --echo --echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $sp_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 > $sp_dump1 --echo --echo ---> Dump of mysqltest2 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 --echo --echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $sp_dump2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 > $sp_dump2 # - Clean mysqltest1, mysqltest2; @@ -685,22 +685,22 @@ use mysqltest1| --echo --echo ---> Dump of mysqltest1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 --echo --echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $triggers_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 > $triggers_dump1 --echo --echo ---> Dump of mysqltest2 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 --echo --echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $triggers_dump2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 > $triggers_dump2 # - Clean mysqltest1, mysqltest2; @@ -946,22 +946,22 @@ set names koi8r| --echo --echo ---> Dump of mysqltest1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 --echo --echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.events.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $events_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 > $events_dump1 --echo --echo ---> Dump of mysqltest2 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 --echo --echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.events.mysqltest2.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $events_dump2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 > $events_dump2 # - Clean mysqltest1, mysqltest2; diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test index 8788d0604f2..6ef418fc6e7 100644 --- a/mysql-test/t/ddl_i18n_utf8.test +++ b/mysql-test/t/ddl_i18n_utf8.test @@ -148,7 +148,7 @@ set names utf8| --echo --echo ---> Dumping mysqltest1 to ddl_i18n_utf8views.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $views_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $views_dump1 # - Clean mysqltest1; @@ -408,22 +408,22 @@ set names utf8| --echo --echo ---> Dump of mysqltest1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 --echo --echo ---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $sp_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1 > $sp_dump1 --echo --echo ---> Dump of mysqltest2 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 --echo --echo ---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $sp_dump2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2 > $sp_dump2 # - Clean mysqltest1, mysqltest2; @@ -685,22 +685,22 @@ use mysqltest1| --echo --echo ---> Dump of mysqltest1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 --echo --echo ---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $triggers_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1 > $triggers_dump1 --echo --echo ---> Dump of mysqltest2 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 --echo --echo ---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $triggers_dump2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2 > $triggers_dump2 # - Clean mysqltest1, mysqltest2; @@ -946,22 +946,22 @@ set names utf8| --echo --echo ---> Dump of mysqltest1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 --echo --echo ---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $events_dump1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1 > $events_dump1 --echo --echo ---> Dump of mysqltest2 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 --echo --echo ---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $events_dump2 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2 > $events_dump2 # - Clean mysqltest1, mysqltest2; diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index 44c514f1244..5e53eaf0a52 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -102,8 +102,11 @@ drop table t1; drop table t2; drop function f1; drop function f2; + # -# testing the value encoding in the error messages of set_var +# testing the value encoding in the error messages +# +# should be TR\xC3\x9CE, TRÜE, TRÜE # SET NAMES utf8; --error ER_WRONG_VALUE_FOR_VAR @@ -125,9 +128,9 @@ SET sql_quote_show_create= _utf8 x'5452C39C45'; --error ER_WRONG_VALUE_FOR_VAR SET sql_quote_show_create=_latin1 x'5452DC45'; --error ER_WRONG_VALUE_FOR_VAR -SET sql_quote_show_create='TR.E'; +SET sql_quote_show_create='TRÜE'; --error ER_WRONG_VALUE_FOR_VAR -SET sql_quote_show_create=TR.E; +SET sql_quote_show_create=TRÜE; SET NAMES binary; --error ER_WRONG_VALUE_FOR_VAR @@ -136,3 +139,4 @@ SET sql_quote_show_create= _binary x'5452C39C45'; SET sql_quote_show_create= _utf8 x'5452C39C45'; --error ER_WRONG_VALUE_FOR_VAR SET sql_quote_show_create=_latin1 x'5452DC45'; + diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test index a50255e9f8b..08412d2f5b0 100644 --- a/mysql-test/t/events_2.test +++ b/mysql-test/t/events_2.test @@ -25,15 +25,6 @@ set names utf8; create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1; drop event задачка; -# event_scheduler is a global var ---error ER_GLOBAL_VARIABLE -set event_scheduler=off; -# event_scheduler could be only either 1 or 2 ---error ER_WRONG_VALUE_FOR_VAR -set global event_scheduler=3; ---error ER_WRONG_VALUE_FOR_VAR -set global event_scheduler=disabled; - --echo "DISABLE the scheduler. Testing that it does not work when the variable is 0" set global event_scheduler=off; select definer, name, db from mysql.event; diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 81397b333f9..8d9959f1b0a 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1199,14 +1199,14 @@ DROP USER mysqltest_u1@localhost; drop procedure if exists p; --enable_warnings set @old_mode= @@sql_mode; -set @@sql_mode= pow(2,32)-1; +set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); create event e1 on schedule every 1 day do select 1; -select @@sql_mode; +select @@sql_mode into @full_mode; set @@sql_mode= @old_mode; # Rename SQL modes that differ in name between the server and the table definition. -select replace(@full_mode, '?', 'NOT_USED') into @full_mode; +select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode; select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode; -select name from mysql.event where name = 'p' and sql_mode = @full_mode; +select name from mysql.event where name = 'e1' and sql_mode = @full_mode; drop event e1; # diff --git a/mysql-test/t/index_merge_myisam.test b/mysql-test/t/index_merge_myisam.test index dccaecef20a..86195cc3cd9 100644 --- a/mysql-test/t/index_merge_myisam.test +++ b/mysql-test/t/index_merge_myisam.test @@ -36,7 +36,6 @@ select @@optimizer_switch; set optimizer_switch='default,index_merge_sort_union=off'; select @@optimizer_switch; ---error ER_WRONG_VALUE_FOR_VAR set optimizer_switch=4; --error ER_WRONG_VALUE_FOR_VAR diff --git a/mysql-test/t/innodb_bug42101-nonzero.test b/mysql-test/t/innodb_bug42101-nonzero.test index 685fdf20489..2e4cf1f46dd 100644 --- a/mysql-test/t/innodb_bug42101-nonzero.test +++ b/mysql-test/t/innodb_bug42101-nonzero.test @@ -5,7 +5,7 @@ -- source include/have_innodb.inc ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_commit_concurrency=0; select @@innodb_commit_concurrency; set global innodb_commit_concurrency=1; @@ -14,7 +14,7 @@ set global innodb_commit_concurrency=42; select @@innodb_commit_concurrency; set global innodb_commit_concurrency=DEFAULT; select @@innodb_commit_concurrency; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_commit_concurrency=0; select @@innodb_commit_concurrency; set global innodb_commit_concurrency=1; diff --git a/mysql-test/t/innodb_bug42101.test b/mysql-test/t/innodb_bug42101.test index b6536490d48..f0b88e034a0 100644 --- a/mysql-test/t/innodb_bug42101.test +++ b/mysql-test/t/innodb_bug42101.test @@ -7,10 +7,10 @@ set global innodb_commit_concurrency=0; select @@innodb_commit_concurrency; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_commit_concurrency=1; select @@innodb_commit_concurrency; ---error ER_WRONG_ARGUMENTS +--error ER_WRONG_VALUE_FOR_VAR set global innodb_commit_concurrency=42; select @@innodb_commit_concurrency; set global innodb_commit_concurrency=0; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 4c14dc96aaa..a404e9bf15a 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -149,10 +149,13 @@ show status like 'key_blocks_used'; --replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; - -# Cleanup -# We don't reset keycache2 as we want to ensure that mysqld will reset it +create table t1 (a int primary key); +cache index t1 in keycache2; +insert t1 values (1),(2),(3),(4),(5),(6),(7),(8); +# delete keycache2, t1 is reassigned to default set global keycache2.key_buffer_size=0; +select * from t1; +drop table t1; # Test to set up a too small size for a key cache (bug #2064) set global keycache3.key_buffer_size=100; @@ -216,6 +219,7 @@ set global key_cache_block_size= @my_key_cache_block_size; # Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO # (One cannot drop the default key cache.) # +--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE set @@global.key_buffer_size=0; select @@global.key_buffer_size; diff --git a/mysql-test/t/mysql-bug45236-master.opt b/mysql-test/t/mysql-bug45236-master.opt new file mode 100644 index 00000000000..fc1887bca47 --- /dev/null +++ b/mysql-test/t/mysql-bug45236-master.opt @@ -0,0 +1 @@ +--loose-skip-safemalloc diff --git a/mysql-test/t/mysql_locale_posix.test b/mysql-test/t/mysql_locale_posix.test index 7d306dfc6c4..c047b7b1ae9 100644 --- a/mysql-test/t/mysql_locale_posix.test +++ b/mysql-test/t/mysql_locale_posix.test @@ -128,10 +128,10 @@ DROP DATABASE IF EXISTS `ó`; # --echo --echo iso88592 ---exec LC_ALL=cs_CZ.iso88592 $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client" ---exec LC_ALL=cs_CZ.iso88592 $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó ---exec LC_ALL=cs_CZ.iso88592 $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó ---exec LC_ALL=cs_CZ.iso88592 $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR--default-character-set=auto "ó" +--exec LC_ALL=cs_CZ.iso88592 $MYSQL --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto test -e "SELECT @@character_set_client" +--exec LC_ALL=cs_CZ.iso88592 $MYSQLADMIN --character-sets-dir=$MYSQL_SHAREDIR/charsets -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó +--exec LC_ALL=cs_CZ.iso88592 $MYSQL_SHOW --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto ó +--exec LC_ALL=cs_CZ.iso88592 $MYSQL_CHECK --character-sets-dir=$MYSQL_SHAREDIR/charsets--default-character-set=auto "ó" # {"iso88597", "greek", my_cs_exact}, @@ -163,10 +163,10 @@ DROP DATABASE IF EXISTS `ó`; --echo --echo koi8r ---exec LC_ALL=ru_RU.koi8r $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client" ---exec LC_ALL=ru_RU.koi8r $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó ---exec LC_ALL=ru_RU.koi8r $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó ---exec LC_ALL=ru_RU.koi8r $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR --default-character-set=auto "ó" +--exec LC_ALL=ru_RU.koi8r $MYSQL --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto test -e "SELECT @@character_set_client" +--exec LC_ALL=ru_RU.koi8r $MYSQLADMIN --character-sets-dir=$MYSQL_SHAREDIR/charsets -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó +--exec LC_ALL=ru_RU.koi8r $MYSQL_SHOW --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto ó +--exec LC_ALL=ru_RU.koi8r $MYSQL_CHECK --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=auto "ó" # {"Shift_JIS", "sjis", my_cs_exact}, diff --git a/mysql-test/t/mysqld--help-notwin.test b/mysql-test/t/mysqld--help-notwin.test new file mode 100644 index 00000000000..6db5dd830a6 --- /dev/null +++ b/mysql-test/t/mysqld--help-notwin.test @@ -0,0 +1,8 @@ +# +# mysqld --help +# +--source include/not_embedded.inc +--source include/not_windows.inc + +--source include/mysqld--help.inc + diff --git a/mysql-test/t/mysqld--help-win.test b/mysql-test/t/mysqld--help-win.test new file mode 100644 index 00000000000..416beb1d34c --- /dev/null +++ b/mysql-test/t/mysqld--help-win.test @@ -0,0 +1,8 @@ +# +# mysqld --help +# +--source include/not_embedded.inc +--source include/windows.inc + +--source include/mysqld--help.inc + diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 07ab9cecd28..1b9a3fde8e4 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -168,7 +168,7 @@ drop database mysqldump_test_db; CREATE TABLE t1 (a CHAR(10)); INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments test t1 --echo # --echo # Bug#8063 make test mysqldump [ fail ] @@ -178,10 +178,10 @@ INSERT INTO t1 VALUES (_latin1 ' --echo # checking that "mysqldump" is compiled with "latin1" --echo # -#--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 +#--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 DROP TABLE t1; --echo # @@ -1673,14 +1673,14 @@ drop database db42635; SET NAMES utf8; CREATE TABLE `straße` ( f1 INT ); ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=latin1 --compatible=mysql323 test DROP TABLE `straße`; CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT ); ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=utf8 --compatible=mysql323 test --error 2 ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --skip-comments --default-character-set=latin1 --compatible=mysql323 test DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`; SET NAMES latin1; @@ -1837,7 +1837,7 @@ set names latin1; --echo --echo # Dump mysqldump_test_db to bug30027.sql. ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql --echo --echo # Drop mysqldump_test_db. @@ -1923,7 +1923,7 @@ WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1'; --echo --echo ---> Dumping mysqldump_test_db to bug30217.sql ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30217.sql +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30217.sql --echo @@ -2079,7 +2079,7 @@ INSERT INTO t1 VALUES (1, 'ABC-ÐБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL); --echo # default '--default-charset' (binary): ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --tab=$MYSQLTEST_VARDIR/tmp/ test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --tab=$MYSQLTEST_VARDIR/tmp/ test t1 --echo ################################################## --cat_file $file --echo ################################################## @@ -2092,7 +2092,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; --echo # utf8: ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1 --echo ################################################## --cat_file $file --echo ################################################## @@ -2105,7 +2105,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; --echo # latin1 (data corruption is expected): ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1 --echo ################################################## --cat_file $file --echo ################################################## @@ -2118,7 +2118,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; --echo # koi8r (data corruption is expected): ---exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1 +--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1 --echo ################################################## --cat_file $file --echo ################################################## diff --git a/mysql-test/t/partition_key_cache.test b/mysql-test/t/partition_key_cache.test index f6ea974ba96..4beb9506b05 100644 --- a/mysql-test/t/partition_key_cache.test +++ b/mysql-test/t/partition_key_cache.test @@ -9,7 +9,7 @@ DROP TABLE IF EXISTS t1, t2, v, x; --echo # Verifing that reads/writes use the key cache correctly SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size; --echo # Minimize default key cache (almost disabled). -SET @@global.default.key_buffer_size = 1; +SET @@global.default.key_buffer_size = 4096; CREATE TABLE t1 ( a INT, b INT, diff --git a/mysql-test/t/profiling.test b/mysql-test/t/profiling.test index afbce04b966..1e1aada7c15 100644 --- a/mysql-test/t/profiling.test +++ b/mysql-test/t/profiling.test @@ -9,10 +9,6 @@ show profile all; show session variables like 'profil%'; select @@profiling; -# setting global variable is an error ---error ER_LOCAL_VARIABLE -set global profiling = ON; - # But size is okay set @start_value= @@global.profiling_history_size; set global profiling_history_size=100; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index d6e73cbc88d..993f231759b 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -940,9 +940,9 @@ set global query_cache_size=0; create table t1 (a int); insert into t1 values (1),(2),(3); set GLOBAL query_cache_type=1; -set GLOBAL query_cache_limit=10000; +set GLOBAL query_cache_limit=10240; set GLOBAL query_cache_min_res_unit=0; -set GLOBAL query_cache_size= 100000; +set GLOBAL query_cache_size= 102400; # default_week_format reset query cache; @@ -1010,7 +1010,7 @@ set GLOBAL query_cache_size= default; # Bug#28897 UUID() returns non-unique values when query cache is enabled # -set GLOBAL query_cache_size=1000000; +set GLOBAL query_cache_size=1024000; create table t1 (a char); insert into t1 values ('c'); @@ -1179,7 +1179,7 @@ SET GLOBAL query_cache_size= default; --echo # --echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1 --echo # -set global query_cache_size=100000; +set global query_cache_size=102400; set global query_cache_size=0; set global query_cache_type=0; show status like 'Qcache_free_blocks'; diff --git a/mysql-test/t/select_safe.test b/mysql-test/t/select_safe.test index 481779e76d7..cca736d4c1d 100644 --- a/mysql-test/t/select_safe.test +++ b/mysql-test/t/select_safe.test @@ -6,7 +6,7 @@ drop table if exists t1; --enable_warnings -SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9; +SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9; create table t1 (a int auto_increment primary key, b char(20)); insert into t1 values(1,"test"); SELECT SQL_BUFFER_RESULT * from t1; @@ -85,6 +85,6 @@ set local max_join_size=1; select * from (select 1 union select 2 union select 3) x; drop table t1; -SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT; +SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT; # End of 4.1 tests diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 9d80650da2f..4f98b8b5128 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -903,7 +903,7 @@ CREATE TABLE t1( --echo --echo ---> Dumping mysqltest1 to outfile1 ---exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $outfile1 +--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1 # - Clean mysqltest1; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index e314e2419be..db4d57649d8 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3748,7 +3748,7 @@ begin end| set @qcs1 = @@query_cache_size| -set global query_cache_size = 100000| +set global query_cache_size = 102400| set @x = 1| insert into t1 values ("qc", 42)| select bug9902() from t1| @@ -8204,14 +8204,13 @@ DROP FUNCTION f1; drop procedure if exists p; --enable_warnings set @old_mode= @@sql_mode; -set @@sql_mode= pow(2,32)-1; +set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); select @@sql_mode into @full_mode; create procedure p() begin end; call p(); -select @@sql_mode; set @@sql_mode= @old_mode; # Rename SQL modes that differ in name between the server and the table definition. -select replace(@full_mode, '?', 'NOT_USED') into @full_mode; +select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode; select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode; select name from mysql.proc where name = 'p' and sql_mode = @full_mode; drop procedure p; diff --git a/mysql-test/t/user_limits.test b/mysql-test/t/user_limits.test index 41af032b97e..1bf3f9a3103 100644 --- a/mysql-test/t/user_limits.test +++ b/mysql-test/t/user_limits.test @@ -132,7 +132,7 @@ drop user mysqltest_1@localhost; select @@session.max_user_connections, @@global.max_user_connections; # Local max_user_connections variable can't be set directly # since this limit is per-account ---error ER_GLOBAL_VARIABLE +--error ER_VARIABLE_IS_READONLY set session max_user_connections= 2; # But it is ok to set global max_user_connections set global max_user_connections= 2; diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index c0740458a88..19c70c76139 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -122,8 +122,6 @@ select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); # --error 1064 set session @honk=99; ---error 1382 -set one_shot @honk=99; # # Bug #10724 @@local not preserved in column name of select diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 2252577926c..d4b88fc6f9c 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -33,7 +33,7 @@ set @my_query_cache_type =@@global.query_cache_type; set @my_rpl_recovery_rank =@@global.rpl_recovery_rank; set @my_server_id =@@global.server_id; set @my_slow_launch_time =@@global.slow_launch_time; -set @my_storage_engine =@@global.storage_engine; +set @my_storage_engine =@@global.default_storage_engine; set @my_thread_cache_size =@@global.thread_cache_size; set @my_max_allowed_packet =@@global.max_allowed_packet; set @my_join_buffer_size =@@global.join_buffer_size; @@ -132,12 +132,12 @@ set global timed_mutexes=0; show variables like 'timed_mutexes'; select * from information_schema.session_variables where variable_name like 'timed_mutexes'; -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; -show local variables like 'storage_engine'; -select * from information_schema.session_variables where variable_name like 'storage_engine'; -show global variables like 'storage_engine'; -select * from information_schema.global_variables where variable_name like 'storage_engine'; -set GLOBAL query_cache_size=100000; +set default_storage_engine=MYISAM, default_storage_engine="HEAP", global default_storage_engine="MERGE"; +show local variables like 'default_storage_engine'; +select * from information_schema.session_variables where variable_name like 'default_storage_engine'; +show global variables like 'default_storage_engine'; +select * from information_schema.global_variables where variable_name like 'default_storage_engine'; +set GLOBAL query_cache_size=102400; set GLOBAL myisam_max_sort_file_size=2000000; show global variables like 'myisam_max_sort_file_size'; @@ -213,7 +213,6 @@ set @@query_alloc_block_size=1024*17+2; set @@query_prealloc_size=1024*18-1023; set @@transaction_alloc_block_size=1024*20-1; set @@transaction_prealloc_size=1024*21-1; -select @@query_alloc_block_size; --echo ==+ Check manipulated values ==+ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', @@ -250,14 +249,12 @@ set unknown_variable=1; --error ER_WRONG_TYPE_FOR_VAR set max_join_size="hello"; --error ER_UNKNOWN_STORAGE_ENGINE -set storage_engine=UNKNOWN_TABLE_TYPE; +set default_storage_engine=UNKNOWN_TABLE_TYPE; --error ER_WRONG_VALUE_FOR_VAR -set storage_engine=MERGE, big_tables=2; -show local variables like 'storage_engine'; +set default_storage_engine=MERGE, big_tables=2; +show local variables like 'default_storage_engine'; --error ER_GLOBAL_VARIABLE set SESSION query_cache_size=10000; ---error ER_NO_DEFAULT -set GLOBAL storage_engine=DEFAULT; --error ER_UNKNOWN_CHARACTER_SET set character_set_client=UNKNOWN_CHARACTER_SET; --error ER_UNKNOWN_COLLATION @@ -266,18 +263,12 @@ set collation_connection=UNKNOWN_COLLATION; set character_set_client=NULL; --error ER_WRONG_VALUE_FOR_VAR set collation_connection=NULL; ---error ER_LOCAL_VARIABLE -set global autocommit=1; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@global.timestamp; --error ER_INCORRECT_GLOBAL_LOCAL_VAR set @@version=''; --error ER_GLOBAL_VARIABLE set @@concurrent_insert=1; ---error ER_LOCAL_VARIABLE -set @@global.sql_auto_is_null=1; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@global.sql_auto_is_null; --error ER_GLOBAL_VARIABLE set myisam_max_sort_file_size=100; --error ER_WRONG_VALUE_FOR_VAR @@ -357,8 +348,6 @@ set sql_log_bin=1; set sql_log_off=1; set sql_log_update=1; set sql_low_priority_updates=1; -set sql_max_join_size=200; -select @@sql_max_join_size,@@max_join_size; set sql_quote_show_create=1; set sql_safe_updates=1; set sql_select_limit=1; @@ -366,7 +355,7 @@ set sql_select_limit=1; set sql_select_limit=default; set sql_warnings=1; set global table_open_cache=100; -set storage_engine=myisam; +set default_storage_engine=myisam; set global thread_cache_size=100; set timestamp=1, timestamp=default; set tmp_table_size=100; @@ -832,7 +821,7 @@ set global query_cache_type =@my_query_cache_type; set global rpl_recovery_rank =@my_rpl_recovery_rank; set global server_id =@my_server_id; set global slow_launch_time =@my_slow_launch_time; -set global storage_engine =@my_storage_engine; +set global default_storage_engine =@my_storage_engine; set global thread_cache_size =@my_thread_cache_size; set global max_allowed_packet =@my_max_allowed_packet; set global join_buffer_size =@my_join_buffer_size; @@ -1187,7 +1176,7 @@ SET GLOBAL auto_increment_offset=0; # --enable_metadata -select @@storage_engine; +select @@default_storage_engine; --disable_metadata # diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index f5854043459..6b81ff66c7f 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -22,30 +22,21 @@ #include #include -typedef void (*init_func_p)(const struct my_option *option, uchar* *variable, +typedef void (*init_func_p)(const struct my_option *option, uchar **variable, longlong value); static void default_reporter(enum loglevel level, const char *format, ...); my_error_reporter my_getopt_error_reporter= &default_reporter; -static int findopt(char *optpat, uint length, - const struct my_option **opt_res, - char **ffname); -my_bool getopt_compare_strings(const char *s, - const char *t, - uint length); +static int findopt(char *, uint, const struct my_option **, char **); +my_bool getopt_compare_strings(const char *, const char *, uint); static longlong getopt_ll(char *arg, const struct my_option *optp, int *err); -static ulonglong getopt_ull(char *arg, const struct my_option *optp, - int *err); +static ulonglong getopt_ull(char *, const struct my_option *, int *); static double getopt_double(char *arg, const struct my_option *optp, int *err); -static void init_variables(const struct my_option *options, - init_func_p init_one_value); -static void init_one_value(const struct my_option *option, uchar* *variable, - longlong value); -static void fini_one_value(const struct my_option *option, uchar* *variable, - longlong value); -static int setval(const struct my_option *opts, uchar* *value, char *argument, - my_bool set_maximum_value); +static void init_variables(const struct my_option *, init_func_p); +static void init_one_value(const struct my_option *, uchar **, longlong); +static void fini_one_value(const struct my_option *, uchar **, longlong); +static int setval(const struct my_option *, uchar **, char *, my_bool); static char *check_struct_option(char *cur_arg, char *key_name); /* @@ -60,6 +51,7 @@ enum enum_special_opt { OPT_SKIP, OPT_DISABLE, OPT_ENABLE, OPT_MAXIMUM, OPT_LOOSE}; char *disabled_my_option= (char*) "0"; +char *enabled_my_option= (char*) "1"; /* This is a flag that can be set in client programs. 0 means that @@ -282,7 +274,7 @@ int handle_options(int *argc, char ***argv, my_getopt_error_reporter(ERROR_LEVEL, "%s: ambiguous option '--%s-%s' (--%s-%s)", my_progname, special_opt_prefix[i], - cur_arg, special_opt_prefix[i], + opt_str, special_opt_prefix[i], prev_found); return EXIT_AMBIGUOUS_OPTION; } @@ -294,11 +286,11 @@ int handle_options(int *argc, char ***argv, for example: --skip-option=0 -> option = TRUE */ optend= (optend && *optend == '0' && !(*(optend + 1))) ? - (char*) "1" : disabled_my_option; + enabled_my_option : disabled_my_option; break; case OPT_ENABLE: optend= (optend && *optend == '0' && !(*(optend + 1))) ? - disabled_my_option : (char*) "1"; + disabled_my_option : enabled_my_option; break; case OPT_MAXIMUM: set_maximum_value= 1; @@ -386,7 +378,7 @@ int handle_options(int *argc, char ***argv, } return EXIT_OPTION_DISABLED; } - if (must_be_var && (optp->var_type & GET_TYPE_MASK) == GET_NO_ARG) + if (must_be_var && optp->arg_type == NO_ARG) { if (my_getopt_print_errors) my_getopt_error_reporter(ERROR_LEVEL, @@ -428,33 +420,19 @@ int handle_options(int *argc, char ***argv, else { my_getopt_error_reporter(WARNING_LEVEL, - "%s: ignoring option '--%s' due to \ -invalid value '%s'", + "%s: ignoring option '--%s' " + "due to invalid value '%s'", my_progname, optp->name, optend); continue; } if (get_one_option && get_one_option(optp->id, optp, - *((my_bool*) value) ? - (char*) "1" : disabled_my_option)) + *((my_bool*) value) ? + enabled_my_option : disabled_my_option)) return EXIT_ARGUMENT_INVALID; continue; } argument= optend; } - else if (optp->arg_type == OPT_ARG && - (((optp->var_type & GET_TYPE_MASK) == GET_BOOL) || - (optp->var_type & GET_TYPE_MASK) == GET_ENUM)) - { - if (optend == disabled_my_option) - init_one_value(optp, value, 0); - else - { - if (!optend) /* No argument -> enable option */ - init_one_value(optp, value, 1); - else - argument= optend; - } - } else if (optp->arg_type == REQUIRED_ARG && !optend) { /* Check if there are more arguments after this one, @@ -481,9 +459,9 @@ invalid value '%s'", for (optend= cur_arg; *optend; optend++) { opt_found= 0; - for (optp= longopts; optp->id; optp++) + for (optp= longopts; optp->name; optp++) { - if (optp->id == (int) (uchar) *optend) + if (optp->id && optp->id == (int) (uchar) *optend) { /* Option recognized. Find next what to do with it */ opt_found= 1; @@ -539,12 +517,7 @@ invalid value '%s'", } if ((error= setval(optp, optp->value, argument, set_maximum_value))) - { - my_getopt_error_reporter(ERROR_LEVEL, - "%s: Error while setting value '%s' to '%s'", - my_progname, argument, optp->name); return error; - } if (get_one_option && get_one_option(optp->id, optp, argument)) return EXIT_UNSPECIFIED_ERROR; break; @@ -563,12 +536,7 @@ invalid value '%s'", continue; } if ((error= setval(optp, value, argument, set_maximum_value))) - { - my_getopt_error_reporter(ERROR_LEVEL, - "%s: Error while setting value '%s' to '%s'", - my_progname, argument, optp->name); return error; - } if (get_one_option && get_one_option(optp->id, optp, argument)) return EXIT_UNSPECIFIED_ERROR; @@ -637,79 +605,130 @@ static char *check_struct_option(char *cur_arg, char *key_name) Will set the option value to given value */ -static int setval(const struct my_option *opts, uchar* *value, char *argument, +static int setval(const struct my_option *opts, uchar **value, char *argument, my_bool set_maximum_value) { - int err= 0; + int err= 0, res= 0; - if (value && argument) + if (!argument) + argument= enabled_my_option; + + if (value) { - uchar* *result_pos= ((set_maximum_value) ? - opts->u_max_value : value); - - if (!result_pos) + if (set_maximum_value && !(value= opts->u_max_value)) + { + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Maximum value of '%s' cannot be set", + my_progname, opts->name); return EXIT_NO_PTR_TO_VARIABLE; + } switch ((opts->var_type & GET_TYPE_MASK)) { case GET_BOOL: /* If argument differs from 0, enable option, else disable */ - *((my_bool*) result_pos)= (my_bool) atoi(argument) != 0; + *((my_bool*) value)= (my_bool) atoi(argument) != 0; break; case GET_INT: - *((int*) result_pos)= (int) getopt_ll(argument, opts, &err); + *((int*) value)= (int) getopt_ll(argument, opts, &err); break; case GET_UINT: - *((uint*) result_pos)= (uint) getopt_ull(argument, opts, &err); + *((uint*) value)= (uint) getopt_ull(argument, opts, &err); break; case GET_LONG: - *((long*) result_pos)= (long) getopt_ll(argument, opts, &err); + *((long*) value)= (long) getopt_ll(argument, opts, &err); break; case GET_ULONG: - *((long*) result_pos)= (long) getopt_ull(argument, opts, &err); + *((long*) value)= (long) getopt_ull(argument, opts, &err); break; case GET_LL: - *((longlong*) result_pos)= getopt_ll(argument, opts, &err); + *((longlong*) value)= getopt_ll(argument, opts, &err); break; case GET_ULL: - *((ulonglong*) result_pos)= getopt_ull(argument, opts, &err); + *((ulonglong*) value)= getopt_ull(argument, opts, &err); break; case GET_DOUBLE: - *((double*) result_pos)= getopt_double(argument, opts, &err); + *((double*) value)= getopt_double(argument, opts, &err); break; case GET_STR: - *((char**) result_pos)= argument; + if (argument == enabled_my_option) + break; /* string options don't use this default of "1" */ + *((char**) value)= argument; break; case GET_STR_ALLOC: - if ((*((char**) result_pos))) - my_free((*(char**) result_pos), MYF(MY_WME | MY_FAE)); - if (!(*((char**) result_pos)= my_strdup(argument, MYF(MY_WME)))) - return EXIT_OUT_OF_MEMORY; + if (argument == enabled_my_option) + break; /* string options don't use this default of "1" */ + if ((*((char**) value))) + my_free((*(char**) value), MYF(MY_WME | MY_FAE)); + if (!(*((char**) value)= my_strdup(argument, MYF(MY_WME)))) + { + res= EXIT_OUT_OF_MEMORY; + goto ret; + }; break; case GET_ENUM: - if (((*(int*)result_pos)= - find_type(argument, opts->typelib, 2) - 1) < 0) + if (((*(uint*)value)= + find_type(argument, opts->typelib, 2) - 1) == (uint)-1) { - /* - Accept an integer representation of the enumerated item. - */ + /* Accept an integer representation of the enumerated item */ char *endptr; - unsigned int arg= (unsigned int) strtol(argument, &endptr, 10); + uint arg= (uint) strtol(argument, &endptr, 10); if (*endptr || arg >= opts->typelib->count) - return EXIT_ARGUMENT_INVALID; - *(int*)result_pos= arg; + { + res= EXIT_ARGUMENT_INVALID; + goto ret; + }; + *(uint*)value= arg; } break; case GET_SET: - *((ulonglong*)result_pos)= find_typeset(argument, opts->typelib, &err); + *((ulonglong*)value)= find_typeset(argument, opts->typelib, &err); if (err) - return EXIT_ARGUMENT_INVALID; + { + /* Accept an integer representation of the set */ + char *endptr; + ulonglong arg= (ulonglong) strtol(argument, &endptr, 10); + if (*endptr || (arg >> 1) >= (1ULL << (opts->typelib->count-1))) + { + res= EXIT_ARGUMENT_INVALID; + goto ret; + }; + *(ulonglong*)value= arg; + err= 0; + } break; - default: /* dummy default to avoid compiler warnings */ + case GET_FLAGSET: + { + char *error; + uint error_len; + + *((ulonglong*)value)= + find_set_from_flags(opts->typelib, opts->typelib->count, + *(ulonglong *)value, opts->def_value, + argument, strlen(argument), + &error, &error_len); + if (error) + { + res= EXIT_ARGUMENT_INVALID; + goto ret; + }; + } + break; + case GET_NO_ARG: /* get_one_option has taken care of the value already */ + default: /* dummy default to avoid compiler warnings */ break; } if (err) - return EXIT_UNKNOWN_SUFFIX; + { + res= EXIT_UNKNOWN_SUFFIX; + goto ret; + }; } return 0; + +ret: + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Error while setting value '%s' to '%s'", + my_progname, argument, opts->name); + return res; } @@ -887,7 +906,7 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, break; } - num= ((num - optp->sub_size) / block_size); + num= (num / block_size); num= (longlong) (num * block_size); if (num < optp->min_value) @@ -898,7 +917,7 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, } if (fix) - *fix= adjusted; + *fix= old != num; else if (adjusted) my_getopt_error_reporter(WARNING_LEVEL, "option '%s': signed value %s adjusted to %s", @@ -970,7 +989,7 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, } if (fix) - *fix= adjusted; + *fix= old != num; else if (adjusted) my_getopt_error_reporter(WARNING_LEVEL, "option '%s': unsigned value %s adjusted to %s", @@ -979,6 +998,29 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, return num; } +double getopt_double_limit_value(double num, const struct my_option *optp, + my_bool *fix) +{ + my_bool adjusted= FALSE; + double old= num; + if (optp->max_value && num > (double) optp->max_value) + { + num= (double) optp->max_value; + adjusted= TRUE; + } + if (num < (double) optp->min_value) + { + num= (double) optp->min_value; + adjusted= TRUE; + } + if (fix) + *fix= adjusted; + else if (adjusted) + my_getopt_error_reporter(WARNING_LEVEL, + "option '%s': value %g adjusted to %g", + optp->name, old, num); + return num; +} /* Get double value withing ranges @@ -1000,15 +1042,12 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err) num= my_strtod(arg, &end, &error); if (end[0] != 0 || error) { - fprintf(stderr, - "%s: ERROR: Invalid decimal value for option '%s'\n", - my_progname, optp->name); + my_getopt_error_reporter(ERROR_LEVEL, + "Invalid decimal value for option '%s'\n", optp->name); *err= EXIT_ARGUMENT_INVALID; return 0.0; } - if (optp->max_value && num > (double) optp->max_value) - num= (double) optp->max_value; - return max(num, (double) optp->min_value); + return getopt_double_limit_value(num, optp, NULL); } /* @@ -1050,6 +1089,7 @@ static void init_one_value(const struct my_option *option, uchar* *variable, *((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value((ulonglong) value, option, NULL); break; case GET_SET: + case GET_FLAGSET: *((ulonglong*) variable)= (ulonglong) value; break; case GET_DOUBLE: @@ -1125,7 +1165,7 @@ void my_cleanup_options(const struct my_option *options) NOTES We will initialize the value that is pointed to by options->value. - If the value is of type GET_ASK_ADDR, we will also ask for the address + If the value is of type GET_ASK_ADDR, we will ask for the address for a value and initialize. */ @@ -1135,7 +1175,7 @@ static void init_variables(const struct my_option *options, DBUG_ENTER("init_variables"); for (; options->name; options++) { - uchar* *variable; + uchar **value; DBUG_PRINT("options", ("name: '%s'", options->name)); /* We must set u_max_value first as for some variables @@ -1144,15 +1184,22 @@ static void init_variables(const struct my_option *options, */ if (options->u_max_value) init_one_value(options, options->u_max_value, options->max_value); - if (options->value) - init_one_value(options, options->value, options->def_value); - if (options->var_type & GET_ASK_ADDR && - (variable= (*getopt_get_addr)("", 0, options, 0))) - init_one_value(options, variable, options->def_value); + value= (options->var_type & GET_ASK_ADDR ? + (*getopt_get_addr)("", 0, options, 0) : options->value); + if (value) + init_one_value(options, value, options->def_value); } DBUG_VOID_RETURN; } +/** Prints variable or option name, replacing _ with - */ +static uint print_name(const struct my_option *optp) +{ + const char *s= optp->name; + for (;*s;s++) + putchar(*s == '_' ? '-' : *s); + return s - optp->name; +} /* function: my_print_options @@ -1168,9 +1215,9 @@ void my_print_help(const struct my_option *options) const char *line_end; const struct my_option *optp; - for (optp= options; optp->id; optp++) + for (optp= options; optp->name; optp++) { - if (optp->id < 256) + if (optp->id && optp->id < 256) { printf(" -%c%s", optp->id, strlen(optp->name) ? ", " : " "); col= 6; @@ -1182,21 +1229,24 @@ void my_print_help(const struct my_option *options) } if (strlen(optp->name)) { - printf("--%s", optp->name); - col+= 2 + (uint) strlen(optp->name); - if ((optp->var_type & GET_TYPE_MASK) == GET_STR || - (optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC) + printf("--"); + col+= 2 + print_name(optp); + if (optp->arg_type == NO_ARG || + (optp->var_type & GET_TYPE_MASK) == GET_BOOL) + { + putchar(' '); + col++; + } + else if ((optp->var_type & GET_TYPE_MASK) == GET_STR || + (optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC || + (optp->var_type & GET_TYPE_MASK) == GET_ENUM || + (optp->var_type & GET_TYPE_MASK) == GET_SET || + (optp->var_type & GET_TYPE_MASK) == GET_FLAGSET ) { printf("%s=name%s ", optp->arg_type == OPT_ARG ? "[" : "", optp->arg_type == OPT_ARG ? "]" : ""); col+= (optp->arg_type == OPT_ARG) ? 8 : 6; } - else if ((optp->var_type & GET_TYPE_MASK) == GET_NO_ARG || - (optp->var_type & GET_TYPE_MASK) == GET_BOOL) - { - putchar(' '); - col++; - } else { printf("%s=#%s ", optp->arg_type == OPT_ARG ? "[" : "", @@ -1228,12 +1278,13 @@ void my_print_help(const struct my_option *options) printf("%s", comment); } putchar('\n'); - if ((optp->var_type & GET_TYPE_MASK) == GET_NO_ARG || - (optp->var_type & GET_TYPE_MASK) == GET_BOOL) + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) { if (optp->def_value != 0) { - printf("%*s(Defaults to on; use --skip-%s to disable.)\n", name_space, "", optp->name); + printf("%*s(Defaults to on; use --skip-", name_space, ""); + print_name(optp); + printf(" to disable.)\n"); } } } @@ -1249,36 +1300,53 @@ void my_print_help(const struct my_option *options) void my_print_variables(const struct my_option *options) { uint name_space= 34, length, nr; - ulonglong bit, llvalue; + ulonglong llvalue; char buff[255]; const struct my_option *optp; - printf("\nVariables (--variable-name=value)\n"); - printf("and boolean options {FALSE|TRUE} Value (after reading options)\n"); - printf("--------------------------------- -----------------------------\n"); - for (optp= options; optp->id; optp++) + for (optp= options; optp->name; optp++) { - uchar* *value= (optp->var_type & GET_ASK_ADDR ? + length= strlen(optp->name)+1; + if (length > name_space) + name_space= length; + } + + printf("\nVariables (--variable-name=value)\n"); + printf("%-*s%s", name_space, "and boolean options {FALSE|TRUE}", + "Value (after reading options)\n"); + for (length=1; length < 75; length++) + putchar(length == name_space ? ' ' : '-'); + putchar('\n'); + + for (optp= options; optp->name; optp++) + { + uchar **value= (optp->var_type & GET_ASK_ADDR ? (*getopt_get_addr)("", 0, optp, 0) : optp->value); if (value) { - printf("%s ", optp->name); - length= (uint) strlen(optp->name)+1; + length= print_name(optp); for (; length < name_space; length++) putchar(' '); switch ((optp->var_type & GET_TYPE_MASK)) { case GET_SET: if (!(llvalue= *(ulonglong*) value)) - printf("%s\n", "(No default value)"); + printf("%s\n", ""); else - for (nr= 0, bit= 1; llvalue && nr < optp->typelib->count; nr++, bit<<=1) + for (nr= 0; llvalue && nr < optp->typelib->count; nr++, llvalue >>=1) { - if (!(bit & llvalue)) - continue; - llvalue&= ~bit; - printf( llvalue ? "%s," : "%s\n", get_type(optp->typelib, nr)); + if (llvalue & 1) + printf( llvalue > 1 ? "%s," : "%s\n", get_type(optp->typelib, nr)); } break; + case GET_FLAGSET: + llvalue= *(ulonglong*) value; + for (nr= 0; llvalue && nr < optp->typelib->count; nr++, llvalue >>=1) + { + printf("%s%s=", (nr ? "," : ""), get_type(optp->typelib, nr)); + printf(llvalue & 1 ? "on" : "off"); + } + printf("\n"); + break; case GET_ENUM: printf("%s\n", get_type(optp->typelib, *(uint*) value)); break; @@ -1312,6 +1380,9 @@ void my_print_variables(const struct my_option *options) case GET_DOUBLE: printf("%g\n", *(double*) value); break; + case GET_NO_ARG: + printf("(No default value)\n"); + break; default: printf("(Disabled)\n"); break; diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 675fa62380a..efe281ba1bb 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -158,7 +158,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); } DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", - sf_malloc_max_memory,lineno, filename)); + (long)sf_malloc_max_memory,lineno, filename)); if (MyFlags & MY_FAE) exit(1); DBUG_RETURN ((void*) 0); diff --git a/mysys/typelib.c b/mysys/typelib.c index cb72c91e20d..73dab610bed 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -20,7 +20,7 @@ #include -static const char field_separator=','; +#define is_field_separator(X) ((X) == ',' || (X) == '=') int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) { @@ -44,26 +44,26 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) } -/* +/** Search after a string in a list of strings. Endspace in x is not compared. - SYNOPSIS - find_type() - x String to find - lib TYPELIB (struct of pointer to values + count) - full_name bitmap of what to do - If & 1 accept only whole names - If & 2 don't expand if half field - If & 4 allow #number# as type - If & 8 use ',' as string terminator + @param x String to find + @param lib TYPELIB (struct of pointer to values + count) + @param full_name bitmap of what to do + If & 1 accept only whole names + If & 2 don't expand if half field + If & 4 allow #number# as type + If & 8 use ',' as string terminator - NOTES - If part, uniq field is found and full_name == 0 then x is expanded - to full field. + @note + If part, uniq field is found and full_name == 0 then x is expanded + to full field. - RETURN - -1 Too many matching values - 0 No matching value + @retval + -1 Too many matching values + @retval + 0 No matching value + @retval >0 Offset+1 in typelib for matched string */ @@ -86,17 +86,17 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) for (pos=0 ; (j=typelib->type_names[pos]) ; pos++) { for (i=x ; - *i && (!(full_name & 8) || *i != field_separator) && + *i && (!(full_name & 8) || !is_field_separator(*i)) && my_toupper(&my_charset_latin1,*i) == my_toupper(&my_charset_latin1,*j) ; i++, j++) ; if (! *j) { while (*i == ' ') i++; /* skip_end_space */ - if (! *i || ((full_name & 8) && *i == field_separator)) + if (! *i || ((full_name & 8) && is_field_separator(*i))) DBUG_RETURN(pos+1); } - if ((!*i && (!(full_name & 8) || *i != field_separator)) && + if ((!*i && (!(full_name & 8) || !is_field_separator(*i))) && (!*j || !(full_name & 1))) { find++; @@ -122,8 +122,12 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) } /* find_type */ - /* Get name of type nr 'nr' */ - /* Warning first type is 1, 0 = empty field */ +/** + Get name of type nr + + @note + first type is 1, 0 = empty field +*/ void make_type(register char * to, register uint nr, register TYPELIB *typelib) @@ -137,8 +141,12 @@ void make_type(register char * to, register uint nr, } /* make_type */ - /* Get type */ - /* Warning first type is 0 */ +/** + Get type + + @note + first type is 0 +*/ const char *get_type(TYPELIB *typelib, uint nr) { @@ -148,18 +156,16 @@ const char *get_type(TYPELIB *typelib, uint nr) } -/* +/** Create an integer value to represent the supplied comma-seperated string where each string in the TYPELIB denotes a bit position. - SYNOPSIS - find_typeset() - x string to decompose - lib TYPELIB (struct of pointer to values + count) - err index (not char position) of string element which was not + @param x string to decompose + @param lib TYPELIB (struct of pointer to values + count) + @param err index (not char position) of string element which was not found or 0 if there was no error - RETURN + @retval a integer representation of the supplied string */ @@ -182,9 +188,9 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) { (*err)++; i= x; - while (*x && *x != field_separator) + while (*x && !is_field_separator(*x)) x++; - if (x[0] && x[1]) /* skip separator if found */ + if (x[0] && x[1]) /* skip separator if found */ x++; if ((find= find_type(i, lib, 2 | 8) - 1) < 0) DBUG_RETURN(0); @@ -195,16 +201,15 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) } /* find_set */ -/* +/** Create a copy of a specified TYPELIB structure. - SYNOPSIS - copy_typelib() - root pointer to a MEM_ROOT object for allocations - from pointer to a source TYPELIB structure + @param root pointer to a MEM_ROOT object for allocations + @param from pointer to a source TYPELIB structure - RETURN - pointer to the new TYPELIB structure on successful copy, or + @retval + pointer to the new TYPELIB structure on successful copy + @retval NULL otherwise */ @@ -244,3 +249,140 @@ TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from) return to; } + + +static const char *on_off_default_names[]= { "off","on","default", 0}; +static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1, + "", on_off_default_names, 0}; + +/** + Parse a TYPELIB name from the buffer + + @param lib Set of names to scan for. + @param strpos INOUT Start of the buffer (updated to point to the next + character after the name) + @param end End of the buffer + + @note + The buffer is assumed to contain one of the names specified in the TYPELIB, + followed by comma, '=', or end of the buffer. + + @retval + 0 No matching name + @retval + >0 Offset+1 in typelib for matched name +*/ + +static uint parse_name(const TYPELIB *lib, const char **strpos, const char *end) +{ + const char *pos= *strpos; + uint find= find_type((char*)pos, lib, 8); + for (; pos != end && *pos != '=' && *pos !=',' ; pos++); + *strpos= pos; + return find; +} + +/** + Parse and apply a set of flag assingments + + @param lib Flag names + @param default_name Number of "default" in the typelib + @param cur_set Current set of flags (start from this state) + @param default_set Default set of flags (use this for assign-default + keyword and flag=default assignments) + @param str String to be parsed + @param length Length of the string + @param err_pos OUT If error, set to point to start of wrong set string + NULL on success + @param err_len OUT If error, set to the length of wrong set string + + @details + Parse a set of flag assignments, that is, parse a string in form: + + param_name1=value1,param_name2=value2,... + + where the names are specified in the TYPELIB, and each value can be + either 'on','off', or 'default'. Setting the same name twice is not + allowed. + + Besides param=val assignments, we support the "default" keyword (keyword + #default_name in the typelib). It can be used one time, if specified it + causes us to build the new set over the default_set rather than cur_set + value. + + @note + it's not charset aware + + @retval + Parsed set value if (*errpos == NULL), otherwise undefined +*/ + +my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, + my_ulonglong cur_set, my_ulonglong default_set, + const char *str, uint length, + char **err_pos, uint *err_len) +{ + const char *end= str + length; + my_ulonglong flags_to_set= 0, flags_to_clear= 0, res; + my_bool set_defaults= 0; + + *err_pos= 0; // No error yet + if (str != end) + { + const char *start= str; + for (;;) + { + const char *pos= start; + uint flag_no, value; + + if (!(flag_no= parse_name(lib, &pos, end))) + goto err; + + if (flag_no == default_name) + { + /* Using 'default' twice isn't allowed. */ + if (set_defaults) + goto err; + set_defaults= TRUE; + } + else + { + my_ulonglong bit= (1ULL << (flag_no - 1)); + /* parse the '=on|off|default' */ + if ((flags_to_clear | flags_to_set) & bit || + pos >= end || *pos++ != '=' || + !(value= parse_name(&on_off_default_typelib, &pos, end))) + goto err; + + if (value == 1) // this is '=off' + flags_to_clear|= bit; + else if (value == 2) // this is '=on' + flags_to_set|= bit; + else // this is '=default' + { + if (default_set & bit) + flags_to_set|= bit; + else + flags_to_clear|= bit; + } + } + if (pos >= end) + break; + + if (*pos++ != ',') + goto err; + + start=pos; + continue; + err: + *err_pos= (char*)start; + *err_len= end - start; + break; + } + } + res= set_defaults? default_set : cur_set; + res|= flags_to_set; + res&= ~flags_to_clear; + return res; +} + diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 95078a50097..0a09e945022 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -76,7 +76,7 @@ uint calc_days_in_year(uint year) */ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, - ulong flags, int *was_cut) + ulonglong flags, int *was_cut) { if (not_zero_date) { @@ -158,7 +158,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, enum enum_mysql_timestamp_type str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, - uint flags, int *was_cut) + ulonglong flags, int *was_cut) { uint field_length, UNINIT_VAR(year_length), digits, i, number_of_fields; uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; @@ -1109,7 +1109,7 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to) */ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, - uint flags, int *was_cut) + ulonglong flags, int *was_cut) { long part1,part2; diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt old mode 100755 new mode 100644 index 15c2d950ff9..82a94b64365 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -53,7 +53,7 @@ SET (SQL_SOURCE log_event.cc rpl_record.cc rpl_reporting.cc log_event_old.cc rpl_record_old.cc message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c - mysqld.cc net_serv.cc + mysqld.cc net_serv.cc keycaches.cc nt_servc.cc nt_servc.h opt_range.cc opt_range.h opt_sum.cc ../sql-common/pack.c parse_file.cc password.c procedure.cc protocol.cc records.cc repl_failsafe.cc rpl_filter.cc set_var.cc @@ -76,7 +76,7 @@ SET (SQL_SOURCE rpl_rli.cc rpl_mi.cc sql_servers.cc sql_connect.cc scheduler.cc sql_profile.cc event_parse_data.cc - sql_signal.cc rpl_handler.cc + sql_signal.cc rpl_handler.cc sys_vars.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h ${PROJECT_SOURCE_DIR}/include/mysqld_error.h diff --git a/sql/Makefile.am b/sql/Makefile.am index 15ee0d588c4..5f8bc8ef112 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -101,9 +101,9 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ sql_repl.h slave.h rpl_filter.h rpl_injector.h \ log_event.h rpl_record.h \ log_event_old.h rpl_record_old.h \ - sql_sort.h sql_cache.h set_var.h \ + sql_sort.h sql_cache.h set_var.h sys_vars_shared.h \ spatial.h gstream.h client_settings.h tzfile.h \ - tztime.h my_decimal.h\ + tztime.h my_decimal.h keycaches.h \ sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \ parse_file.h sql_view.h sql_trigger.h \ sql_array.h sql_cursor.h events.h scheduler.h \ @@ -112,7 +112,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ event_data_objects.h event_scheduler.h \ sql_partition.h partition_info.h partition_element.h \ contributors.h sql_servers.h sql_signal.h records.h \ - sql_prepare.h rpl_handler.h replication.h + sql_prepare.h rpl_handler.h replication.h sys_vars.h mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ @@ -125,7 +125,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ sql_string.cc sql_manager.cc sql_map.cc \ mysqld.cc password.c hash_filo.cc hostname.cc \ sql_connect.cc scheduler.cc sql_parse.cc \ - set_var.cc sql_yacc.yy \ + keycaches.cc set_var.cc sql_yacc.yy sys_vars.cc \ sql_base.cc table.cc sql_select.cc sql_insert.cc \ sql_profile.cc \ sql_prepare.cc sql_error.cc sql_locale.cc \ diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 3c8e24f6901..517aab93707 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1561,56 +1561,6 @@ static bool debug_sync_eval_action(THD *thd, char *action_str) DBUG_RETURN(FALSE); } - -/** - Check if the system variable 'debug_sync' can be set. - - @param[in] thd thread handle - @param[in] var set variable request - - @return status - @retval FALSE ok, variable can be set - @retval TRUE error, variable cannot be set -*/ - -bool sys_var_debug_sync::check(THD *thd, set_var *var) -{ - DBUG_ENTER("sys_var_debug_sync::check"); - DBUG_ASSERT(thd); - DBUG_ASSERT(var); - - /* - Variable can be set for the session only. - - This could be changed later. Then we need to have a global array of - actions in addition to the thread local ones. SET GLOBAL would - manage the global array, SET [SESSION] the local array. A sync point - would need to look for a local and a global action. Setting and - executing of global actions need to be protected by a mutex. - - The purpose of global actions could be to allow synchronizing with - connectionless threads that cannot execute SET statements. - */ - if (var->type == OPT_GLOBAL) - { - my_error(ER_LOCAL_VARIABLE, MYF(0), name); - DBUG_RETURN(TRUE); - } - - /* - Do not check for disabled facility. Test result should not - unnecessarily differ from enabled facility. - */ - - /* - Facility requires SUPER privilege. Sync points could be inside - global mutexes (e.g. LOCK_open). Waiting there forever would - stall the whole server. - */ - DBUG_RETURN(check_global_access(thd, SUPER_ACL)); -} - - /** Set the system variable 'debug_sync'. @@ -1631,28 +1581,9 @@ bool sys_var_debug_sync::check(THD *thd, set_var *var) terminators in the string. So we need to take a copy here. */ -bool sys_var_debug_sync::update(THD *thd, set_var *var) +bool debug_sync_update(THD *thd, char *val_str) { - char *val_str; - String *val_ptr; - String val_buf; - DBUG_ENTER("sys_var_debug_sync::update"); - DBUG_ASSERT(thd); - - /* - Depending on the value type (string literal, user variable, ...) - val_buf receives a copy of the value or not. But we always need - a copy. So we take a copy, if it is not done by val_str(). - If val_str() puts a copy into val_buf, then it returns &val_buf, - otherwise it returns a pointer to the string object that we need - to copy. - */ - val_ptr= var ? var->value->val_str(&val_buf) : &val_buf; - if (val_ptr != &val_buf) - { - val_buf.copy(*val_ptr); - } - val_str= val_buf.c_ptr(); + DBUG_ENTER("debug_sync_update"); DBUG_PRINT("debug_sync", ("set action: '%s'", val_str)); /* @@ -1669,8 +1600,6 @@ bool sys_var_debug_sync::update(THD *thd, set_var *var) Retrieve the value of the system variable 'debug_sync'. @param[in] thd thread handle - @param[in] type variable type, unused - @param[in] base variable base, unused @return string @retval != NULL ok, string pointer @@ -1683,13 +1612,10 @@ bool sys_var_debug_sync::update(THD *thd, set_var *var) When "ON", the current signal is added. */ -uchar *sys_var_debug_sync::value_ptr(THD *thd, - enum_var_type type __attribute__((unused)), - LEX_STRING *base __attribute__((unused))) +uchar *debug_sync_value_ptr(THD *thd) { char *value; - DBUG_ENTER("sys_var_debug_sync::value_ptr"); - DBUG_ASSERT(thd); + DBUG_ENTER("debug_sync_value_ptr"); if (opt_debug_sync_timeout) { @@ -1718,7 +1644,7 @@ uchar *sys_var_debug_sync::value_ptr(THD *thd, else { /* purecov: begin tested */ - value= strmake_root(thd->mem_root, STRING_WITH_LEN("OFF")); + value= const_cast("OFF"); /* purecov: end */ } diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 31bb3d39b85..00d03e04b70 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -188,7 +188,7 @@ pre_init_event_thread(THD* thd) thd->security_ctx->set_user((char*)"event_scheduler"); thd->net.read_timeout= slave_net_timeout; thd->slave_thread= 0; - thd->options|= OPTION_AUTO_IS_NULL; + thd->variables.option_bits|= OPTION_AUTO_IS_NULL; thd->client_capabilities|= CLIENT_MULTI_RESULTS; pthread_mutex_lock(&LOCK_thread_count); thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; diff --git a/sql/events.cc b/sql/events.cc index f5f837930c0..b0803ab57d0 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -20,6 +20,7 @@ #include "event_queue.h" #include "event_scheduler.h" #include "sp_head.h" // for Stored_program_creation_ctx +#include "set_var.h" /** @addtogroup Event_Scheduler @@ -63,43 +64,10 @@ eligible for execution. */ -/* - Keep the order of the first to as in var_typelib - sys_var_event_scheduler::value_ptr() references this array. Keep in - mind! -*/ -static const char *opt_event_scheduler_state_names[]= - { "OFF", "ON", "0", "1", "DISABLED", NullS }; - -const TYPELIB Events::opt_typelib= -{ - array_elements(opt_event_scheduler_state_names)-1, - "", - opt_event_scheduler_state_names, - NULL -}; - - -/* - The order should not be changed. We consider OFF to be equivalent of INT 0 - And ON of 1. If OFF & ON are interchanged the logic in - sys_var_event_scheduler::update() will be broken! -*/ -static const char *var_event_scheduler_state_names[]= { "OFF", "ON", NullS }; - -const TYPELIB Events::var_typelib= -{ - array_elements(var_event_scheduler_state_names)-1, - "", - var_event_scheduler_state_names, - NULL -}; - Event_queue *Events::event_queue; Event_scheduler *Events::scheduler; Event_db_repository *Events::db_repository; -enum Events::enum_opt_event_scheduler -Events::opt_event_scheduler= Events::EVENTS_OFF; +uint Events::opt_event_scheduler= Events::EVENTS_OFF; pthread_mutex_t Events::LOCK_event_metadata; bool Events::check_system_tables_error= FALSE; @@ -126,69 +94,6 @@ int sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs) } -/** - @brief Initialize the start up option of the Events scheduler. - - Do not initialize the scheduler subsystem yet - the initialization - is split into steps as it has to fit into the common MySQL - initialization framework. - No locking as this is called only at start up. - - @param[in,out] argument The value of the argument. If this value - is found in the typelib, the argument is - updated. - - @retval TRUE unknown option value - @retval FALSE success -*/ - -bool -Events::set_opt_event_scheduler(char *argument) -{ - if (argument == NULL) - opt_event_scheduler= Events::EVENTS_ON; - else - { - int type; - /* - type= 1 2 3 4 5 - (OFF | ON) - (0 | 1) (DISABLE ) - */ - const static enum enum_opt_event_scheduler type2state[]= - { EVENTS_OFF, EVENTS_ON, EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED }; - - type= find_type(argument, &opt_typelib, 1); - - DBUG_ASSERT(type >= 0 && type <= 5); /* guaranteed by find_type */ - - if (type == 0) - { - fprintf(stderr, "Unknown option to event-scheduler: %s\n", argument); - return TRUE; - } - opt_event_scheduler= type2state[type-1]; - } - return FALSE; -} - - -/** - Return a string representation of the current scheduler mode. -*/ - -const char * -Events::get_opt_event_scheduler_str() -{ - const char *str; - - pthread_mutex_lock(&LOCK_event_metadata); - str= opt_typelib.type_names[(int) opt_event_scheduler]; - pthread_mutex_unlock(&LOCK_event_metadata); - - return str; -} - - /** Push an error into the error stack if the system tables are not up to date. @@ -734,8 +639,7 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol) field_list.push_back(new Item_empty_string("Event", NAME_CHAR_LEN)); - if (sys_var_thd_sql_mode::symbolic_mode_representation(thd, et->sql_mode, - &sql_mode)) + if (sql_mode_string_representation(thd, et->sql_mode, &sql_mode)) DBUG_RETURN(TRUE); field_list.push_back(new Item_empty_string("sql_mode", (uint) sql_mode.length)); @@ -1091,60 +995,15 @@ Events::dump_internal_status() DBUG_VOID_RETURN; } - -/** - Starts or stops the event scheduler thread. - - @retval FALSE success - @retval TRUE error -*/ - -bool -Events::switch_event_scheduler_state(enum_opt_event_scheduler new_state) +bool Events::start() { - bool ret= FALSE; - - DBUG_ENTER("Events::switch_event_scheduler_state"); - - DBUG_ASSERT(new_state == Events::EVENTS_ON || - new_state == Events::EVENTS_OFF); - - /* - If the scheduler was disabled because there are no/bad - system tables, produce a more meaningful error message - than ER_OPTION_PREVENTS_STATEMENT - */ - if (check_if_system_tables_error()) - DBUG_RETURN(TRUE); - - pthread_mutex_lock(&LOCK_event_metadata); - - if (opt_event_scheduler == EVENTS_DISABLED) - { - my_error(ER_OPTION_PREVENTS_STATEMENT, - MYF(0), "--event-scheduler=DISABLED or --skip-grant-tables"); - ret= TRUE; - goto end; - } - - if (new_state == EVENTS_ON) - ret= scheduler->start(); - else - ret= scheduler->stop(); - - if (ret) - { - my_error(ER_EVENT_SET_VAR_ERROR, MYF(0)); - goto end; - } - - opt_event_scheduler= new_state; - -end: - pthread_mutex_unlock(&LOCK_event_metadata); - DBUG_RETURN(ret); + return scheduler->start(); } +bool Events::stop() +{ + return scheduler->stop(); +} /** Loads all ENABLED events from mysql.event into a prioritized diff --git a/sql/events.h b/sql/events.h index 2bc87517748..8f68d5a8029 100644 --- a/sql/events.h +++ b/sql/events.h @@ -56,7 +56,7 @@ sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs); The life cycle of the Events module is the following: At server start up: - set_opt_event_scheduler() -> init_mutexes() -> init() + init_mutexes() -> init() When the server is running: create_event(), drop_event(), start_or_stop_event_scheduler(), etc At shutdown: @@ -70,23 +70,19 @@ sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs); class Events { public: - /* The order should match the order in opt_typelib */ - enum enum_opt_event_scheduler - { - EVENTS_OFF= 0, - EVENTS_ON= 1, - EVENTS_DISABLED= 4 - }; - - /* Possible values of @@event_scheduler variable */ - static const TYPELIB var_typelib; - - static bool - set_opt_event_scheduler(char *argument); - - static const char * - get_opt_event_scheduler_str(); + /* + the following block is to support --event-scheduler command line option + and the @@global.event_scheduler SQL variable. + See sys_var.cc + */ + enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED }; + static uint opt_event_scheduler; + static pthread_mutex_t LOCK_event_metadata; + static bool check_if_system_tables_error(); + static bool start(); + static bool stop(); +public: /* A hack needed for Event_queue_element */ static Event_db_repository * get_db_repository() { return db_repository; } @@ -134,20 +130,14 @@ public: dump_internal_status(); private: - static bool check_if_system_tables_error(); static bool load_events_from_db(THD *thd); private: - /* Command line option names */ - static const TYPELIB opt_typelib; - static pthread_mutex_t LOCK_event_metadata; static Event_queue *event_queue; static Event_scheduler *scheduler; static Event_db_repository *db_repository; - /* Current state of Event Scheduler */ - static enum enum_opt_event_scheduler opt_event_scheduler; /* Set to TRUE if an error at start up */ static bool check_system_tables_error; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 1103683b56c..b820b6d939d 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -56,26 +56,125 @@ int ha_ndb_dummy; #define assert(x) do { if(x) break; ::printf("%s %d: assert failed: %s\n", __FILE__, __LINE__, #x); ::fflush(stdout); ::signal(SIGABRT,SIG_DFL); ::abort(); ::kill(::getpid(),6); ::kill(::getpid(),9); } while (0) #endif -// options from from mysqld.cc -extern my_bool opt_ndb_optimized_node_selection; -extern const char *opt_ndbcluster_connectstring; -extern ulong opt_ndb_cache_check_time; +// ndb interface initialization/cleanup functions +extern "C" void ndb_init_internal(); +extern "C" void ndb_end_internal(); -// ndb interface initialization/cleanup -#ifdef __cplusplus -extern "C" { -#endif -extern void ndb_init_internal(); -extern void ndb_end_internal(); -#ifdef __cplusplus -} -#endif +static const int DEFAULT_PARALLELISM= 0; +static const ha_rows DEFAULT_AUTO_PREFETCH= 32; +static const ulong ONE_YEAR_IN_SECONDS= (ulong) 3600L*24L*365L; -const char *ndb_distribution_names[]= {"KEYHASH", "LINHASH", NullS}; -TYPELIB ndb_distribution_typelib= { array_elements(ndb_distribution_names)-1, - "", ndb_distribution_names, NULL }; -const char *opt_ndb_distribution= ndb_distribution_names[ND_KEYHASH]; -enum ndb_distribution opt_ndb_distribution_id= ND_KEYHASH; +ulong opt_ndb_extra_logging; +static ulong opt_ndb_cache_check_time; +static char* opt_ndb_connectstring; +static char* opt_ndb_mgmd_host; +static uint opt_ndb_nodeid; + + +static MYSQL_THDVAR_UINT( + autoincrement_prefetch_sz, /* name */ + PLUGIN_VAR_RQCMDARG, + "Specify number of autoincrement values that are prefetched.", + NULL, /* check func. */ + NULL, /* update func. */ + 1, /* default */ + 1, /* min */ + 256, /* max */ + 0 /* block */ +); + + +static MYSQL_THDVAR_BOOL( + force_send, /* name */ + PLUGIN_VAR_OPCMDARG, + "Force send of buffers to ndb immediately without waiting for " + "other threads.", + NULL, /* check func. */ + NULL, /* update func. */ + 1 /* default */ +); + + +static MYSQL_THDVAR_BOOL( + use_exact_count, /* name */ + PLUGIN_VAR_OPCMDARG, + "Use exact records count during query planning and for fast " + "select count(*), disable for faster queries.", + NULL, /* check func. */ + NULL, /* update func. */ + 1 /* default */ +); + + +static MYSQL_THDVAR_BOOL( + use_transactions, /* name */ + PLUGIN_VAR_OPCMDARG, + "Use transactions for large inserts, if enabled then large " + "inserts will be split into several smaller transactions", + NULL, /* check func. */ + NULL, /* update func. */ + 1 /* default */ +); + + +static MYSQL_THDVAR_BOOL( + use_copying_alter_table, /* name */ + PLUGIN_VAR_OPCMDARG, + "Force ndbcluster to always copy tables at alter table (should " + "only be used if on-line alter table fails).", + NULL, /* check func. */ + NULL, /* update func. */ + 0 /* default */ +); + + +static MYSQL_THDVAR_UINT( + optimized_node_selection, /* name */ + PLUGIN_VAR_OPCMDARG, + "Select nodes for transactions in a more optimal way.", + NULL, /* check func. */ + NULL, /* update func. */ + 3, /* default */ + 0, /* min */ + 3, /* max */ + 0 /* block */ +); + + +static MYSQL_THDVAR_BOOL( + index_stat_enable, /* name */ + PLUGIN_VAR_OPCMDARG, + "Use ndb index statistics in query optimization.", + NULL, /* check func. */ + NULL, /* update func. */ + FALSE /* default */ +); + + +static MYSQL_THDVAR_ULONG( + index_stat_cache_entries, /* name */ + PLUGIN_VAR_NOCMDARG, + "", + NULL, /* check func. */ + NULL, /* update func. */ + 32, /* default */ + 0, /* min */ + ULONG_MAX, /* max */ + 0 /* block */ +); + + +static MYSQL_THDVAR_ULONG( + index_stat_update_freq, /* name */ + PLUGIN_VAR_NOCMDARG, + "", + NULL, /* check func. */ + NULL, /* update func. */ + 20, /* default */ + 0, /* min */ + ULONG_MAX, /* max */ + 0 /* block */ +); // Default value for parallelism static const int parallelism= 0; @@ -186,7 +285,6 @@ pthread_mutex_t LOCK_ndb_util_thread; pthread_cond_t COND_ndb_util_thread; pthread_cond_t COND_ndb_util_ready; pthread_handler_t ndb_util_thread_func(void *arg); -ulong ndb_cache_check_time; /** Dummy buffer to read zero pack_length fields @@ -321,7 +419,7 @@ int execute_commit(THD *thd, NdbTransaction *trans) { return trans->execute(NdbTransaction::Commit, NdbOperation::AbortOnError, - thd->variables.ndb_force_send); + THDVAR(thd, force_send)); } inline @@ -1250,11 +1348,11 @@ int ha_ndbcluster::add_index_handle(THD *thd, NDBDICT *dict, KEY *key_info, NDB_INDEX_DATA& d=m_index[index_no]; delete d.index_stat; d.index_stat=NULL; - if (thd->variables.ndb_index_stat_enable) + if (THDVAR(thd, index_stat_enable)) { d.index_stat=new NdbIndexStat(index); - d.index_stat_cache_entries=thd->variables.ndb_index_stat_cache_entries; - d.index_stat_update_freq=thd->variables.ndb_index_stat_update_freq; + d.index_stat_cache_entries=THDVAR(thd, index_stat_cache_entries); + d.index_stat_update_freq=THDVAR(thd, index_stat_update_freq); d.index_stat_query_count=0; d.index_stat->alloc_cache(d.index_stat_cache_entries); DBUG_PRINT("info", ("index %s stat=on cache_entries=%u update_freq=%u", @@ -1314,10 +1412,12 @@ int ha_ndbcluster::open_indexes(Ndb *ndb, TABLE *tab, bool ignore_error) for (i= 0; i < tab->s->keys; i++, key_info++, key_name++) { if ((error= add_index_handle(thd, dict, key_info, *key_name, i))) + { if (ignore_error) m_index[i].index= m_index[i].unique_index= NULL; else break; + } m_index[i].null_in_unique_index= FALSE; if (check_index_fields_not_null(key_info)) m_index[i].null_in_unique_index= TRUE; @@ -4082,7 +4182,7 @@ int ha_ndbcluster::info(uint flag) { DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM); } - if (current_thd->variables.ndb_use_exact_count && + if (THDVAR(current_thd, use_exact_count) && (result= ndb_get_table_statistics(this, TRUE, ndb, m_table, &stat)) == 0) { @@ -4412,12 +4512,12 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd, #ifndef DBUG_OFF #define PRINT_OPTION_FLAGS(t) { \ - if (t->options & OPTION_NOT_AUTOCOMMIT) \ - DBUG_PRINT("thd->options", ("OPTION_NOT_AUTOCOMMIT")); \ - if (t->options & OPTION_BEGIN) \ - DBUG_PRINT("thd->options", ("OPTION_BEGIN")); \ - if (t->options & OPTION_TABLE_LOCK) \ - DBUG_PRINT("thd->options", ("OPTION_TABLE_LOCK")); \ + if (t->variables.option_bits & OPTION_NOT_AUTOCOMMIT) \ + DBUG_PRINT("thd->variables.option_bits", ("OPTION_NOT_AUTOCOMMIT")); \ + if (t->variables.option_bits & OPTION_BEGIN) \ + DBUG_PRINT("thd->variables.option_bits", ("OPTION_BEGIN")); \ + if (t->variables.option_bits & OPTION_TABLE_LOCK) \ + DBUG_PRINT("thd->variables.option_bits", ("OPTION_TABLE_LOCK")); \ } #else #define PRINT_OPTION_FLAGS(t) @@ -4504,7 +4604,7 @@ void ha_ndbcluster::transaction_checks(THD *thd) else if (!thd->transaction.on) m_transaction_on= FALSE; else - m_transaction_on= thd->variables.ndb_use_transactions; + m_transaction_on= THDVAR(thd, use_transactions); } int ha_ndbcluster::start_statement(THD *thd, @@ -4517,7 +4617,7 @@ int ha_ndbcluster::start_statement(THD *thd, trans_register_ha(thd, FALSE, ndbcluster_hton); if (!thd_ndb->trans) { - if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) trans_register_ha(thd, TRUE, ndbcluster_hton); DBUG_PRINT("trans",("Starting transaction")); thd_ndb->trans= ndb->startTransaction(); @@ -4527,7 +4627,7 @@ int ha_ndbcluster::start_statement(THD *thd, thd_ndb->query_state&= NDB_QUERY_NORMAL; thd_ndb->trans_options= 0; thd_ndb->m_slow_path= FALSE; - if (!(thd->options & OPTION_BIN_LOG) || + if (!(thd->variables.option_bits & OPTION_BIN_LOG) || thd->variables.binlog_format == BINLOG_FORMAT_STMT) { thd_ndb->trans_options|= TNTO_NO_LOGGING; @@ -4542,7 +4642,7 @@ int ha_ndbcluster::start_statement(THD *thd, Check if it should be read or write lock */ - if (thd->options & (OPTION_TABLE_LOCK)) + if (thd->variables.option_bits & OPTION_TABLE_LOCK) { //lockThisTable(); DBUG_PRINT("info", ("Locking the table..." )); @@ -4566,13 +4666,13 @@ int ha_ndbcluster::init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb) DBUG_ENTER("ha_ndbcluster::init_handler_for_statement"); // store thread specific data first to set the right context - m_force_send= thd->variables.ndb_force_send; - m_ha_not_exact_count= !thd->variables.ndb_use_exact_count; + m_force_send= THDVAR(thd, force_send); + m_ha_not_exact_count= !THDVAR(thd, use_exact_count); m_autoincrement_prefetch= - (thd->variables.ndb_autoincrement_prefetch_sz > - NDB_DEFAULT_AUTO_PREFETCH) ? - (ha_rows) thd->variables.ndb_autoincrement_prefetch_sz - : (ha_rows) NDB_DEFAULT_AUTO_PREFETCH; + (THDVAR(thd, autoincrement_prefetch_sz) > + DEFAULT_AUTO_PREFETCH) ? + (ha_rows) THDVAR(thd, autoincrement_prefetch_sz) + : (ha_rows) DEFAULT_AUTO_PREFETCH; m_active_trans= thd_ndb->trans; DBUG_ASSERT(m_active_trans); // Start of transaction @@ -4587,7 +4687,7 @@ int ha_ndbcluster::init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb) } #endif - if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) { const void *key= m_table; HASH_SEARCH_STATE state; @@ -4668,10 +4768,10 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) { DBUG_PRINT("info", ("lock_type == F_UNLCK")); - if (ndb_cache_check_time && m_rows_changed) + if (opt_ndb_cache_check_time && m_rows_changed) { DBUG_PRINT("info", ("Rows has changed and util thread is running")); - if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) { DBUG_PRINT("info", ("Add share to list of tables to be invalidated")); /* NOTE push_back allocates memory using transactions mem_root! */ @@ -4690,7 +4790,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_PRINT("trans", ("Last external_lock")); PRINT_OPTION_FLAGS(thd); - if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) + if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { if (thd_ndb->trans) { @@ -4801,7 +4901,7 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all) DBUG_PRINT("enter", ("Commit %s", (all ? "all" : "stmt"))); thd_ndb->start_stmt_count= 0; if (trans == NULL || (!all && - thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) + thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { /* An odditity in the handler interface is that commit on handlerton @@ -4871,7 +4971,7 @@ static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all) DBUG_ASSERT(ndb); thd_ndb->start_stmt_count= 0; if (trans == NULL || (!all && - thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) + thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { /* Ignore end-of-statement until real rollback or commit is called */ DBUG_PRINT("info", ("Rollback before start or end-of-statement only")); @@ -5567,7 +5667,7 @@ int ha_ndbcluster::create(const char *name, if (!ndbcluster_create_event(ndb, m_table, event_name.c_ptr(), share, share && do_event_op ? 2 : 1/* push warning */)) { - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: CREATE TABLE Event: %s", event_name.c_ptr()); if (share && @@ -6010,7 +6110,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) if (!ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share, share && ndb_binlog_running ? 2 : 1/* push warning */)) { - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: RENAME Event: %s", event_name.c_ptr()); if (share && @@ -6313,10 +6413,9 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment, m_rows_to_insert+= m_autoincrement_prefetch; } uint remaining= m_rows_to_insert - m_rows_inserted; + ha_rows prefetch= THDVAR(thd, autoincrement_prefetch_sz); uint min_prefetch= - (remaining < thd->variables.ndb_autoincrement_prefetch_sz) ? - thd->variables.ndb_autoincrement_prefetch_sz - : remaining; + (remaining < prefetch) ? prefetch : remaining; cache_size= ((remaining < m_autoincrement_prefetch) ? min_prefetch : remaining); @@ -6406,7 +6505,7 @@ ha_ndbcluster::ha_ndbcluster(handlerton *hton, TABLE_SHARE *table_arg): m_dupkey((uint) -1), m_ha_not_exact_count(FALSE), m_force_send(TRUE), - m_autoincrement_prefetch((ha_rows) NDB_DEFAULT_AUTO_PREFETCH), + m_autoincrement_prefetch(DEFAULT_AUTO_PREFETCH), m_transaction_on(TRUE), m_cond(NULL), m_multi_cursor(NULL) @@ -7417,17 +7516,31 @@ static int ndbcluster_init(void *p) h->table_exists_in_engine= ndbcluster_table_exists_in_engine; } + // Format the connect string to be used for connecting to the cluster + int pos= 0; + char connectstring_buf[1024] = {0}; + if (opt_ndb_nodeid != 0) + pos+= my_snprintf(connectstring_buf, sizeof(connectstring_buf), + "nodeid=%u", opt_ndb_nodeid); + if (opt_ndb_mgmd_host) + pos+= my_snprintf(connectstring_buf+pos, sizeof(connectstring_buf)-pos, + "%s%s", pos ? "," : "", opt_ndb_mgmd_host); + if (opt_ndb_connectstring) + pos+= my_snprintf(connectstring_buf+pos, sizeof(connectstring_buf)-pos, + "%s%s", pos ? "," : "", opt_ndb_connectstring); + + // Initialize ndb interface ndb_init_internal(); // Set connectstring if specified - if (opt_ndbcluster_connectstring != 0) - DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring)); + if (opt_ndb_connectstring != 0) + DBUG_PRINT("connectstring", ("%s", opt_ndb_connectstring)); if ((g_ndb_cluster_connection= - new Ndb_cluster_connection(opt_ndbcluster_connectstring)) == 0) + new Ndb_cluster_connection(opt_ndb_connectstring)) == 0) { DBUG_PRINT("error",("Ndb_cluster_connection(%s)", - opt_ndbcluster_connectstring)); + opt_ndb_connectstring)); my_errno= HA_ERR_OUT_OF_MEM; goto ndbcluster_init_error; } @@ -7437,7 +7550,7 @@ static int ndbcluster_init(void *p) g_ndb_cluster_connection->set_name(buf); } g_ndb_cluster_connection->set_optimized_node_selection - (opt_ndb_optimized_node_selection); + (THDVAR(0, optimized_node_selection)); // Create a Ndb object to open the connection to NDB if ( (g_ndb= new Ndb(g_ndb_cluster_connection, "sys")) == 0 ) @@ -7493,7 +7606,6 @@ static int ndbcluster_init(void *p) goto ndbcluster_init_error; #endif /* HAVE_NDB_BINLOG */ - ndb_cache_check_time = opt_ndb_cache_check_time; // Create utility thread pthread_t tmp; if (pthread_create(&tmp, &connection_attrib, ndb_util_thread_func, 0)) @@ -7953,7 +8065,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, pthread_mutex_unlock(&ndbcluster_mutex); pthread_mutex_lock(&share->mutex); - if (ndb_cache_check_time > 0) + if (opt_ndb_cache_check_time > 0) { if (share->commit_count != 0) { @@ -8056,7 +8168,7 @@ ndbcluster_cache_retrieval_allowed(THD *thd, ulonglong *engine_data) { Uint64 commit_count; - bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + bool is_autocommit= !(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); char *dbname= full_name; char *tabname= dbname+strlen(dbname)+1; #ifndef DBUG_OFF @@ -8131,7 +8243,7 @@ ha_ndbcluster::register_query_cache_table(THD *thd, #ifndef DBUG_OFF char buff[22]; #endif - bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + bool is_autocommit= !(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); DBUG_ENTER("ha_ndbcluster::register_query_cache_table"); DBUG_PRINT("enter",("dbname: %s, tabname: %s, is_autocommit: %d", m_dbname, m_tabname, is_autocommit)); @@ -8255,7 +8367,7 @@ int handle_trailing_share(NDB_SHARE *share) share->key, share->use_count)); if (!--share->use_count) { - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB_SHARE: trailing share " "%s(connect_count: %u) " "released by close_cached_tables at " @@ -8281,7 +8393,7 @@ int handle_trailing_share(NDB_SHARE *share) if (share->use_count == 0) { - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB_SHARE: trailing share " "%s(connect_count: %u) " "released after NSS_DROPPED check " @@ -9287,7 +9399,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) my_thread_init(); DBUG_ENTER("ndb_util_thread"); - DBUG_PRINT("enter", ("ndb_cache_check_time: %lu", ndb_cache_check_time)); + DBUG_PRINT("enter", ("cache_check_time: %lu", opt_ndb_cache_check_time)); pthread_mutex_lock(&LOCK_ndb_util_thread); @@ -9367,7 +9479,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) thd_ndb->options|= TNO_NO_LOG_SCHEMA_OP; #ifdef HAVE_NDB_BINLOG - if (ndb_extra_logging && ndb_binlog_running) + if (opt_ndb_extra_logging && ndb_binlog_running) sql_print_information("NDB Binlog: Ndb tables initially read only."); /* create tables needed by the replication */ ndbcluster_setup_binlog_table_shares(thd); @@ -9390,8 +9502,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) goto ndb_util_thread_end; pthread_mutex_unlock(&LOCK_ndb_util_thread); #ifdef NDB_EXTRA_DEBUG_UTIL_THREAD - DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %lu", - ndb_cache_check_time)); + DBUG_PRINT("ndb_util_thread", ("Started, opt_ndb_cache_check_time: %lu", + opt_ndb_cache_check_time)); #endif #ifdef HAVE_NDB_BINLOG @@ -9404,7 +9516,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ndbcluster_setup_binlog_table_shares(thd); #endif - if (ndb_cache_check_time == 0) + if (opt_ndb_cache_check_time == 0) { /* Wake up in 1 second to check if value has changed */ set_timespec(abstime, 1); @@ -9520,7 +9632,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) next: /* Calculate new time to wake up */ int secs= 0; - int msecs= ndb_cache_check_time; + int msecs= opt_ndb_cache_check_time; struct timeval tick_time; gettimeofday(&tick_time, 0); @@ -9796,12 +9908,33 @@ int ha_ndbcluster::get_default_no_partitions(HA_CREATE_INFO *create_info) and partition by hidden key otherwise. */ + +enum ndb_distribution_enum { ND_KEYHASH= 0, ND_LINHASH= 1 }; +static const char* distribution_names[]= { "KEYHASH", "LINHASH", NullS }; +static ulong default_ndb_distribution= ND_KEYHASH; +static TYPELIB distribution_typelib= { + array_elements(distribution_names) - 1, + "", + distribution_names, + NULL +}; +static MYSQL_SYSVAR_ENUM( + distribution, /* name */ + default_ndb_distribution, /* var */ + PLUGIN_VAR_RQCMDARG, + "Default distribution for new tables in ndb", + NULL, /* check func. */ + NULL, /* update func. */ + ND_KEYHASH, /* default */ + &distribution_typelib /* typelib */ +); + void ha_ndbcluster::set_auto_partitions(partition_info *part_info) { DBUG_ENTER("ha_ndbcluster::set_auto_partitions"); part_info->list_of_part_fields= TRUE; part_info->part_type= HASH_PARTITION; - switch (opt_ndb_distribution_id) + switch (default_ndb_distribution) { case ND_KEYHASH: part_info->linear_hash_ind= FALSE; @@ -10037,7 +10170,7 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info, uint i; const NDBTAB *tab= (const NDBTAB *) m_table; - if (current_thd->variables.ndb_use_copying_alter_table) + if (THDVAR(current_thd, use_copying_alter_table)) { DBUG_PRINT("info", ("On-line alter table disabled")); DBUG_RETURN(COMPATIBLE_DATA_NO); @@ -10669,6 +10802,132 @@ SHOW_VAR ndb_status_variables_export[]= { {NullS, NullS, SHOW_LONG} }; +static MYSQL_SYSVAR_ULONG( + cache_check_time, /* name */ + opt_ndb_cache_check_time, /* var */ + PLUGIN_VAR_RQCMDARG, + "A dedicated thread is created to, at the given " + "millisecond interval, invalidate the query cache " + "if another MySQL server in the cluster has changed " + "the data in the database.", + NULL, /* check func. */ + NULL, /* update func. */ + 0, /* default */ + 0, /* min */ + ONE_YEAR_IN_SECONDS, /* max */ + 0 /* block */ +); + + +static MYSQL_SYSVAR_ULONG( + extra_logging, /* name */ + opt_ndb_extra_logging, /* var */ + PLUGIN_VAR_OPCMDARG, + "Turn on more logging in the error log.", + NULL, /* check func. */ + NULL, /* update func. */ + 1, /* default */ + 0, /* min */ + 0, /* max */ + 0 /* block */ +); + + +ulong opt_ndb_report_thresh_binlog_epoch_slip; +static MYSQL_SYSVAR_ULONG( + report_thresh_binlog_epoch_slip, /* name */ + opt_ndb_report_thresh_binlog_epoch_slip,/* var */ + PLUGIN_VAR_RQCMDARG, + "Threshold on number of epochs to be behind before reporting binlog " + "status. E.g. 3 means that if the difference between what epoch has " + "been received from the storage nodes and what has been applied to " + "the binlog is 3 or more, a status message will be sent to the cluster " + "log.", + NULL, /* check func. */ + NULL, /* update func. */ + 3, /* default */ + 0, /* min */ + 256, /* max */ + 0 /* block */ +); + + +ulong opt_ndb_report_thresh_binlog_mem_usage; +static MYSQL_SYSVAR_ULONG( + report_thresh_binlog_mem_usage, /* name */ + opt_ndb_report_thresh_binlog_mem_usage,/* var */ + PLUGIN_VAR_RQCMDARG, + "Threshold on percentage of free memory before reporting binlog " + "status. E.g. 10 means that if amount of available memory for " + "receiving binlog data from the storage nodes goes below 10%, " + "a status message will be sent to the cluster log.", + NULL, /* check func. */ + NULL, /* update func. */ + 10, /* default */ + 0, /* min */ + 100, /* max */ + 0 /* block */ +); + + +static MYSQL_SYSVAR_STR( + connectstring, /* name */ + opt_ndb_connectstring, /* var */ + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Connect string for ndbcluster.", + NULL, /* check func. */ + NULL, /* update func. */ + NULL /* default */ +); + + +static MYSQL_SYSVAR_STR( + mgmd_host, /* name */ + opt_ndb_mgmd_host, /* var */ + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Set host and port for ndb_mgmd. Syntax: hostname[:port]", + NULL, /* check func. */ + NULL, /* update func. */ + NULL /* default */ +); + + +static MYSQL_SYSVAR_UINT( + nodeid, /* name */ + opt_ndb_nodeid, /* var */ + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Nodeid for this mysqld in the cluster.", + NULL, /* check func. */ + NULL, /* update func. */ + 0, /* default */ + 0, /* min */ + 255, /* max */ + 0 /* block */ +); + +static struct st_mysql_sys_var* system_variables[]= { + MYSQL_SYSVAR(cache_check_time), + MYSQL_SYSVAR(extra_logging), + MYSQL_SYSVAR(report_thresh_binlog_mem_usage), + MYSQL_SYSVAR(report_thresh_binlog_epoch_slip), + MYSQL_SYSVAR(distribution), + MYSQL_SYSVAR(autoincrement_prefetch_sz), + MYSQL_SYSVAR(force_send), + MYSQL_SYSVAR(use_exact_count), + MYSQL_SYSVAR(use_transactions), + MYSQL_SYSVAR(use_copying_alter_table), + MYSQL_SYSVAR(optimized_node_selection), + MYSQL_SYSVAR(index_stat_enable), + MYSQL_SYSVAR(index_stat_cache_entries), + MYSQL_SYSVAR(index_stat_update_freq), + MYSQL_SYSVAR(connectstring), + MYSQL_SYSVAR(mgmd_host), + MYSQL_SYSVAR(nodeid), + + NULL +}; + + struct st_mysql_storage_engine ndbcluster_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; @@ -10684,7 +10943,7 @@ mysql_declare_plugin(ndbcluster) NULL, /* Plugin Deinit */ 0x0100 /* 1.0 */, ndb_status_variables_export,/* status variables */ - NULL, /* system variables */ + system_variables, /* system variables */ NULL /* config options */ } mysql_declare_plugin_end; diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index ac3e7329136..a51dc38bf93 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -34,7 +34,6 @@ #include #define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 -#define NDB_DEFAULT_AUTO_PREFETCH 32 class Ndb; // Forward declaration @@ -50,11 +49,6 @@ class ha_ndbcluster_cond; // connectstring to cluster if given by mysqld extern const char *ndbcluster_connectstring; -extern ulong ndb_cache_check_time; -#ifdef HAVE_NDB_BINLOG -extern ulong ndb_report_thresh_binlog_epoch_slip; -extern ulong ndb_report_thresh_binlog_mem_usage; -#endif typedef enum ndb_index_type { UNDEFINED_INDEX = 0, diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index bdbb57224b0..b59e686d131 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -33,6 +33,8 @@ #define assert(x) do { if(x) break; ::printf("%s %d: assert failed: %s\n", __FILE__, __LINE__, #x); ::fflush(stdout); ::signal(SIGABRT,SIG_DFL); ::abort(); ::kill(::getpid(),6); ::kill(::getpid(),9); } while (0) #endif +extern my_bool opt_ndb_log_binlog_index; +extern ulong opt_ndb_extra_logging; /* defines for cluster replication table names */ @@ -44,14 +46,16 @@ Timeout for syncing schema events between mysql servers, and between mysql server and the binlog */ -const int opt_ndb_sync_timeout= 120; +static const int DEFAULT_SYNC_TIMEOUT= 120; + /* Flag showing if the ndb injector thread is running, if so == 1 -1 if it was started but later stopped for some reason 0 if never started */ -int ndb_binlog_thread_running= 0; +static int ndb_binlog_thread_running= 0; + /* Flag showing if the ndb binlog should be created, if so == TRUE FALSE if not @@ -247,8 +251,8 @@ static void run_query(THD *thd, char *buf, char *end, struct system_status_var save_thd_status_var= thd->status_var; THD_TRANS save_thd_transaction_all= thd->transaction.all; THD_TRANS save_thd_transaction_stmt= thd->transaction.stmt; - ulonglong save_thd_options= thd->options; - DBUG_ASSERT(sizeof(save_thd_options) == sizeof(thd->options)); + ulonglong save_thd_options= thd->variables.option_bits; + DBUG_ASSERT(sizeof(save_thd_options) == sizeof(thd->variables.option_bits)); NET save_thd_net= thd->net; const char* found_semicolon= NULL; @@ -257,7 +261,7 @@ static void run_query(THD *thd, char *buf, char *end, thd->variables.pseudo_thread_id= thread_id; thd->transaction.stmt.modified_non_trans_table= FALSE; if (disable_binlog) - thd->options&= ~OPTION_BIN_LOG; + thd->variables.option_bits&= ~OPTION_BIN_LOG; DBUG_PRINT("query", ("%s", thd->query())); @@ -295,7 +299,7 @@ static void run_query(THD *thd, char *buf, char *end, */ thd->stmt_da->reset_diagnostics_area(); - thd->options= save_thd_options; + thd->variables.option_bits= save_thd_options; thd->set_query(save_thd_query, save_thd_query_length); thd->variables.pseudo_thread_id= save_thread_id; thd->status_var= save_thd_status_var; @@ -788,7 +792,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd) char buf[1024 + 1], *end; - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_APPLY_TABLE); /* @@ -846,7 +850,7 @@ static int ndbcluster_create_schema_table(THD *thd) char buf[1024 + 1], *end; - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_SCHEMA_TABLE); /* @@ -919,7 +923,7 @@ int ndbcluster_setup_binlog_table_shares(THD *thd) { mysql_mutex_lock(&LOCK_open); ndb_binlog_tables_inited= TRUE; - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: ndb tables writable"); close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE); mysql_mutex_unlock(&LOCK_open); @@ -1498,7 +1502,7 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, r|= op->setValue(SCHEMA_TYPE_I, log_type); DBUG_ASSERT(r == 0); /* any value */ - if (!(thd->options & OPTION_BIN_LOG)) + if (!(thd->variables.option_bits & OPTION_BIN_LOG)) r|= op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); else r|= op->setAnyValue(thd->server_id); @@ -1561,7 +1565,7 @@ end: else dict->forceGCPWait(); - int max_timeout= opt_ndb_sync_timeout; + int max_timeout= DEFAULT_SYNC_TIMEOUT; (void) pthread_mutex_lock(&ndb_schema_object->mutex); if (have_lock_open) { @@ -1618,7 +1622,7 @@ end: type_str, ndb_schema_object->key); break; } - if (ndb_extra_logging) + if (opt_ndb_extra_logging) ndb_report_waiting(type_str, max_timeout, "distributing", ndb_schema_object->key); } @@ -1767,7 +1771,7 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, DBUG_PRINT("info", ("Detected name change of table %s.%s", share->db, share->table_name)); /* ToDo: remove printout */ - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: rename table %s%s/%s -> %s.", share_prefix, share->table->s->db.str, share->table->s->table_name.str, @@ -2057,12 +2061,12 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, // skip break; case NDBEVENT::TE_CLUSTER_FAILURE: - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: cluster failure for %s at epoch %u.", ndb_schema_share->key, (unsigned) pOp->getGCI()); // fall through case NDBEVENT::TE_DROP: - if (ndb_extra_logging && + if (opt_ndb_extra_logging && ndb_binlog_tables_inited && ndb_binlog_running) sql_print_information("NDB Binlog: ndb tables initially " "read only on reconnect."); @@ -2091,7 +2095,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, (void) pthread_mutex_lock(&tmp_share->mutex); bitmap_clear_all(&tmp_share->subscriber_bitmap[node_id]); DBUG_PRINT("info",("NODE_FAILURE UNSUBSCRIBE[%d]", node_id)); - if (ndb_extra_logging) + if (opt_ndb_extra_logging) { sql_print_information("NDB Binlog: Node: %d, down," " Subscriber bitmask %x%x", @@ -2111,7 +2115,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, (void) pthread_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 (ndb_extra_logging) + if (opt_ndb_extra_logging) { sql_print_information("NDB Binlog: Node: %d, subscribe from node %d," " Subscriber bitmask %x%x", @@ -2132,7 +2136,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, (void) pthread_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 (ndb_extra_logging) + if (opt_ndb_extra_logging) { sql_print_information("NDB Binlog: Node: %d, unsubscribe from node %d," " Subscriber bitmask %x%x", @@ -2369,8 +2373,8 @@ int ndb_add_ndb_binlog_index(THD *thd, void *_row) Turn of binlogging to prevent the table changes to be written to the binary log. */ - ulong saved_options= thd->options; - thd->options&= ~(OPTION_BIN_LOG); + ulong saved_options= thd->variables.option_bits; + thd->variables.option_bits&= ~OPTION_BIN_LOG; for ( ; ; ) /* loop for need_reopen */ { @@ -2420,12 +2424,12 @@ int ndb_add_ndb_binlog_index(THD *thd, void *_row) mysql_unlock_tables(thd, thd->lock); thd->lock= 0; - thd->options= saved_options; + thd->variables.option_bits= saved_options; return 0; add_ndb_binlog_index_err: close_thread_tables(thd); ndb_binlog_index= 0; - thd->options= saved_options; + thd->variables.option_bits= saved_options; return error; } @@ -2655,7 +2659,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key, const NDBTAB *ndbtab= ndbtab_g.get_table(); if (ndbtab == 0) { - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: Failed to get table %s from ndb: " "%s, %d", key, dict->getNdbError().message, dict->getNdbError().code); @@ -2677,7 +2681,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key, event_name.c_ptr()); break; // error } - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: " "CREATE (DISCOVER) TABLE Event: %s", event_name.c_ptr()); @@ -2685,7 +2689,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key, else { delete ev; - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: DISCOVER TABLE Event: %s", event_name.c_ptr()); } @@ -3089,7 +3093,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, DBUG_PRINT("info",("%s share->op: 0x%lx share->use_count: %u", share->key, (long) share->op, share->use_count)); - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: logging %s", share->key); DBUG_RETURN(0); } @@ -3157,7 +3161,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name, (void) pthread_mutex_lock(&share->mutex); mysql_mutex_assert_owner(&LOCK_open); mysql_mutex_unlock(&LOCK_open); - int max_timeout= opt_ndb_sync_timeout; + int max_timeout= DEFAULT_SYNC_TIMEOUT; while (share->op) { struct timespec abstime; @@ -3177,7 +3181,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name, type_str, share->key); break; } - if (ndb_extra_logging) + if (opt_ndb_extra_logging) ndb_report_waiting(type_str, max_timeout, type_str, share->key); } @@ -3255,12 +3259,12 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb, switch (type) { case NDBEVENT::TE_CLUSTER_FAILURE: - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: cluster failure for %s at epoch %u.", share->key, (unsigned) pOp->getGCI()); if (ndb_apply_status_share == share) { - if (ndb_extra_logging && + if (opt_ndb_extra_logging && ndb_binlog_tables_inited && ndb_binlog_running) sql_print_information("NDB Binlog: ndb tables initially " "read only on reconnect."); @@ -3280,7 +3284,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb, case NDBEVENT::TE_DROP: if (ndb_apply_status_share == share) { - if (ndb_extra_logging && + if (opt_ndb_extra_logging && ndb_binlog_tables_inited && ndb_binlog_running) sql_print_information("NDB Binlog: ndb tables initially " "read only on reconnect."); @@ -3292,7 +3296,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb, ndb_binlog_tables_inited= 0; } /* ToDo: remove printout */ - if (ndb_extra_logging) + if (opt_ndb_extra_logging) sql_print_information("NDB Binlog: drop table %s.", share->key); // fall through case NDBEVENT::TE_ALTER: @@ -3623,6 +3627,8 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object, DBUG_VOID_RETURN; } +extern ulong opt_ndb_report_thresh_binlog_epoch_slip; +extern ulong opt_ndb_report_thresh_binlog_mem_usage; pthread_handler_t ndb_binlog_thread_func(void *arg) { @@ -3881,7 +3887,7 @@ restart: "Changes to the database that occured while " "disconnected will not be in the binlog"); } - if (ndb_extra_logging) + if (opt_ndb_extra_logging) { sql_print_information("NDB Binlog: starting log at epoch %u", (unsigned)schema_gci); @@ -3983,9 +3989,9 @@ restart: { thd->proc_info= "Processing events from schema table"; s_ndb-> - setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip); + setReportThreshEventGCISlip(opt_ndb_report_thresh_binlog_epoch_slip); s_ndb-> - setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage); + setReportThreshEventFreeMem(opt_ndb_report_thresh_binlog_mem_usage); NdbEventOperation *pOp= s_ndb->nextEvent(); while (pOp != NULL) { @@ -4048,8 +4054,8 @@ restart: /* initialize some variables for this epoch */ g_ndb_log_slave_updates= opt_log_slave_updates; i_ndb-> - setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip); - i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage); + setReportThreshEventGCISlip(opt_ndb_report_thresh_binlog_epoch_slip); + i_ndb->setReportThreshEventFreeMem(opt_ndb_report_thresh_binlog_mem_usage); bzero((char*) &row, sizeof(row)); thd->variables.character_set_client= &my_charset_latin1; diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h index d80dfe9ee74..4c64aa23c5b 100644 --- a/sql/ha_ndbcluster_binlog.h +++ b/sql/ha_ndbcluster_binlog.h @@ -27,8 +27,6 @@ typedef NdbDictionary::Event NDBEVENT; #define IS_TMP_PREFIX(A) (is_prefix(A, tmp_file_prefix)) -extern ulong ndb_extra_logging; - #define INJECTOR_EVENT_LEN 200 #define NDB_INVALID_SCHEMA_OBJECT 241 diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 2ec92173d14..d46d416e275 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1145,7 +1145,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, { if (part_elem->part_state == PART_ADMIN) part_elem->part_state= PART_NORMAL; - } while (part_elem= part_it++); + } while ((part_elem= part_it++)); DBUG_RETURN(error); } } while (++j < num_subparts); @@ -1177,7 +1177,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, { if (part_elem->part_state == PART_ADMIN) part_elem->part_state= PART_NORMAL; - } while (part_elem= part_it++); + } while ((part_elem= part_it++)); DBUG_RETURN(error); } } @@ -6483,7 +6483,7 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment, thd->lex->sql_command != SQLCOM_INSERT && mysql_bin_log.is_open() && !thd->current_stmt_binlog_row_based && - (thd->options & OPTION_BIN_LOG)) + (thd->variables.option_bits & OPTION_BIN_LOG)) { DBUG_PRINT("info", ("locking auto_increment_safe_stmt_log_lock")); auto_increment_safe_stmt_log_lock= TRUE; diff --git a/sql/handler.cc b/sql/handler.cc index dd8eb93099d..784d02d7f4c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -307,7 +307,6 @@ const char **get_handler_errmsgs() int ha_init_errors(void) { #define SETMSG(nr, msg) handler_errmsgs[(nr) - HA_ERR_FIRST]= (msg) - const char **errmsgs; /* Allocate a pointer array for the error message strings. */ /* Zerofill it to avoid uninitialized gaps. */ @@ -3696,7 +3695,6 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) void st_ha_check_opt::init() { flags= sql_flags= 0; - sort_buffer_size = current_thd->variables.myisam_sort_buff_size; } @@ -3773,15 +3771,6 @@ int ha_change_key_cache_param(KEY_CACHE *key_cache) return 0; } -/** - Free memory allocated by a key cache. -*/ -int ha_end_key_cache(KEY_CACHE *key_cache) -{ - end_key_cache(key_cache, 1); // Can never fail - return 0; -} - /** Move all tables from one key cache to another one. */ @@ -4489,7 +4478,7 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table) return (thd->current_stmt_binlog_row_based && table->s->cached_row_logging_check && - (thd->options & OPTION_BIN_LOG) && + (thd->variables.option_bits & OPTION_BIN_LOG) && mysql_bin_log.is_open()); } diff --git a/sql/handler.h b/sql/handler.h index e5d868dc608..6d43c56edbf 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -941,9 +941,6 @@ enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, ISO_REPEATABLE_READ, ISO_SERIALIZABLE}; -enum ndb_distribution { ND_KEYHASH= 0, ND_LINHASH= 1 }; - - typedef struct { ulonglong data_file_length; ulonglong max_data_file_length; @@ -1075,7 +1072,6 @@ typedef class Item COND; typedef struct st_ha_check_opt { st_ha_check_opt() {} /* Remove gcc warning */ - ulong sort_buffer_size; uint flags; /* isam layer flags (e.g. for myisamchk) */ uint sql_flags; /* sql layer flags - for something myisamchk cannot do */ KEY_CACHE *key_cache; /* new key cache when changing key cache */ @@ -2006,7 +2002,7 @@ extern const char *ha_row_type[]; extern MYSQL_PLUGIN_IMPORT const char *tx_isolation_names[]; extern MYSQL_PLUGIN_IMPORT const char *binlog_format_names[]; extern TYPELIB tx_isolation_typelib; -extern TYPELIB myisam_stats_method_typelib; +extern const char *myisam_stats_method_names[]; extern ulong total_ha, total_ha_2pc; /* Wrapper functions */ @@ -2080,7 +2076,6 @@ extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache); int ha_resize_key_cache(KEY_CACHE *key_cache); int ha_change_key_cache_param(KEY_CACHE *key_cache); int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache); -int ha_end_key_cache(KEY_CACHE *key_cache); /* report to InnoDB that control passes to the client */ int ha_release_temporary_latches(THD *thd); diff --git a/sql/item.cc b/sql/item.cc index f4b2e549667..8168316b187 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -975,7 +975,7 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions) THD *thd= table->in_use; enum_check_fields tmp= thd->count_cuted_fields; my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set); - ulong sql_mode= thd->variables.sql_mode; + ulonglong sql_mode= thd->variables.sql_mode; thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE); thd->count_cuted_fields= CHECK_FIELD_IGNORE; res= save_in_field(field, no_conversions); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ec50e6c5708..1da383ce3e9 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -404,7 +404,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item, if (!(*item)->with_subselect && (*item)->const_item()) { TABLE *table= field->table; - ulong orig_sql_mode= thd->variables.sql_mode; + ulonglong orig_sql_mode= thd->variables.sql_mode; enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields; my_bitmap_map *old_maps[2]; ulonglong UNINIT_VAR(orig_field_val); /* original field value if valid */ diff --git a/sql/item_func.cc b/sql/item_func.cc index 6f14e69e101..ec0f76717fd 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -37,6 +37,7 @@ #include "sp_head.h" #include "sp_rcontext.h" #include "sp.h" +#include "set_var.h" #ifdef NO_EMBEDDED_ACCESS_CHECKS #define sp_restore_security_context(A,B) while (0) {} @@ -4984,7 +4985,7 @@ void Item_func_get_system_var::fix_length_and_dec() if (var_type != OPT_DEFAULT) { my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), - var->name, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL"); + var->name.str, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL"); return; } /* As there was no local variable, return the global value */ @@ -5001,22 +5002,38 @@ void Item_func_get_system_var::fix_length_and_dec() decimals=0; break; case SHOW_LONGLONG: - unsigned_flag= FALSE; + unsigned_flag= TRUE; max_length= MY_INT64_NUM_DECIMAL_DIGITS; decimals=0; break; case SHOW_CHAR: case SHOW_CHAR_PTR: pthread_mutex_lock(&LOCK_global_system_variables); - cptr= var->show_type() == SHOW_CHAR_PTR ? - *(char**) var->value_ptr(current_thd, var_type, &component) : - (char*) var->value_ptr(current_thd, var_type, &component); + cptr= var->show_type() == SHOW_CHAR ? + (char*) var->value_ptr(current_thd, var_type, &component) : + *(char**) var->value_ptr(current_thd, var_type, &component); if (cptr) - max_length= strlen(cptr) * system_charset_info->mbmaxlen; + max_length= system_charset_info->cset->numchars(system_charset_info, + cptr, + cptr + strlen(cptr)); pthread_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); + 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); + collation.set(system_charset_info, DERIVATION_SYSCONST); + max_length*= system_charset_info->mbmaxlen; + decimals=NOT_FIXED_DEC; + } + break; case SHOW_BOOL: case SHOW_MY_BOOL: unsigned_flag= FALSE; @@ -5029,7 +5046,7 @@ void Item_func_get_system_var::fix_length_and_dec() max_length= DBL_DIG + 6; break; default: - my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name); + my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str); break; } } @@ -5054,11 +5071,12 @@ enum Item_result Item_func_get_system_var::result_type() const return INT_RESULT; case SHOW_CHAR: case SHOW_CHAR_PTR: + case SHOW_LEX_STRING: return STRING_RESULT; case SHOW_DOUBLE: return REAL_RESULT; default: - my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name); + my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str); return STRING_RESULT; // keep the compiler happy } } @@ -5077,11 +5095,12 @@ enum_field_types Item_func_get_system_var::field_type() const return MYSQL_TYPE_LONGLONG; case SHOW_CHAR: case SHOW_CHAR_PTR: + case SHOW_LEX_STRING: return MYSQL_TYPE_VARCHAR; case SHOW_DOUBLE: return MYSQL_TYPE_DOUBLE; default: - my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name); + my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str); return MYSQL_TYPE_VARCHAR; // keep the compiler happy } } @@ -5142,7 +5161,7 @@ longlong Item_func_get_system_var::val_int() { case SHOW_INT: get_sys_var_safe (uint); case SHOW_LONG: get_sys_var_safe (ulong); - case SHOW_LONGLONG: get_sys_var_safe (longlong); + case SHOW_LONGLONG: get_sys_var_safe (ulonglong); case SHOW_HA_ROWS: get_sys_var_safe (ha_rows); case SHOW_BOOL: get_sys_var_safe (bool); case SHOW_MY_BOOL: get_sys_var_safe (my_bool); @@ -5157,6 +5176,7 @@ longlong Item_func_get_system_var::val_int() } case SHOW_CHAR: case SHOW_CHAR_PTR: + case SHOW_LEX_STRING: { String *str_val= val_str(NULL); @@ -5176,7 +5196,7 @@ longlong Item_func_get_system_var::val_int() } default: - my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name); + my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str); return 0; // keep the compiler happy } } @@ -5216,14 +5236,18 @@ String* Item_func_get_system_var::val_str(String* str) { case SHOW_CHAR: case SHOW_CHAR_PTR: + case SHOW_LEX_STRING: { pthread_mutex_lock(&LOCK_global_system_variables); - char *cptr= var->show_type() == SHOW_CHAR_PTR ? - *(char**) var->value_ptr(thd, var_type, &component) : - (char*) var->value_ptr(thd, var_type, &component); + char *cptr= var->show_type() == SHOW_CHAR ? + (char*) var->value_ptr(thd, var_type, &component) : + *(char**) var->value_ptr(thd, var_type, &component); if (cptr) { - if (str->copy(cptr, strlen(cptr), collation.collation)) + size_t len= var->show_type() == SHOW_LEX_STRING ? + ((LEX_STRING*)(var->value_ptr(thd, var_type, &component)))->length : + strlen(cptr); + if (str->copy(cptr, len, collation.collation)) { null_value= TRUE; str= NULL; @@ -5251,7 +5275,7 @@ String* Item_func_get_system_var::val_str(String* str) break; default: - my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name); + my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str); str= NULL; break; } @@ -5309,12 +5333,11 @@ double Item_func_get_system_var::val_real() cache_present|= GET_SYS_VAR_CACHE_DOUBLE; return cached_dval; case SHOW_CHAR: + case SHOW_LEX_STRING: case SHOW_CHAR_PTR: { - char *cptr; - pthread_mutex_lock(&LOCK_global_system_variables); - cptr= var->show_type() == SHOW_CHAR ? + char *cptr= var->show_type() == SHOW_CHAR ? (char*) var->value_ptr(thd, var_type, &component) : *(char**) var->value_ptr(thd, var_type, &component); if (cptr) @@ -5343,7 +5366,7 @@ double Item_func_get_system_var::val_real() cached_null_value= null_value; return cached_dval; default: - my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name); + my_error(ER_VAR_CANT_BE_READ, MYF(0), var->name.str); return 0; } } diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 831f0287266..c33088e0276 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -778,8 +778,8 @@ bool Aggregator_distinct::setup(THD *thd) } if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1, 0, - (select_lex->options | thd->options), - HA_POS_ERROR, (char*)""))) + (select_lex->options | thd->variables.option_bits), + HA_POS_ERROR, ""))) return TRUE; table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows table->no_rows=1; @@ -3324,7 +3324,7 @@ bool Item_func_group_concat::setup(THD *thd) */ if (!(table= create_tmp_table(thd, tmp_table_param, all_fields, (ORDER*) 0, 0, TRUE, - (select_lex->options | thd->options), + (select_lex->options | thd->variables.option_bits), HA_POS_ERROR, (char*) ""))) DBUG_RETURN(TRUE); table->file->extra(HA_EXTRA_NO_ROWS); diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index f6c316c15c6..860bd983184 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -96,7 +96,7 @@ public: { int *input_version= (int*)int_arg; /* This function was introduced in 5.5 */ - int output_version= (*input_version, 50500); + int output_version= max(*input_version, 50500); *input_version= output_version; return 0; } diff --git a/sql/keycaches.cc b/sql/keycaches.cc new file mode 100644 index 00000000000..d68e2bccd96 --- /dev/null +++ b/sql/keycaches.cc @@ -0,0 +1,163 @@ +/* Copyright (C) 2002-2006 MySQL AB, 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 "keycaches.h" + +/**************************************************************************** + Named list handling +****************************************************************************/ + +NAMED_ILIST key_caches; + +/** + ilink (intrusive list element) with a name +*/ +class NAMED_ILINK :public ilink +{ +public: + const char *name; + uint name_length; + uchar* data; + + NAMED_ILINK(I_List *links, const char *name_arg, + uint name_length_arg, uchar* data_arg) + :name_length(name_length_arg), data(data_arg) + { + name= my_strndup(name_arg, name_length, MYF(MY_WME)); + links->push_back(this); + } + inline bool cmp(const char *name_cmp, uint length) + { + return length == name_length && !memcmp(name, name_cmp, length); + } + ~NAMED_ILINK() + { + my_free((uchar*) name, MYF(0)); + } +}; + +uchar* find_named(I_List *list, const char *name, uint length, + NAMED_ILINK **found) +{ + I_List_iterator it(*list); + NAMED_ILINK *element; + while ((element= it++)) + { + if (element->cmp(name, length)) + { + if (found) + *found= element; + return element->data; + } + } + return 0; +} + + +void NAMED_ILIST::delete_elements(void (*free_element)(const char *name, uchar*)) +{ + NAMED_ILINK *element; + DBUG_ENTER("NAMED_ILIST::delete_elements"); + while ((element= get())) + { + (*free_element)(element->name, element->data); + delete element; + } + DBUG_VOID_RETURN; +} + + +/* Key cache functions */ + +LEX_STRING default_key_cache_base= {C_STRING_WITH_LEN("default")}; + +KEY_CACHE zero_key_cache; ///< @@nonexistent_cache.param->value_ptr() points here + +KEY_CACHE *get_key_cache(LEX_STRING *cache_name) +{ + if (!cache_name || ! cache_name->length) + cache_name= &default_key_cache_base; + return ((KEY_CACHE*) find_named(&key_caches, + cache_name->str, cache_name->length, 0)); +} + +KEY_CACHE *create_key_cache(const char *name, uint length) +{ + KEY_CACHE *key_cache; + DBUG_ENTER("create_key_cache"); + DBUG_PRINT("enter",("name: %.*s", length, name)); + + if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE), + MYF(MY_ZEROFILL | MY_WME)))) + { + if (!new NAMED_ILINK(&key_caches, name, length, (uchar*) key_cache)) + { + my_free((char*) key_cache, MYF(0)); + key_cache= 0; + } + else + { + /* + Set default values for a key cache + The values in dflt_key_cache_var is set by my_getopt() at startup + + We don't set 'buff_size' as this is used to enable the key cache + */ + key_cache->param_block_size= dflt_key_cache_var.param_block_size; + key_cache->param_division_limit= dflt_key_cache_var.param_division_limit; + key_cache->param_age_threshold= dflt_key_cache_var.param_age_threshold; + } + } + DBUG_RETURN(key_cache); +} + + +KEY_CACHE *get_or_create_key_cache(const char *name, uint length) +{ + LEX_STRING key_cache_name; + KEY_CACHE *key_cache; + + key_cache_name.str= (char *) name; + key_cache_name.length= length; + if (!(key_cache= get_key_cache(&key_cache_name))) + key_cache= create_key_cache(name, length); + return key_cache; +} + + +void free_key_cache(const char *name, KEY_CACHE *key_cache) +{ + end_key_cache(key_cache, 1); // Can never fail + my_free((char*) key_cache, MYF(0)); +} + + +bool process_key_caches(process_key_cache_t func) +{ + I_List_iterator it(key_caches); + NAMED_ILINK *element; + + while ((element= it++)) + { + KEY_CACHE *key_cache= (KEY_CACHE *) element->data; + func(element->name, key_cache); + } + return 0; +} + +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION +template class I_List_iterator; +#endif + diff --git a/sql/keycaches.h b/sql/keycaches.h new file mode 100644 index 00000000000..542a4d14c3d --- /dev/null +++ b/sql/keycaches.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2002-2006 MySQL AB, 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 "sql_list.h" +#include + +extern "C" +{ + typedef int (*process_key_cache_t) (const char *, KEY_CACHE *); +} + +class NAMED_ILINK; + +class NAMED_ILIST: public I_List +{ + public: + void delete_elements(void (*free_element)(const char*, uchar*)); +}; + +extern LEX_STRING default_key_cache_base; +extern KEY_CACHE zero_key_cache; +extern NAMED_ILIST key_caches; + +KEY_CACHE *create_key_cache(const char *name, uint length); +KEY_CACHE *get_key_cache(LEX_STRING *cache_name); +KEY_CACHE *get_or_create_key_cache(const char *name, uint length); +void free_key_cache(const char *name, KEY_CACHE *key_cache); +bool process_key_caches(process_key_cache_t func); + diff --git a/sql/log.cc b/sql/log.cc index fb990d60186..74239555c88 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -138,18 +138,22 @@ sql_print_message_func sql_print_message_handlers[3] = sql_print_error }; - /** - Create the name of the default general log file - + Create the name of the log specified. + + This method forms a new path + file name for the + log specified in @c name. + @param[IN] buff Location for building new string. - @param[IN] log_ext The extension for the file (e.g .log) - @returns Pointer to a new string containing the name + @param[IN] name Name of the log file. + @param[IN] log_ext The extension for the log (e.g. .log). + + @returns Pointer to new string containing the name. */ -char *make_default_log_name(char *buff,const char* log_ext) +char *make_log_name(char *buff, const char *name, const char* log_ext) { - strmake(buff, default_logfile_name, FN_REFLEN-5); - return fn_format(buff, buff, mysql_data_home, log_ext, + strmake(buff, name, FN_REFLEN-5); + return fn_format(buff, buff, mysql_real_data_home, log_ext, MYF(MY_UNPACK_FILENAME|MY_REPLACE_EXT)); } @@ -420,8 +424,8 @@ bool Log_to_csv_event_handler:: */ save_time_zone_used= thd->time_zone_used; - save_thd_options= thd->options; - thd->options&= ~OPTION_BIN_LOG; + save_thd_options= thd->variables.option_bits; + thd->variables.option_bits&= ~OPTION_BIN_LOG; bzero(& table_list, sizeof(TABLE_LIST)); table_list.alias= table_list.table_name= GENERAL_LOG_NAME.str; @@ -529,7 +533,7 @@ err: if (need_close) close_performance_schema_table(thd, & open_tables_backup); - thd->options= save_thd_options; + thd->variables.option_bits= save_thd_options; thd->time_zone_used= save_time_zone_used; return result; } @@ -838,10 +842,10 @@ bool Log_to_file_event_handler::init() if (!is_initialized) { if (opt_slow_log) - mysql_slow_log.open_slow_log(sys_var_slow_log_path.value); + mysql_slow_log.open_slow_log(opt_slow_logname); if (opt_log) - mysql_log.open_query_log(sys_var_general_log_path.value); + mysql_log.open_query_log(opt_logname); is_initialized= TRUE; } @@ -1202,7 +1206,7 @@ bool LOGGER::activate_log_handler(THD* thd, uint log_type) { file_log= file_log_handler->get_mysql_slow_log(); - file_log->open_slow_log(sys_var_slow_log_path.value); + file_log->open_slow_log(opt_slow_logname); if (table_log_handler->activate_log(thd, QUERY_LOG_SLOW)) { /* Error printed by open table in activate_log() */ @@ -1221,7 +1225,7 @@ bool LOGGER::activate_log_handler(THD* thd, uint log_type) { file_log= file_log_handler->get_mysql_log(); - file_log->open_query_log(sys_var_general_log_path.value); + file_log->open_query_log(opt_logname); if (table_log_handler->activate_log(thd, QUERY_LOG_GENERAL)) { /* Error printed by open table in activate_log() */ @@ -1454,8 +1458,8 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, 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))); + FLAGSTR(thd->variables.option_bits, OPTION_NOT_AUTOCOMMIT), + FLAGSTR(thd->variables.option_bits, OPTION_BEGIN))); /* NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of @@ -1503,7 +1507,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, transaction cache to remove the statement. */ thd->binlog_remove_pending_rows_event(TRUE); - if (all || !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) + if (all || !(thd->variables.option_bits & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) { if (trx_data->has_incident()) error= mysql_bin_log.write_incident(thd, TRUE); @@ -1572,7 +1576,7 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all) Otherwise, we accumulate the statement */ ulonglong const in_transaction= - thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN); + thd->variables.option_bits & (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, @@ -1647,7 +1651,7 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) back. */ if ((thd->transaction.stmt.modified_non_trans_table || - (thd->options & OPTION_KEEP_LOG)) && + (thd->variables.option_bits & OPTION_KEEP_LOG)) && mysql_bin_log.check_write_error(thd)) trx_data->set_incident(); error= binlog_end_trans(thd, trx_data, 0, all); @@ -1664,11 +1668,11 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) */ if ((all && thd->transaction.all.modified_non_trans_table) || (!all && thd->transaction.stmt.modified_non_trans_table && - !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) || + !(thd->variables.option_bits & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) || (!all && thd->transaction.stmt.modified_non_trans_table && !trx_data->at_least_one_stmt_committed && thd->current_stmt_binlog_row_based) || - ((thd->options & OPTION_KEEP_LOG))) + ((thd->variables.option_bits & OPTION_KEEP_LOG))) { Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, TRUE, 0); error= binlog_end_trans(thd, trx_data, &qev, all); @@ -1772,7 +1776,7 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv) from the SAVEPOINT command. */ if (unlikely(thd->transaction.all.modified_non_trans_table || - (thd->options & OPTION_KEEP_LOG))) + (thd->variables.option_bits & OPTION_KEEP_LOG))) { int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); int error= @@ -1948,7 +1952,7 @@ updating the index files.", max_found); */ if (((strlen(ext_buf) + (end - name)) >= FN_REFLEN)) { - sql_print_error("Log filename too large: %s%s (%lu). \ + sql_print_error("Log filename too large: %s%s (%zu). \ Please fix this by archiving old logs and updating the \ index files.", name, ext_buf, (strlen(ext_buf) + (end - name))); error= 1; @@ -4118,7 +4122,7 @@ THD::binlog_start_trans_and_stmt() trx_data->before_stmt_pos == MY_OFF_T_UNDEF) { this->binlog_set_stmt_begin(); - if (options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + if (variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) trans_register_ha(this, TRUE, binlog_hton); trans_register_ha(this, FALSE, binlog_hton); /* @@ -4380,7 +4384,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) binlog_[wild_]{do|ignore}_table?" (WL#1049)" */ const char *local_db= event_info->get_db(); - if ((thd && !(thd->options & OPTION_BIN_LOG)) || + if ((thd && !(thd->variables.option_bits & OPTION_BIN_LOG)) || (!binlog_filter->db_ok(local_db))) { pthread_mutex_unlock(&LOCK_log); @@ -4549,7 +4553,7 @@ bool LOGGER::log_command(THD *thd, enum enum_server_command command) */ if (*general_log_handler_list && (what_to_log & (1L << (uint) command))) { - if ((thd->options & OPTION_LOG_OFF) + if ((thd->variables.option_bits & OPTION_LOG_OFF) #ifndef NO_EMBEDDED_ACCESS_CHECKS && (sctx->master_access & SUPER_ACL) #endif diff --git a/sql/log.h b/sql/log.h index fa24a2c5803..847fa3db6f9 100644 --- a/sql/log.h +++ b/sql/log.h @@ -608,13 +608,13 @@ public: void init_general_log(uint general_log_printer); void deactivate_log_handler(THD* thd, uint log_type); bool activate_log_handler(THD* thd, uint log_type); - MYSQL_QUERY_LOG *get_slow_log_file_handler() + MYSQL_QUERY_LOG *get_slow_log_file_handler() const { if (file_log_handler) return file_log_handler->get_mysql_slow_log(); return NULL; } - MYSQL_QUERY_LOG *get_log_file_handler() + MYSQL_QUERY_LOG *get_log_file_handler() const { if (file_log_handler) return file_log_handler->get_mysql_log(); @@ -623,19 +623,10 @@ public: }; enum enum_binlog_format { - /* - statement-based except for cases where only row-based can work (UUID() - etc): - */ - BINLOG_FORMAT_MIXED= 0, - BINLOG_FORMAT_STMT= 1, // statement-based - BINLOG_FORMAT_ROW= 2, // row_based -/* - This value is last, after the end of binlog_format_typelib: it has no - corresponding cell in this typelib. We use this value to be able to know if - the user has explicitely specified a binlog format at startup or not. -*/ - BINLOG_FORMAT_UNSPEC= 3 + BINLOG_FORMAT_MIXED= 0, ///< statement if safe, otherwise row - autodetected + BINLOG_FORMAT_STMT= 1, ///< statement-based + BINLOG_FORMAT_ROW= 2, ///< row-based + BINLOG_FORMAT_UNSPEC=3 ///< thd_binlog_format() returns it when binlog is closed }; extern TYPELIB binlog_format_typelib; diff --git a/sql/log_event.cc b/sql/log_event.cc index 9cfa6cf1540..fa5a78917ef 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1200,15 +1200,11 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, */ if (description_event->event_type_permutation) { -#ifndef DBUG_OFF - int new_event_type= - description_event->event_type_permutation[event_type]; - DBUG_PRINT("info", - ("converting event type %d to %d (%s)", - event_type, new_event_type, - get_type_str((Log_event_type)new_event_type))); -#endif - event_type= description_event->event_type_permutation[event_type]; + int new_event_type= description_event->event_type_permutation[event_type]; + DBUG_PRINT("info", ("converting event type %d to %d (%s)", + event_type, new_event_type, + get_type_str((Log_event_type)new_event_type))); + event_type= new_event_type; } switch(event_type) { @@ -2415,7 +2411,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, the autocommit flag as written by the master to the binlog. This behavior may change after WL#4162 has been implemented. */ - flags2= (uint32) (thd_arg->options & + flags2= (uint32) (thd_arg->variables.option_bits & (OPTIONS_WRITTEN_TO_BIN_LOG & ~OPTION_NOT_AUTOCOMMIT)); DBUG_ASSERT(thd_arg->variables.character_set_client->number < 256*256); DBUG_ASSERT(thd_arg->variables.collation_connection->number < 256*256); @@ -3064,13 +3060,13 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli, { if (flags2_inited) /* - all bits of thd->options which are 1 in OPTIONS_WRITTEN_TO_BIN_LOG + all bits of thd->variables.option_bits which are 1 in OPTIONS_WRITTEN_TO_BIN_LOG must take their value from flags2. */ - thd->options= flags2|(thd->options & ~OPTIONS_WRITTEN_TO_BIN_LOG); + thd->variables.option_bits= flags2|(thd->variables.option_bits & ~OPTIONS_WRITTEN_TO_BIN_LOG); /* else, we are in a 3.23/4.0 binlog; we previously received a - Rotate_log_event which reset thd->options and sql_mode etc, so + Rotate_log_event which reset thd->variables.option_bits and sql_mode etc, so nothing to do. */ /* @@ -3347,13 +3343,13 @@ Query_log_event::do_shall_skip(Relay_log_info *rli) { if (strcmp("BEGIN", query) == 0) { - thd->options|= OPTION_BEGIN; + thd->variables.option_bits|= OPTION_BEGIN; DBUG_RETURN(Log_event::continue_group(rli)); } if (strcmp("COMMIT", query) == 0 || strcmp("ROLLBACK", query) == 0) { - thd->options&= ~OPTION_BEGIN; + thd->variables.option_bits&= ~OPTION_BEGIN; DBUG_RETURN(Log_event::EVENT_SKIP_COUNT); } } @@ -3609,8 +3605,7 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver) #ifndef DBUG_OFF // Allows us to sanity-check that all events initialized their // events (see the end of this 'if' block). - memset(post_header_len, 255, - number_of_event_types*sizeof(uint8)); + memset(post_header_len, 255, number_of_event_types*sizeof(uint8)); #endif /* Note: all event types must explicitly fill in their lengths here. */ @@ -4953,7 +4948,7 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli) flush_relay_log_info(rli); /* - Reset thd->options and sql_mode etc, because this could be the signal of + Reset thd->variables.option_bits and sql_mode etc, because this could be the signal of a master's downgrade from 5.0 to 4.0. However, no need to reset description_event_for_exec: indeed, if the next master is 5.0 (even 5.0.1) we will soon get a Format_desc; if the next @@ -5323,7 +5318,7 @@ Xid_log_event::do_shall_skip(Relay_log_info *rli) { DBUG_ENTER("Xid_log_event::do_shall_skip"); if (rli->slave_skip_counter > 0) { - thd->options&= ~OPTION_BEGIN; + thd->variables.option_bits&= ~OPTION_BEGIN; DBUG_RETURN(Log_event::EVENT_SKIP_COUNT); } DBUG_RETURN(Log_event::do_shall_skip(rli)); @@ -5924,7 +5919,7 @@ int Stop_log_event::do_update_pos(Relay_log_info *rli) could give false triggers in MASTER_POS_WAIT() that we have reached the target position when in fact we have not. */ - if (thd->options & OPTION_BEGIN) + if (thd->variables.option_bits & OPTION_BEGIN) rli->inc_event_relay_log_pos(); else { @@ -6991,9 +6986,9 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, DBUG_ASSERT((tbl_arg && tbl_arg->s && tid != ~0UL) || (!tbl_arg && !cols && tid == ~0UL)); - if (thd_arg->options & OPTION_NO_FOREIGN_KEY_CHECKS) + if (thd_arg->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS) set_flags(NO_FOREIGN_KEY_CHECKS_F); - if (thd_arg->options & OPTION_RELAXED_UNIQUE_CHECKS) + if (thd_arg->variables.option_bits & OPTION_RELAXED_UNIQUE_CHECKS) set_flags(RELAXED_UNIQUE_CHECKS_F); /* if bitmap_init fails, caught in is_valid() */ if (likely(!bitmap_init(&m_cols, @@ -7282,7 +7277,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) STMT_END_F or next error. */ if (!thd->current_stmt_binlog_row_based && - mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG)) + mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG)) { thd->set_current_stmt_binlog_row_based(); } @@ -7294,16 +7289,16 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) the event. */ if (get_flags(NO_FOREIGN_KEY_CHECKS_F)) - thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS; + thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS; else - thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS; + thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS; if (get_flags(RELAXED_UNIQUE_CHECKS_F)) - thd->options|= OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS; else - thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS; /* A small test to verify that objects have consistent types */ - DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); + DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); if (simple_open_n_lock_tables(thd, rli->tables_to_lock)) { @@ -7457,8 +7452,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) { int actual_error= convert_handler_error(error, thd, table); bool idempotent_error= (idempotent_error_code(error) && - ((bit_is_set(slave_exec_mode, - SLAVE_EXEC_MODE_IDEMPOTENT)) == 1)); + (slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT)); bool ignored_error= (idempotent_error == 0 ? ignored_error_code(actual_error) : 0); @@ -7526,7 +7520,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) if (!cache_stmt) { DBUG_PRINT("info", ("Marked that we need to keep log")); - thd->options|= OPTION_KEEP_LOG; + thd->variables.option_bits|= OPTION_KEEP_LOG; } } // if (table) @@ -8270,8 +8264,8 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability todo: to introduce a property for the event (handler?) which forces applying the event in the replace (idempotent) fashion. */ - if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 || - m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER) + if ((slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT) || + (m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER)) { /* We are using REPLACE semantics and not INSERT IGNORE semantics @@ -8349,7 +8343,7 @@ Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability * int local_error= 0; m_table->next_number_field=0; m_table->auto_increment_field_not_null= FALSE; - if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 || + if ((slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT) || m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER) { m_table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); @@ -8650,9 +8644,7 @@ int Write_rows_log_event::do_exec_row(const Relay_log_info *const rli) { DBUG_ASSERT(m_table != NULL); - int error= - write_row(rli, /* if 1 then overwrite */ - bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1); + int error= write_row(rli, slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT); if (error && !thd->is_error()) { diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 72affd2bee9..3ebd4b1864a 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -71,7 +71,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info STMT_END_F or next error. */ if (!thd->current_stmt_binlog_row_based && - mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG)) + mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG)) { thd->set_current_stmt_binlog_row_based(); } @@ -166,16 +166,16 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info the event. */ if (ev->get_flags(Old_rows_log_event::NO_FOREIGN_KEY_CHECKS_F)) - thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS; + thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS; else - thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS; + thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS; if (ev->get_flags(Old_rows_log_event::RELAXED_UNIQUE_CHECKS_F)) - thd->options|= OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS; else - thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS; /* A small test to verify that objects have consistent types */ - DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); + DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); /* Now we are in a statement and will stay in a statement until we @@ -232,7 +232,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info if (!ev->cache_stmt) { DBUG_PRINT("info", ("Marked that we need to keep log")); - thd->options|= OPTION_KEEP_LOG; + thd->variables.option_bits|= OPTION_KEEP_LOG; } } @@ -1220,9 +1220,9 @@ Old_rows_log_event::Old_rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, DBUG_ASSERT((tbl_arg && tbl_arg->s && tid != ~0UL) || (!tbl_arg && !cols && tid == ~0UL)); - if (thd_arg->options & OPTION_NO_FOREIGN_KEY_CHECKS) + if (thd_arg->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS) set_flags(NO_FOREIGN_KEY_CHECKS_F); - if (thd_arg->options & OPTION_RELAXED_UNIQUE_CHECKS) + if (thd_arg->variables.option_bits & OPTION_RELAXED_UNIQUE_CHECKS) set_flags(RELAXED_UNIQUE_CHECKS_F); /* if bitmap_init fails, caught in is_valid() */ if (likely(!bitmap_init(&m_cols, @@ -1619,16 +1619,16 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) the event. */ if (get_flags(NO_FOREIGN_KEY_CHECKS_F)) - thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS; + thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS; else - thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS; + thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS; if (get_flags(RELAXED_UNIQUE_CHECKS_F)) - thd->options|= OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS; else - thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS; /* A small test to verify that objects have consistent types */ - DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); + DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); /* Now we are in a statement and will stay in a statement until we @@ -1730,7 +1730,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) if (!cache_stmt) { DBUG_PRINT("info", ("Marked that we need to keep log")); - thd->options|= OPTION_KEEP_LOG; + thd->variables.option_bits|= OPTION_KEEP_LOG; } } // if (table) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3ddaf114673..50fbf128660 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -36,7 +36,7 @@ #define SHOW_always_last SHOW_KEY_CACHE_LONG, \ SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \ SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \ - SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS + SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_LEX_STRING #include #include @@ -492,12 +492,6 @@ protected: #define FLUSH_TIME 0 /**< Don't flush tables */ #define MAX_CONNECT_ERRORS 10 ///< errors before disabling host -#ifdef __NETWARE__ -#define IF_NETWARE(A,B) A -#else -#define IF_NETWARE(A,B) B -#endif - #if defined(__WIN__) #undef FLUSH_TIME #define FLUSH_TIME 1800 /**< Flush every half hour */ @@ -522,7 +516,7 @@ protected: This is included in the server and in the client. Options for select set by the yacc parser (stored in lex->options). - XXX: + NOTE log_event.h defines OPTIONS_WRITTEN_TO_BIN_LOG to specify what THD options list are written into binlog. These options can NOT change their values, or it will break replication between version. @@ -536,53 +530,52 @@ protected: TODO: separate three contexts above, move them to separate bitfields. */ -#define SELECT_DISTINCT (ULL(1) << 0) // SELECT, user -#define SELECT_STRAIGHT_JOIN (ULL(1) << 1) // SELECT, user -#define SELECT_DESCRIBE (ULL(1) << 2) // SELECT, user -#define SELECT_SMALL_RESULT (ULL(1) << 3) // SELECT, user -#define SELECT_BIG_RESULT (ULL(1) << 4) // SELECT, user -#define OPTION_FOUND_ROWS (ULL(1) << 5) // SELECT, user -#define OPTION_TO_QUERY_CACHE (ULL(1) << 6) // SELECT, user -#define SELECT_NO_JOIN_CACHE (ULL(1) << 7) // intern -#define OPTION_BIG_TABLES (ULL(1) << 8) // THD, user -#define OPTION_BIG_SELECTS (ULL(1) << 9) // THD, user -#define OPTION_LOG_OFF (ULL(1) << 10) // THD, user -#define OPTION_QUOTE_SHOW_CREATE (ULL(1) << 11) // THD, user, unused -#define TMP_TABLE_ALL_COLUMNS (ULL(1) << 12) // SELECT, intern -#define OPTION_WARNINGS (ULL(1) << 13) // THD, user -#define OPTION_AUTO_IS_NULL (ULL(1) << 14) // THD, user, binlog -#define OPTION_FOUND_COMMENT (ULL(1) << 15) // SELECT, intern, parser -#define OPTION_SAFE_UPDATES (ULL(1) << 16) // THD, user -#define OPTION_BUFFER_RESULT (ULL(1) << 17) // SELECT, user -#define OPTION_BIN_LOG (ULL(1) << 18) // THD, user -#define OPTION_NOT_AUTOCOMMIT (ULL(1) << 19) // THD, user -#define OPTION_BEGIN (ULL(1) << 20) // THD, intern -#define OPTION_TABLE_LOCK (ULL(1) << 21) // THD, intern -#define OPTION_QUICK (ULL(1) << 22) // SELECT (for DELETE) -#define OPTION_KEEP_LOG (ULL(1) << 23) // THD, user +#define SELECT_DISTINCT (1ULL << 0) // SELECT, user +#define SELECT_STRAIGHT_JOIN (1ULL << 1) // SELECT, user +#define SELECT_DESCRIBE (1ULL << 2) // SELECT, user +#define SELECT_SMALL_RESULT (1ULL << 3) // SELECT, user +#define SELECT_BIG_RESULT (1ULL << 4) // SELECT, user +#define OPTION_FOUND_ROWS (1ULL << 5) // SELECT, user +#define OPTION_TO_QUERY_CACHE (1ULL << 6) // SELECT, user +#define SELECT_NO_JOIN_CACHE (1ULL << 7) // intern +/** always the opposite of OPTION_NOT_AUTOCOMMIT except when in fix_autocommit() */ +#define OPTION_AUTOCOMMIT (1ULL << 8) // THD, user +#define OPTION_BIG_SELECTS (1ULL << 9) // THD, user +#define OPTION_LOG_OFF (1ULL << 10) // THD, user +#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user, unused +#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern +#define OPTION_WARNINGS (1ULL << 13) // THD, user +#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog +#define OPTION_FOUND_COMMENT (1ULL << 15) // SELECT, intern, parser +#define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user +#define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user +#define OPTION_BIN_LOG (1ULL << 18) // THD, user +#define OPTION_NOT_AUTOCOMMIT (1ULL << 19) // THD, user +#define OPTION_BEGIN (1ULL << 20) // THD, intern +#define OPTION_TABLE_LOCK (1ULL << 21) // THD, intern +#define OPTION_QUICK (1ULL << 22) // SELECT (for DELETE) +#define OPTION_KEEP_LOG (1ULL << 23) // THD, user /* The following is used to detect a conflict with DISTINCT */ -#define SELECT_ALL (ULL(1) << 24) // SELECT, user, parser - +#define SELECT_ALL (1ULL << 24) // SELECT, user, parser /** The following can be set when importing tables in a 'wrong order' to suppress foreign key checks */ -#define OPTION_NO_FOREIGN_KEY_CHECKS (ULL(1) << 26) // THD, user, binlog +#define OPTION_NO_FOREIGN_KEY_CHECKS (1ULL << 26) // THD, user, binlog /** The following speeds up inserts to InnoDB tables by suppressing unique key checks in some cases */ -#define OPTION_RELAXED_UNIQUE_CHECKS (ULL(1) << 27) // THD, user, binlog -#define SELECT_NO_UNLOCK (ULL(1) << 28) // SELECT, intern -#define OPTION_SCHEMA_TABLE (ULL(1) << 29) // SELECT, intern +#define OPTION_RELAXED_UNIQUE_CHECKS (1ULL << 27) // THD, user, binlog +#define SELECT_NO_UNLOCK (1ULL << 28) // SELECT, intern +#define OPTION_SCHEMA_TABLE (1ULL << 29) // SELECT, intern /** Flag set if setup_tables already done */ -#define OPTION_SETUP_TABLES_DONE (ULL(1) << 30) // intern +#define OPTION_SETUP_TABLES_DONE (1ULL << 30) // intern /** If not set then the thread will ignore all warnings with level notes. */ -#define OPTION_SQL_NOTES (ULL(1) << 31) // THD, user +#define OPTION_SQL_NOTES (1ULL << 31) // THD, user /** Force the used temporary table to be a MyISAM table (because we will use fulltext functions when reading from it. */ -#define TMP_TABLE_FORCE_MYISAM (ULL(1) << 32) -#define OPTION_PROFILING (ULL(1) << 33) - +#define TMP_TABLE_FORCE_MYISAM (1ULL << 32) +#define OPTION_PROFILING (1ULL << 33) /** @@ -1320,7 +1313,7 @@ bool wait_for_tables(THD *thd); 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, sys_var_str *init_command_var, +void execute_init_command(THD *thd, LEX_STRING *init_command, rw_lock_t *var_mutex); extern Field *not_found_field; extern Field *view_ref_found; @@ -1594,7 +1587,8 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, void remove_db_from_cache(const char *db); void flush_tables(); bool is_equal(const LEX_STRING *a, const LEX_STRING *b); -char *make_default_log_name(char *buff,const char* log_ext); +char *make_log_name(char *buff, const char *name, const char* log_ext); +extern char default_logfile_name[FN_REFLEN]; #ifdef WITH_PARTITION_STORAGE_ENGINE uint fast_alter_partition_table(THD *thd, TABLE *table, @@ -1860,10 +1854,6 @@ extern enum_field_types agg_field_type(Item **items, uint nitems); /* strfunc.cc */ ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs, char **err_pos, uint *err_len, bool *set_warning); -ulonglong find_set_from_flags(TYPELIB *lib, uint default_name, - ulonglong cur_set, ulonglong default_set, - const char *str, uint length, CHARSET_INFO *cs, - char **err_pos, uint *err_len, bool *set_warning); uint find_type(const TYPELIB *lib, const char *find, uint length, bool part_match); uint find_type2(const TYPELIB *lib, const char *find, uint length, @@ -1873,6 +1863,10 @@ uint check_word(TYPELIB *lib, const char *val, const char *end, const char **end_of_word); int find_string_in_array(LEX_STRING * const haystack, LEX_STRING * const needle, CHARSET_INFO * const cs); +char *set_to_string(THD *thd, LEX_STRING *result, ulonglong set, + const char *lib[]); +char *flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set, + const char *lib[]); bool is_keyword(const char *name, uint len); @@ -1897,7 +1891,9 @@ extern int creating_table; // How many mysql_create_table() are running extern time_t server_start_time, flush_status_time; #endif /* MYSQL_SERVER */ #if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS -extern uint mysql_data_home_len; +extern uint mysql_data_home_len, mysql_real_data_home_len; +extern const char *mysql_real_data_home_ptr; +extern uint thread_handling; extern MYSQL_PLUGIN_IMPORT char *mysql_data_home; extern char server_version[SERVER_VERSION_LENGTH]; @@ -1907,18 +1903,18 @@ extern char mysql_unpacked_real_data_home[]; extern CHARSET_INFO *character_set_filesystem; #endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ #ifdef MYSQL_SERVER -extern char *opt_mysql_tmpdir, mysql_charsets_dir[], - def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; +extern char *opt_mysql_tmpdir, mysql_charsets_dir[]; extern int mysql_unpacked_real_data_home_len; #define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list)) extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list; extern const LEX_STRING command_name[]; +extern LEX_STRING opt_init_connect, opt_init_slave; + extern const char *first_keyword, *delayed_user, *binary_keyword; extern MYSQL_PLUGIN_IMPORT const char *my_localhost; extern MYSQL_PLUGIN_IMPORT const char **errmesg; /* Error messages */ -extern const char *myisam_recover_options_str; extern const char *in_left_expr_name, *in_additional_cond, *in_having_cond; extern const char * const TRG_EXT; extern const char * const TRN_EXT; @@ -1929,15 +1925,16 @@ extern Lt_creator lt_creator; extern Ge_creator ge_creator; extern Le_creator le_creator; extern char lc_messages_dir[FN_REFLEN]; +extern char *lc_messages_dir_ptr, *log_error_file_ptr; #endif /* MYSQL_SERVER */ #if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN]; extern MYSQL_PLUGIN_IMPORT uint reg_ext_length; #endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ #ifdef MYSQL_SERVER +extern char *mysql_home_ptr, *pidfile_name_ptr; extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file; -extern char default_logfile_name[FN_REFLEN]; extern char log_error_file[FN_REFLEN], *opt_tc_log_file; extern ulonglong log_10_int[20]; extern ulonglong keybuff_size; @@ -1956,7 +1953,6 @@ extern ulong table_cache_size, table_def_size; extern MYSQL_PLUGIN_IMPORT ulong max_connections; extern ulong max_connect_errors, connect_timeout; extern ulong slave_net_timeout, slave_trans_retries; -extern uint max_user_connections; extern ulong what_to_log,flush_time; extern ulong query_buff_size; extern ulong max_prepared_stmt_count, prepared_stmt_count; @@ -1998,7 +1994,7 @@ extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded; extern bool opt_large_files, server_id_supplied; extern bool opt_update_log, opt_bin_log, opt_error_log; extern my_bool opt_log, opt_slow_log; -extern ulong log_output_options; +extern ulonglong log_output_options; extern my_bool opt_log_queries_not_using_indexes; extern bool opt_disable_networking, opt_skip_show_db; extern bool opt_ignore_builtin_innodb; @@ -2010,18 +2006,20 @@ extern uint connection_count; 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 uint slave_exec_mode_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; extern char* opt_secure_file_priv; extern my_bool opt_log_slow_admin_statements, opt_log_slow_slave_statements; -extern my_bool sp_automatic_privileges, opt_noacl; +extern my_bool sp_automatic_privileges, opt_noacl, disable_slaves; extern my_bool opt_old_style_user_limits, trust_function_creators; extern uint opt_crash_binlog_innodb; extern char *shared_memory_base_name, *mysqld_unix_port; extern my_bool opt_enable_shared_memory; extern char *default_tz_name; +extern Time_zone *default_tz; +extern char *default_storage_engine; #endif /* MYSQL_SERVER */ #if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern my_bool opt_large_pages; @@ -2030,6 +2028,7 @@ extern uint opt_large_page_size; #ifdef MYSQL_SERVER extern char *opt_logname, *opt_slow_logname; extern const char *log_output_str; +extern my_bool old_mode; extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log; extern LOGGER logger; @@ -2061,7 +2060,6 @@ extern pthread_cond_t COND_thread_count, COND_manager; extern pthread_cond_t COND_global_read_lock; extern pthread_attr_t connection_attrib; extern I_List threads; -extern I_List key_caches; extern MY_BITMAP temp_pool; extern String my_empty_string; extern const String my_null_string; @@ -2075,7 +2073,7 @@ extern struct system_variables max_system_variables; extern struct system_status_var global_status_var; extern struct rand_struct sql_rand; -extern const char *opt_date_time_formats[]; +extern DATE_TIME_FORMAT global_date_format, global_datetime_format, global_time_format; extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[]; extern String null_string; @@ -2089,8 +2087,11 @@ extern TYPELIB thread_handling_typelib; extern uint8 uc_update_queries[SQLCOM_END+1]; extern uint sql_command_flags[]; extern TYPELIB log_output_typelib; +extern const char *log_output_names[]; /* optional things, have_* variables */ +extern SHOW_COMP_OPTION have_csv, have_innodb; +extern SHOW_COMP_OPTION have_ndbcluster, have_partitioning; extern SHOW_COMP_OPTION have_profiling; extern handlerton *partition_hton; @@ -2111,6 +2112,9 @@ extern const char *load_default_groups[]; extern pthread_t signal_thread; #endif +extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher, + *opt_ssl_key; + #ifdef HAVE_OPENSSL extern struct st_VioSSLFd * ssl_acceptor_fd; #endif /* HAVE_OPENSSL */ @@ -2221,6 +2225,20 @@ bool calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign, extern LEX_STRING interval_type_to_name[]; + +bool parse_date_time_format(timestamp_type format_type, + const char *format, uint format_length, + DATE_TIME_FORMAT *date_time_format); +/* convenience wrapper */ +inline bool parse_date_time_format(timestamp_type format_type, + DATE_TIME_FORMAT *date_time_format) +{ + return parse_date_time_format(format_type, + date_time_format->format.str, + date_time_format->format.length, + date_time_format); +} + extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type, const char *format_str, uint format_length); @@ -2488,6 +2506,11 @@ inline void kill_delayed_threads(void) {} #define check_stack_overrun(A, B, C) 0 #endif +/* This must match the path length limit in the ER_NOT_RW_DIR error msg. */ +#define ER_NOT_RW_DIR_PATHSIZE 200 +bool is_usable_directory(THD *thd, const char *varname, + const char *path, const char *prefix); + /* Used by handlers to store things in schema tables */ #define IS_FILES_FILE_ID 0 #define IS_FILES_FILE_NAME 1 @@ -2563,6 +2586,58 @@ bool load_collation(MEM_ROOT *mem_root, CHARSET_INFO *dflt_cl, CHARSET_INFO **cl); +#define LONG_TIMEOUT ((ulong) 3600L*24L*365L) + +/** + only options that need special treatment in get_one_option() deserve + to be listed below +*/ +enum options_mysqld +{ + OPT_to_set_the_start_number=256, + OPT_BIND_ADDRESS, + OPT_BINLOG_DO_DB, + OPT_BINLOG_FORMAT, + OPT_BINLOG_IGNORE_DB, + OPT_BIN_LOG, + OPT_BOOTSTRAP, + OPT_CONSOLE, + OPT_DEBUG_SYNC_TIMEOUT, + OPT_DELAY_KEY_WRITE_ALL, + OPT_ISAM_LOG, + OPT_KEY_BUFFER_SIZE, + OPT_KEY_CACHE_AGE_THRESHOLD, + OPT_KEY_CACHE_BLOCK_SIZE, + OPT_KEY_CACHE_DIVISION_LIMIT, + OPT_LOWER_CASE_TABLE_NAMES, + OPT_ONE_THREAD, + OPT_POOL_OF_THREADS, + OPT_REPLICATE_DO_DB, + OPT_REPLICATE_DO_TABLE, + OPT_REPLICATE_IGNORE_DB, + OPT_REPLICATE_IGNORE_TABLE, + OPT_REPLICATE_REWRITE_DB, + OPT_REPLICATE_WILD_DO_TABLE, + OPT_REPLICATE_WILD_IGNORE_TABLE, + OPT_SAFE, + OPT_SERVER_ID, + OPT_SKIP_HOST_CACHE, + OPT_SKIP_LOCK, + OPT_SKIP_NEW, + OPT_SKIP_PRIOR, + OPT_SKIP_RESOLVE, + OPT_SKIP_STACK_TRACE, + OPT_SKIP_SYMLINKS, + OPT_SLOW_QUERY_LOG, + OPT_SSL_CA, + OPT_SSL_CAPATH, + OPT_SSL_CERT, + OPT_SSL_CIPHER, + OPT_SSL_KEY, + OPT_UPDATE_LOG, + OPT_WANT_CORE +}; + #endif /* MYSQL_SERVER */ extern "C" int test_if_data_home_dir(const char *dir); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 826e8a6c980..068a49d0ae6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -28,8 +28,9 @@ #include "events.h" #include "probes_mysql.h" #include "debug_sync.h" - +#include "keycaches.h" #include "../storage/myisam/ha_myisam.h" +#include "set_var.h" #include "rpl_injector.h" @@ -39,15 +40,6 @@ #include #endif -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE -#if defined(NOT_ENOUGH_TESTED) \ - && defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000 -#define OPT_NDB_SHM_DEFAULT 1 -#else -#define OPT_NDB_SHM_DEFAULT 0 -#endif -#endif - #include #include #include @@ -56,18 +48,6 @@ #define mysqld_charset &my_charset_latin1 -#ifdef HAVE_purify -#define IF_PURIFY(A,B) (A) -#else -#define IF_PURIFY(A,B) (B) -#endif - -#if SIZEOF_CHARP == 4 -#define MAX_MEM_TABLE_SIZE ~(ulong) 0 -#else -#define MAX_MEM_TABLE_SIZE ~(ulonglong) 0 -#endif - /* stack traces are only supported on linux intel */ #if defined(__linux__) && defined(__i386__) && defined(USE_PSTACK) #define HAVE_STACK_TRACE_ON_SEGV @@ -247,85 +227,6 @@ extern "C" sig_handler handle_segfault(int sig); /* Constants */ const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"}; -/* - WARNING: When adding new SQL modes don't forget to update the - tables definitions that stores it's value. - (ie: mysql.event, mysql.proc) -*/ -static const char *sql_mode_names[]= -{ - "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE", - "?", "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION", - "NO_DIR_IN_CREATE", - "POSTGRESQL", "ORACLE", "MSSQL", "DB2", "MAXDB", "NO_KEY_OPTIONS", - "NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40", "ANSI", - "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "STRICT_TRANS_TABLES", - "STRICT_ALL_TABLES", - "NO_ZERO_IN_DATE", "NO_ZERO_DATE", "ALLOW_INVALID_DATES", - "ERROR_FOR_DIVISION_BY_ZERO", - "TRADITIONAL", "NO_AUTO_CREATE_USER", "HIGH_NOT_PRECEDENCE", - "NO_ENGINE_SUBSTITUTION", - "PAD_CHAR_TO_FULL_LENGTH", - NullS -}; - -static const unsigned int sql_mode_names_len[]= -{ - /*REAL_AS_FLOAT*/ 13, - /*PIPES_AS_CONCAT*/ 15, - /*ANSI_QUOTES*/ 11, - /*IGNORE_SPACE*/ 12, - /*?*/ 1, - /*ONLY_FULL_GROUP_BY*/ 18, - /*NO_UNSIGNED_SUBTRACTION*/ 23, - /*NO_DIR_IN_CREATE*/ 16, - /*POSTGRESQL*/ 10, - /*ORACLE*/ 6, - /*MSSQL*/ 5, - /*DB2*/ 3, - /*MAXDB*/ 5, - /*NO_KEY_OPTIONS*/ 14, - /*NO_TABLE_OPTIONS*/ 16, - /*NO_FIELD_OPTIONS*/ 16, - /*MYSQL323*/ 8, - /*MYSQL40*/ 7, - /*ANSI*/ 4, - /*NO_AUTO_VALUE_ON_ZERO*/ 21, - /*NO_BACKSLASH_ESCAPES*/ 20, - /*STRICT_TRANS_TABLES*/ 19, - /*STRICT_ALL_TABLES*/ 17, - /*NO_ZERO_IN_DATE*/ 15, - /*NO_ZERO_DATE*/ 12, - /*ALLOW_INVALID_DATES*/ 19, - /*ERROR_FOR_DIVISION_BY_ZERO*/ 26, - /*TRADITIONAL*/ 11, - /*NO_AUTO_CREATE_USER*/ 19, - /*HIGH_NOT_PRECEDENCE*/ 19, - /*NO_ENGINE_SUBSTITUTION*/ 22, - /*PAD_CHAR_TO_FULL_LENGTH*/ 23 -}; - -TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"", - sql_mode_names, - (unsigned int *)sql_mode_names_len }; - -static const char *optimizer_switch_names[]= -{ - "index_merge","index_merge_union","index_merge_sort_union", - "index_merge_intersection", "default", NullS -}; -/* Corresponding defines are named OPTIMIZER_SWITCH_XXX */ -static const unsigned int optimizer_switch_names_len[]= -{ - sizeof("index_merge") - 1, - sizeof("index_merge_union") - 1, - sizeof("index_merge_sort_union") - 1, - sizeof("index_merge_intersection") - 1, - sizeof("default") - 1 -}; -TYPELIB optimizer_switch_typelib= { array_elements(optimizer_switch_names)-1,"", - optimizer_switch_names, - (unsigned int *)optimizer_switch_names_len }; static const char *tc_heuristic_recover_names[]= { @@ -337,26 +238,8 @@ static TYPELIB tc_heuristic_recover_typelib= tc_heuristic_recover_names, NULL }; -static const char *thread_handling_names[]= -{ "one-thread-per-connection", "no-threads", -#if HAVE_POOL_OF_THREADS == 1 - "pool-of-threads", -#endif - NullS}; - -TYPELIB thread_handling_typelib= -{ - array_elements(thread_handling_names) - 1, "", - thread_handling_names, NULL -}; - const char *first_keyword= "first", *binary_keyword= "BINARY"; const char *my_localhost= "localhost", *delayed_user= "DELAYED"; -#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES) -#define GET_HA_ROWS GET_ULL -#else -#define GET_HA_ROWS GET_ULONG -#endif bool opt_large_files= sizeof(my_off_t) > 4; @@ -387,26 +270,22 @@ static bool volatile ready_to_exit; static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; static my_bool opt_short_log_format= 0; static uint kill_cached_threads, wake_thread; -static ulong killed_threads, thread_created; +static ulong killed_threads; static ulong max_used_connections; static volatile ulong cached_thread_count= 0; -static const char *sql_mode_str= "OFF"; -/* Text representation for OPTIMIZER_SWITCH_DEFAULT */ -static const char *optimizer_switch_str="index_merge=on,index_merge_union=on," - "index_merge_sort_union=on," - "index_merge_intersection=on"; -static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr; -static char *opt_init_slave, *lc_messages_dir_ptr, *opt_init_connect; +static char *mysqld_user, *mysqld_chroot; static char *default_character_set_name; static char *character_set_filesystem_name; static char *lc_messages; static char *lc_time_names_name; static char *my_bind_addr_str; -static char *default_collation_name; -static char *default_storage_engine_str; +static char *default_collation_name; +char *default_storage_engine; static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME; static I_List thread_cache; -static double long_query_time; +static bool binlog_format_used= false; + +LEX_STRING opt_init_connect, opt_init_slave; static pthread_cond_t COND_thread_cache, COND_flush_thread_cache; @@ -414,7 +293,7 @@ static pthread_cond_t COND_thread_cache, COND_flush_thread_cache; bool opt_update_log, opt_bin_log, opt_ignore_builtin_innodb= 0; my_bool opt_log, opt_slow_log; -ulong log_output_options; +ulonglong log_output_options; my_bool opt_log_queries_not_using_indexes= 0; bool opt_error_log= IF_WIN(1,0); bool opt_disable_networking=0, opt_skip_show_db=0; @@ -456,6 +335,13 @@ my_bool opt_local_infile, opt_slave_compressed_protocol; my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; my_bool opt_log_slave_updates= 0; +char *opt_slave_skip_errors; + +/** + compatibility option: + - index usage hints (USE INDEX without a FOR clause) behave as in 5.0 +*/ +my_bool old_mode; /* Legacy global handlerton. These will be removed (please do not add more). @@ -464,38 +350,18 @@ handlerton *heap_hton; handlerton *myisam_hton; handlerton *partition_hton; -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE -const char *opt_ndbcluster_connectstring= 0; -const char *opt_ndb_connectstring= 0; -char opt_ndb_constrbuf[1024]= {0}; -unsigned opt_ndb_constrbuf_len= 0; -my_bool opt_ndb_shm, opt_ndb_optimized_node_selection; -ulong opt_ndb_cache_check_time; -const char *opt_ndb_mgmd; -ulong opt_ndb_nodeid; -ulong ndb_extra_logging; -#ifdef HAVE_NDB_BINLOG -ulong ndb_report_thresh_binlog_epoch_slip; -ulong ndb_report_thresh_binlog_mem_usage; -#endif - -extern const char *ndb_distribution_names[]; -extern TYPELIB ndb_distribution_typelib; -extern const char *opt_ndb_distribution; -extern enum ndb_distribution opt_ndb_distribution_id; -#endif -my_bool opt_readonly, use_temp_pool, relay_log_purge; +my_bool opt_readonly= 0, use_temp_pool, relay_log_purge; my_bool relay_log_recovery; my_bool opt_sync_frm, opt_allow_suspicious_udfs; my_bool opt_secure_auth= 0; -char* opt_secure_file_priv= 0; +char* opt_secure_file_priv; my_bool opt_log_slow_admin_statements= 0; my_bool opt_log_slow_slave_statements= 0; my_bool lower_case_file_system= 0; my_bool opt_large_pages= 0; my_bool opt_super_large_pages= 0; my_bool opt_myisam_use_mmap= 0; -uint opt_large_page_size= 0; +uint opt_large_page_size= 0; #if defined(ENABLED_DEBUG_SYNC) uint opt_debug_sync_timeout= 0; #endif /* defined(ENABLED_DEBUG_SYNC) */ @@ -514,27 +380,25 @@ const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS}; TYPELIB binlog_format_typelib= { array_elements(binlog_format_names) - 1, "", binlog_format_names, NULL }; -ulong opt_binlog_format_id= (ulong) BINLOG_FORMAT_UNSPEC; -const char *opt_binlog_format= binlog_format_names[opt_binlog_format_id]; #ifdef HAVE_INITGROUPS static bool calling_initgroups= FALSE; /**< Used in SIGSEGV handler. */ #endif uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options; uint mysqld_port_timeout; -uint delay_key_write_options, protocol_version; +uint delay_key_write_options; +uint protocol_version; uint lower_case_table_names; uint tc_heuristic_recover= 0; uint volatile thread_count; int32 thread_running; -ulonglong thd_startup_options; +ulong thread_created; ulong back_log, connect_timeout, concurrency, server_id; ulong table_cache_size, table_def_size; ulong what_to_log; ulong query_buff_size, slow_launch_time, slave_open_temp_tables; 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"; +uint slave_exec_mode_options; ulong thread_cache_size=0, thread_pool_size= 0; ulong binlog_cache_size=0; ulonglong max_binlog_cache_size=0; @@ -550,7 +414,6 @@ ulong delayed_insert_errors,flush_time; ulong specialflag=0; ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong max_connections, max_connect_errors; -uint max_user_connections= 0; /** Limit of the total number of prepared statements in the server. Is necessary to protect the server against out-of-memory attacks. @@ -573,7 +436,6 @@ uint sync_binlog_period= 0, sync_relaylog_period= 0, sync_relayloginfo_period= 0, sync_masterinfo_period= 0; ulong expire_logs_days = 0; ulong rpl_recovery_rank=0; -const char *log_output_str= "FILE"; time_t server_start_time, flush_status_time; @@ -584,25 +446,26 @@ char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN]; char mysql_real_data_home[FN_REFLEN], lc_messages_dir[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], - *opt_init_file, *opt_tc_log_file, - def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; + *opt_init_file, *opt_tc_log_file; +char *lc_messages_dir_ptr, *log_error_file_ptr; char err_shared_dir[FN_REFLEN]; char mysql_unpacked_real_data_home[FN_REFLEN]; int mysql_unpacked_real_data_home_len; +uint mysql_real_data_home_len, mysql_data_home_len= 1; uint reg_ext_length; const key_map key_map_empty(0); key_map key_map_full(0); // Will be initialized later -const char *opt_date_time_formats[3]; +DATE_TIME_FORMAT global_date_format, global_datetime_format, global_time_format; +Time_zone *default_tz; -uint mysql_data_home_len; -char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home; +char *mysql_data_home= const_cast("."); +const char *mysql_real_data_home_ptr= mysql_real_data_home; char server_version[SERVER_VERSION_LENGTH]; char *mysqld_unix_port, *opt_mysql_tmpdir; -const char *myisam_recover_options_str="OFF"; -const char *myisam_stats_method_str="nulls_unequal"; +uint thread_handling; -/** name of reference on left espression in rewritten IN subquery */ +/** name of reference on left expression in rewritten IN subquery */ const char *in_left_expr_name= ""; /** name of additional condition */ const char *in_additional_cond= ""; @@ -622,7 +485,6 @@ int bootstrap_error; FILE *stderror_file=0; I_List threads; -I_List key_caches; Rpl_filter* rpl_filter; Rpl_filter* binlog_filter; @@ -700,10 +562,9 @@ static my_bool opt_do_pstack; #endif /* HAVE_STACK_TRACE_ON_SEGV */ static my_bool opt_bootstrap, opt_myisam_log; static int cleanup_done; -static ulong opt_specialflag, opt_myisam_block_size; +static ulong opt_specialflag; static char *opt_update_logname, *opt_binlog_index_name; -static char *opt_tc_heuristic_recover; -static char *mysql_home_ptr, *pidfile_name_ptr; +char *mysql_home_ptr, *pidfile_name_ptr; static int defaults_argc; static char **defaults_argv; static char *opt_bin_logname; @@ -764,7 +625,6 @@ int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; #endif #ifdef HAVE_QUERY_CACHE -static ulong query_cache_limit= 0; ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE; Query_cache query_cache; #endif @@ -776,8 +636,10 @@ HANDLE smem_event_connect_request= 0; scheduler_functions thread_scheduler; -#define SSL_VARS_NOT_STATIC -#include "sslopt-vars.h" +my_bool opt_use_ssl = 0; +char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL, + *opt_ssl_cipher= NULL, *opt_ssl_key= NULL; + #ifdef HAVE_OPENSSL #include #ifndef HAVE_YASSL @@ -827,9 +689,6 @@ pthread_handler_t handle_connections_namedpipes(void *arg); pthread_handler_t handle_connections_shared_memory(void *arg); #endif pthread_handler_t handle_slave(void *arg); -static ulong find_bit_type(const char *x, TYPELIB *bit_lib); -static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib, - const char *option, int *error); static void clean_up(bool print_message); static int test_if_case_insensitive(const char *dir_name); @@ -1306,7 +1165,6 @@ void clean_up(bool print_message) item_user_lock_free(); lex_free(); /* Free some memory */ item_create_cleanup(); - set_var_free(); if (!opt_noacl) { #ifdef HAVE_DLOPEN @@ -1319,30 +1177,15 @@ void clean_up(bool print_message) tc_log->close(); delegates_destroy(); xid_cache_free(); - delete_elements(&key_caches, (void (*)(const char*, uchar*)) free_key_cache); + key_caches.delete_elements((void (*)(const char*, uchar*)) free_key_cache); multi_keycache_free(); free_status_vars(); end_thr_alarm(1); /* Free allocated memory */ my_free_open_file_info(); - my_free((char*) global_system_variables.date_format, - MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) global_system_variables.time_format, - MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) global_system_variables.datetime_format, - MYF(MY_ALLOW_ZERO_PTR)); if (defaults_argv) free_defaults(defaults_argv); - my_free(sys_init_connect.value, MYF(MY_ALLOW_ZERO_PTR)); - my_free(sys_init_slave.value, MYF(MY_ALLOW_ZERO_PTR)); - my_free(sys_var_general_log_path.value, MYF(MY_ALLOW_ZERO_PTR)); - my_free(sys_var_slow_log_path.value, MYF(MY_ALLOW_ZERO_PTR)); free_tmpdir(&mysql_tmpdir_list); -#ifdef HAVE_REPLICATION - my_free(slave_load_tmpdir,MYF(MY_ALLOW_ZERO_PTR)); -#endif x_free(opt_bin_logname); - x_free(opt_relay_logname); - x_free(opt_secure_file_priv); bitmap_free(&temp_pool); free_max_user_conn(); #ifdef HAVE_REPLICATION @@ -1366,7 +1209,7 @@ void clean_up(bool print_message) if (!opt_bootstrap) (void) my_delete(pidfile_name,MYF(0)); // This may not always exist #endif - if (print_message && /*errmesg &&*/ server_start_time) + if (print_message && my_default_lc_messages && server_start_time) sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname); cleanup_errmsgs(); thread_scheduler.end(); @@ -1382,6 +1225,7 @@ void clean_up(bool print_message) /* 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); + sys_var_end(); /* The following lines may never be executed as the main thread may have @@ -1461,7 +1305,6 @@ static void clean_up_mutexes() (void) pthread_cond_destroy(&COND_flush_thread_cache); (void) pthread_cond_destroy(&COND_manager); } - #endif /*EMBEDDED_LIBRARY*/ @@ -2989,10 +2832,6 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]); @param format_type What kind of format should be supported @param var_ptr Pointer to variable that should be updated - @note - The default value is taken from either opt_date_time_formats[] or - the ISO format (ANSI SQL) - @retval 0 ok @retval @@ -3000,27 +2839,21 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]); */ static bool init_global_datetime_format(timestamp_type format_type, - DATE_TIME_FORMAT **var_ptr) + DATE_TIME_FORMAT *format) { - /* Get command line option */ - const char *str= opt_date_time_formats[format_type]; + /* + Get command line option + format->format.str is already set by my_getopt + */ + format->format.length= strlen(format->format.str); - if (!str) // No specified format + if (parse_date_time_format(format_type, format)) { - str= get_date_time_format_str(&known_date_time_formats[ISO_FORMAT], - format_type); - /* - Set the "command line" option to point to the generated string so - that we can set global formats back to default - */ - opt_date_time_formats[format_type]= str; + fprintf(stderr, "Wrong date/time format specifier: %s\n", + format->format.str); + return true; } - if (!(*var_ptr= date_time_format_make(format_type, str, strlen(str)))) - { - fprintf(stderr, "Wrong date/time format specifier: %s\n", str); - return 1; - } - return 0; + return false; } SHOW_VAR com_status_vars[]= { @@ -3173,10 +3006,22 @@ SHOW_VAR com_status_vars[]= { {NullS, NullS, SHOW_LONG} }; +/** + Create the name of the default general log file + + @param[IN] buff Location for building new string. + @param[IN] log_ext The extension for the file (e.g .log) + @returns Pointer to a new string containing the name +*/ +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) { - char buff[FN_REFLEN], *s; + char buff[FN_REFLEN]; umask(((~my_umask) & 0666)); my_decimal_set_zero(&decimal_zero); // set decimal_zero constant; tzset(); // Set tzname @@ -3418,12 +3263,6 @@ static int init_common_variables(const char *conf_file_name, int argc, if (item_create_init()) return 1; item_init(); - if (set_var_init()) - return 1; -#ifdef HAVE_REPLICATION - if (init_replication_sys_vars()) - return 1; -#endif mysys_uses_curses=0; #ifdef USE_REGEX my_regex_init(&my_charset_latin1); @@ -3478,8 +3317,7 @@ static int init_common_variables(const char *conf_file_name, int argc, global_system_variables.collation_database= default_charset_info; global_system_variables.collation_connection= default_charset_info; global_system_variables.character_set_results= default_charset_info; - global_system_variables.character_set_client= default_charset_info; - + global_system_variables.character_set_client= default_charset_info; if (!(character_set_filesystem= get_charset_by_csname(character_set_filesystem_name, MY_CS_PRIMARY, MYF(MY_WME)))) @@ -3493,20 +3331,6 @@ static int init_common_variables(const char *conf_file_name, int argc, return 1; } global_system_variables.lc_time_names= my_default_lc_time_names; - - sys_init_connect.value_length= 0; - if ((sys_init_connect.value= opt_init_connect)) - sys_init_connect.value_length= strlen(opt_init_connect); - else - sys_init_connect.value=my_strdup("",MYF(0)); - sys_init_connect.is_os_charset= TRUE; - - sys_init_slave.value_length= 0; - if ((sys_init_slave.value= opt_init_slave)) - sys_init_slave.value_length= strlen(opt_init_slave); - else - sys_init_slave.value=my_strdup("",MYF(0)); - sys_init_slave.is_os_charset= TRUE; /* check log options and issue warnings if needed */ if (opt_log && opt_logname && !(log_output_options & LOG_FILE) && @@ -3521,13 +3345,17 @@ static int init_common_variables(const char *conf_file_name, int argc, "--log-slow-queries option, log tables are used. " "To enable logging to files use the --log-output=file option."); - s= opt_logname ? opt_logname : make_default_log_name(buff, ".log"); - sys_var_general_log_path.value= my_strdup(s, MYF(0)); - sys_var_general_log_path.value_length= strlen(s); +#define FIX_LOG_VAR(VAR, ALT) \ + if (!VAR || !*VAR) \ + { \ + x_free(VAR); /* it could be an allocated empty string "" */ \ + VAR= my_strdup(ALT, MYF(0)); \ + } - s= opt_slow_logname ? opt_slow_logname : make_default_log_name(buff, "-slow.log"); - sys_var_slow_log_path.value= my_strdup(s, MYF(0)); - sys_var_slow_log_path.value_length= strlen(s); + FIX_LOG_VAR(opt_logname, + make_default_log_name(buff, ".log")); + FIX_LOG_VAR(opt_slow_logname, + make_default_log_name(buff, "-slow.log")); #if defined(ENABLED_DEBUG_SYNC) /* Initialize the debug sync facility. See debug_sync.cc. */ @@ -3790,7 +3618,7 @@ static void end_ssl() static int init_server_components() { - FILE* reopen; + FILE *reopen; DBUG_ENTER("init_server_components"); /* We need to call each of these following functions to ensure that @@ -3799,7 +3627,6 @@ static int init_server_components() if (table_cache_init() | table_def_init() | hostname_cache_init()) unireg_abort(1); - query_cache_result_size_limit(query_cache_limit); query_cache_set_min_res_unit(query_cache_min_res_unit); query_cache_init(); query_cache_resize(query_cache_size); @@ -3826,7 +3653,7 @@ static int init_server_components() fn_format(log_error_file, log_error_file_ptr, mysql_data_home, ".err", MY_UNPACK_FILENAME | MY_SAFE_PATH); if (!log_error_file[0]) - opt_error_log= 1; // Too long file name + opt_error_log= 0; // Too long file name else { #ifndef EMBEDDED_LIBRARY @@ -3913,27 +3740,9 @@ with --log-bin instead."); sql_print_warning("You need to use --log-bin to make " "--log-slave-updates work."); } - if (!opt_bin_log) - { - if (opt_binlog_format_id != BINLOG_FORMAT_UNSPEC) - { - sql_print_warning("You need to use --log-bin to make " - "--binlog-format work."); - - global_system_variables.binlog_format= opt_binlog_format_id; - } - else - { - global_system_variables.binlog_format= BINLOG_FORMAT_STMT; - } - } - else - if (opt_binlog_format_id == BINLOG_FORMAT_UNSPEC) - global_system_variables.binlog_format= BINLOG_FORMAT_STMT; - else - { - DBUG_ASSERT(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC); - } + if (!opt_bin_log && binlog_format_used) + sql_print_warning("You need to use --log-bin to make " + "--binlog-format work."); /* Check that we have not let the format to unspecified at this point */ DBUG_ASSERT((uint)global_system_variables.binlog_format <= @@ -4015,19 +3824,21 @@ 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, - (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) | - (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0))) - { - sql_print_error("Failed to initialize plugins."); - unireg_abort(1); - } - plugins_are_initialized= TRUE; /* Don't separate from init function */ + if (plugin_init(&defaults_argc, defaults_argv, + (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) | + (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0))) + { + sql_print_error("Failed to initialize plugins."); + unireg_abort(1); } + plugins_are_initialized= TRUE; /* Don't separate from init function */ - if (opt_help) - unireg_abort(0); + have_csv= plugin_status(STRING_WITH_LEN("csv"), + MYSQL_STORAGE_ENGINE_PLUGIN); + have_ndbcluster= plugin_status(STRING_WITH_LEN("ndbcluster"), + MYSQL_STORAGE_ENGINE_PLUGIN); + have_partitioning= plugin_status(STRING_WITH_LEN("partition"), + MYSQL_STORAGE_ENGINE_PLUGIN); /* we do want to exit if there are any other unknown options */ if (defaults_argc > 1) @@ -4060,6 +3871,9 @@ a file name for --log-bin-index option", opt_binlog_index_name); } } + if (opt_help) + unireg_abort(0); + /* if the errmsg.sys is not loaded, terminate to maintain behaviour */ if (!DEFAULT_ERRMSGS[0][0]) unireg_abort(1); @@ -4111,42 +3925,37 @@ a file name for --log-bin-index option", opt_binlog_index_name); #endif /* - Check that the default storage engine is actually available. + Set the default storage engine */ - if (default_storage_engine_str) + LEX_STRING name= { default_storage_engine, strlen(default_storage_engine) }; + plugin_ref plugin; + handlerton *hton; + if ((plugin= ha_resolve_by_name(0, &name))) + hton= plugin_data(plugin, handlerton*); + else { - LEX_STRING name= { default_storage_engine_str, - strlen(default_storage_engine_str) }; - plugin_ref plugin; - handlerton *hton; - - if ((plugin= ha_resolve_by_name(0, &name))) - hton= plugin_data(plugin, handlerton*); - else + sql_print_error("Unknown/unsupported storage engine: %s", + default_storage_engine); + unireg_abort(1); + } + if (!ha_storage_engine_is_enabled(hton)) + { + if (!opt_bootstrap) { - sql_print_error("Unknown/unsupported table type: %s", - default_storage_engine_str); + sql_print_error("Default storage engine (%s) is not available", + default_storage_engine); unireg_abort(1); } - if (!ha_storage_engine_is_enabled(hton)) - { - if (!opt_bootstrap) - { - sql_print_error("Default storage engine (%s) is not available", - default_storage_engine_str); - unireg_abort(1); - } - DBUG_ASSERT(global_system_variables.table_plugin); - } - else - { - /* - Need to unlock as global_system_variables.table_plugin - was acquired during plugin_init() - */ - plugin_unlock(0, global_system_variables.table_plugin); - global_system_variables.table_plugin= plugin; - } + DBUG_ASSERT(global_system_variables.table_plugin); + } + else + { + /* + Need to unlock as global_system_variables.table_plugin + was acquired during plugin_init() + */ + plugin_unlock(0, global_system_variables.table_plugin); + global_system_variables.table_plugin= plugin; } tc_log= (total_ha_2pc > 1 ? (opt_bin_log ? @@ -4446,10 +4255,6 @@ int main(int argc, char **argv) check_data_home(mysql_real_data_home); if (my_setwd(mysql_real_data_home,MYF(MY_WME)) && !opt_help) unireg_abort(1); /* purecov: inspected */ - mysql_data_home= mysql_data_home_buff; - mysql_data_home[0]=FN_CURLIB; // all paths are relative from here - mysql_data_home[1]=0; - mysql_data_home_len= 2; if ((user_info= check_user(mysqld_user))) { @@ -4517,6 +4322,7 @@ int main(int argc, char **argv) unlink(mysqld_unix_port); exit(1); } + if (!opt_noacl) (void) grant_init(); @@ -4555,7 +4361,7 @@ int main(int argc, char **argv) bootstrap(stdin); unireg_abort(bootstrap_error ? 1 : 0); } - if (opt_init_file) + if (opt_init_file && *opt_init_file) { if (read_init_file(opt_init_file)) unireg_abort(1); @@ -5611,179 +5417,13 @@ error: Handle start options ******************************************************************************/ -enum options_mysqld -{ - OPT_ISAM_LOG=256, OPT_SKIP_NEW, - OPT_SKIP_GRANT, OPT_SKIP_LOCK, - OPT_ENABLE_LOCK, OPT_USE_LOCKING, - OPT_SOCKET, OPT_UPDATE_LOG, - OPT_BIN_LOG, OPT_SKIP_RESOLVE, - OPT_SKIP_NETWORKING, OPT_BIN_LOG_INDEX, - OPT_BIND_ADDRESS, OPT_PID_FILE, - OPT_SKIP_PRIOR, OPT_BIG_TABLES, - OPT_STANDALONE, OPT_ONE_THREAD, - OPT_CONSOLE, OPT_LOW_PRIORITY_UPDATES, - OPT_SKIP_HOST_CACHE, OPT_SHORT_LOG_FORMAT, - OPT_FLUSH, OPT_SAFE, - OPT_BOOTSTRAP, OPT_SKIP_SHOW_DB, - OPT_STORAGE_ENGINE, OPT_INIT_FILE, - OPT_DELAY_KEY_WRITE_ALL, OPT_SLOW_QUERY_LOG, - OPT_DELAY_KEY_WRITE, OPT_CHARSETS_DIR, - OPT_MASTER_INFO_FILE, - OPT_MASTER_RETRY_COUNT, OPT_LOG_TC, OPT_LOG_TC_SIZE, - OPT_SQL_BIN_UPDATE_SAME, OPT_REPLICATE_DO_DB, - OPT_REPLICATE_IGNORE_DB, OPT_LOG_SLAVE_UPDATES, - OPT_BINLOG_DO_DB, OPT_BINLOG_IGNORE_DB, - OPT_BINLOG_FORMAT, -#ifndef DBUG_OFF - OPT_BINLOG_SHOW_XID, -#endif - OPT_BINLOG_ROWS_EVENT_MAX_SIZE, - OPT_WANT_CORE, OPT_CONCURRENT_INSERT, - OPT_MEMLOCK, OPT_MYISAM_RECOVER, - OPT_REPLICATE_REWRITE_DB, OPT_SERVER_ID, - OPT_SKIP_SLAVE_START, OPT_SAFE_SHOW_DB, - OPT_SAFEMALLOC_MEM_LIMIT, OPT_REPLICATE_DO_TABLE, - OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE, - OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID, - OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER, - OPT_ABORT_SLAVE_EVENT_COUNT, - OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, - OPT_ENGINE_CONDITION_PUSHDOWN, OPT_NDB_CONNECTSTRING, - OPT_NDB_USE_EXACT_COUNT, OPT_NDB_USE_TRANSACTIONS, - OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, - OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_CACHE_CHECK_TIME, - OPT_NDB_MGMD, OPT_NDB_NODEID, - OPT_NDB_DISTRIBUTION, - OPT_NDB_INDEX_STAT_ENABLE, - OPT_NDB_EXTRA_LOGGING, - OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP, - OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE, - OPT_NDB_USE_COPYING_ALTER_TABLE, - OPT_SKIP_SAFEMALLOC, - OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE, - OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, - OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL, - OPT_SAFE_USER_CREATE, OPT_SQL_MODE, - OPT_HAVE_NAMED_PIPE, - OPT_DO_PSTACK, OPT_EVENT_SCHEDULER, OPT_REPORT_HOST, - OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT, - OPT_SHOW_SLAVE_AUTH_INFO, - OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE, - OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE, - OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE, - OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE, - OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, - OPT_SSL_CAPATH, OPT_SSL_CIPHER, - OPT_BACK_LOG, OPT_BINLOG_CACHE_SIZE, - OPT_CONNECT_TIMEOUT, OPT_DELAYED_INSERT_TIMEOUT, - OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE, - OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN, OPT_FT_BOOLEAN_SYNTAX, - OPT_FT_MAX_WORD_LEN, OPT_FT_QUERY_EXPANSION_LIMIT, OPT_FT_STOPWORD_FILE, - OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE, - OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE, - OPT_KEY_CACHE_DIVISION_LIMIT, OPT_KEY_CACHE_AGE_THRESHOLD, - OPT_LONG_QUERY_TIME, - OPT_LOWER_CASE_TABLE_NAMES, OPT_MAX_ALLOWED_PACKET, - OPT_MAX_BINLOG_CACHE_SIZE, OPT_MAX_BINLOG_SIZE, - OPT_MAX_CONNECTIONS, OPT_MAX_CONNECT_ERRORS, - OPT_MAX_DELAYED_THREADS, OPT_MAX_HEP_TABLE_SIZE, - OPT_MAX_JOIN_SIZE, OPT_MAX_PREPARED_STMT_COUNT, - OPT_MAX_RELAY_LOG_SIZE, OPT_MAX_SORT_LENGTH, - OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS, - OPT_MAX_LENGTH_FOR_SORT_DATA, - OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE, - OPT_MAX_ERROR_COUNT, OPT_MULTI_RANGE_COUNT, OPT_MYISAM_DATA_POINTER_SIZE, - OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, - OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE, - OPT_MYISAM_USE_MMAP, OPT_MYISAM_REPAIR_THREADS, - OPT_MYISAM_MMAP_SIZE, - OPT_MYISAM_STATS_METHOD, - OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT, - OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT, - OPT_OPEN_FILES_LIMIT, - OPT_PRELOAD_BUFFER_SIZE, - OPT_QUERY_CACHE_LIMIT, OPT_QUERY_CACHE_MIN_RES_UNIT, OPT_QUERY_CACHE_SIZE, - OPT_QUERY_CACHE_TYPE, OPT_QUERY_CACHE_WLOCK_INVALIDATE, OPT_RECORD_BUFFER, - OPT_RECORD_RND_BUFFER, OPT_DIV_PRECINCREMENT, OPT_RELAY_LOG_SPACE_LIMIT, - OPT_RELAY_LOG_PURGE, - OPT_RELAY_LOG_RECOVERY, - OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME, - OPT_SLAVE_TRANS_RETRIES, OPT_READONLY, OPT_DEBUGGING, - OPT_SORT_BUFFER, OPT_TABLE_OPEN_CACHE, OPT_TABLE_DEF_CACHE, - OPT_THREAD_CONCURRENCY, OPT_THREAD_CACHE_SIZE, - OPT_TMP_TABLE_SIZE, OPT_THREAD_STACK, - OPT_WAIT_TIMEOUT, - OPT_ERROR_LOG_FILE, - OPT_DEFAULT_WEEK_FORMAT, - OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_ALLOW_SUSPICIOUS_UDFS, - OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, - OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE, - OPT_SYNC_FRM, OPT_SYNC_BINLOG, - OPT_SYNC_REPLICATION, - OPT_SYNC_REPLICATION_SLAVE_ID, - OPT_SYNC_REPLICATION_TIMEOUT, - OPT_ENABLE_SHARED_MEMORY, - OPT_SHARED_MEMORY_BASE_NAME, - OPT_OLD_PASSWORDS, - OPT_OLD_ALTER_TABLE, - OPT_EXPIRE_LOGS_DAYS, - OPT_GROUP_CONCAT_MAX_LEN, - OPT_DEFAULT_COLLATION, - OPT_CHARACTER_SET_CLIENT_HANDSHAKE, - OPT_CHARACTER_SET_FILESYSTEM, - OPT_LC_ERROR_MESSAGES, - OPT_LC_TIME_NAMES, - OPT_INIT_CONNECT, - OPT_INIT_SLAVE, - OPT_SECURE_AUTH, - OPT_DATE_FORMAT, - OPT_TIME_FORMAT, - OPT_DATETIME_FORMAT, - OPT_LOG_QUERIES_NOT_USING_INDEXES, - OPT_DEFAULT_TIME_ZONE, - OPT_SYSDATE_IS_NOW, - OPT_OPTIMIZER_SEARCH_DEPTH, - OPT_OPTIMIZER_PRUNE_LEVEL, - OPT_OPTIMIZER_SWITCH, - OPT_UPDATABLE_VIEWS_WITH_LIMIT, - OPT_SP_AUTOMATIC_PRIVILEGES, - OPT_MAX_SP_RECURSION_DEPTH, - OPT_AUTO_INCREMENT, OPT_AUTO_INCREMENT_OFFSET, - OPT_ENABLE_LARGE_PAGES, - OPT_ENABLE_SUPER_LARGE_PAGES, - OPT_TIMED_MUTEXES, - OPT_OLD_STYLE_USER_LIMITS, - OPT_LOG_SLOW_ADMIN_STATEMENTS, - OPT_TABLE_LOCK_WAIT_TIMEOUT, - OPT_PLUGIN_LOAD, - OPT_PLUGIN_DIR, - OPT_LOG_OUTPUT, - OPT_PORT_OPEN_TIMEOUT, - OPT_PROFILING, - OPT_KEEP_FILES_ON_CREATE, - OPT_GENERAL_LOG, - OPT_SLOW_LOG, - OPT_THREAD_HANDLING, - OPT_INNODB_ROLLBACK_ON_TIMEOUT, - OPT_SECURE_FILE_PRIV, - OPT_MIN_EXAMINED_ROW_LIMIT, - OPT_LOG_SLOW_SLAVE_STATEMENTS, -#if defined(ENABLED_DEBUG_SYNC) - OPT_DEBUG_SYNC_TIMEOUT, -#endif /* defined(ENABLED_DEBUG_SYNC) */ - OPT_OLD_MODE, - OPT_SLAVE_EXEC_MODE, - OPT_GENERAL_LOG_FILE, - OPT_SLOW_QUERY_LOG_FILE, - OPT_IGNORE_BUILTIN_INNODB, - OPT_SYNC_RELAY_LOG, - OPT_SYNC_RELAY_LOG_INFO, - OPT_SYNC_MASTER_INFO -}; +DYNAMIC_ARRAY all_options; - -#define LONG_TIMEOUT ((ulong) 3600L*24L*365L) +/** + System variables are automatically command-line options (few + exceptions are documented in sys_var.h), so don't need + to be listed here. +*/ struct my_option my_long_options[] = { @@ -5791,12 +5431,12 @@ struct my_option my_long_options[] = (uchar**) &opt_help, (uchar**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION - {"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT, + {"abort-slave-event-count", 0, "Option used by mysql-test for debugging and testing of replication.", (uchar**) &abort_slave_event_count, (uchar**) &abort_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ - {"allow-suspicious-udfs", OPT_ALLOW_SUSPICIOUS_UDFS, + {"allow-suspicious-udfs", 0, "Allows use of UDFs consisting of only one symbol xxx() " "without corresponding xxx_init() or xxx_deinit(). That also means " "that one can load any function from any library, for example exit() " @@ -5805,51 +5445,16 @@ struct my_option my_long_options[] = 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode will also set transaction isolation level 'serializable'.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"auto-increment-increment", OPT_AUTO_INCREMENT, - "Auto-increment columns are incremented by this", - (uchar**) &global_system_variables.auto_increment_increment, - (uchar**) &max_system_variables.auto_increment_increment, 0, GET_ULONG, - OPT_ARG, 1, 1, 65535, 0, 1, 0 }, - {"auto-increment-offset", OPT_AUTO_INCREMENT_OFFSET, - "Offset added to Auto-increment columns. Used when auto-increment-increment != 1", - (uchar**) &global_system_variables.auto_increment_offset, - (uchar**) &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG, - 1, 1, 65535, 0, 1, 0 }, - {"automatic-sp-privileges", OPT_SP_AUTOMATIC_PRIVILEGES, - "Creating and dropping stored procedures alters ACLs. Disable with --skip-automatic-sp-privileges.", - (uchar**) &sp_automatic_privileges, (uchar**) &sp_automatic_privileges, - 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"basedir", 'b', - "Path to installation directory. All paths are usually resolved relative to this.", - (uchar**) &mysql_home_ptr, (uchar**) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, - {"big-tables", OPT_BIG_TABLES, - "Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors).", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.", (uchar**) &my_bind_addr_str, (uchar**) &my_bind_addr_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"binlog_format", OPT_BINLOG_FORMAT, - "Does not have any effect without '--log-bin'. " - "Tell the master the form of binary logging to use: either 'row' for " - "row-based binary logging, or 'statement' for statement-based binary " - "logging, or 'mixed'. 'mixed' is statement-based binary logging except " - "for those statements where only row-based is correct: those which " - "involve user-defined functions (i.e. UDFs) or the UUID() function; for " - "those, row-based binary logging is automatically used. " -#ifdef HAVE_NDB_BINLOG - "If ndbcluster is enabled and binlog_format is `mixed', the format switches" - " to 'row' and back implicitly per each query accessing a NDB table." -#endif - ,(uchar**) &opt_binlog_format, (uchar**) &opt_binlog_format, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"binlog-do-db", OPT_BINLOG_DO_DB, "Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB, "Tells the master that updates to the given database should not be logged tothe binary log.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"binlog-row-event-max-size", OPT_BINLOG_ROWS_EVENT_MAX_SIZE, + {"binlog-row-event-max-size", 0, "The maximum size of a row-based binary log event in bytes. Rows will be " "grouped into events smaller than this size if possible. " "The value has to be a multiple of 256.", @@ -5864,12 +5469,12 @@ struct my_option my_long_options[] = {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE, + {"character-set-client-handshake", 0, "Don't ignore client side character set value sent during handshake.", (uchar**) &opt_character_set_client_handshake, (uchar**) &opt_character_set_client_handshake, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM, + {"character-set-filesystem", 0, "Set the filesystem character set.", (uchar**) &character_set_filesystem_name, (uchar**) &character_set_filesystem_name, @@ -5877,229 +5482,114 @@ struct my_option my_long_options[] = {"character-set-server", 'C', "Set the default character set.", (uchar**) &default_character_set_name, (uchar**) &default_character_set_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory where character sets are.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"chroot", 'r', "Chroot mysqld daemon during startup.", (uchar**) &mysqld_chroot, (uchar**) &mysqld_chroot, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"collation-server", OPT_DEFAULT_COLLATION, "Set the default collation.", + {"collation-server", 0, "Set the default collation.", (uchar**) &default_collation_name, (uchar**) &default_collation_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"completion-type", OPT_COMPLETION_TYPE, "Default completion type.", - (uchar**) &global_system_variables.completion_type, - (uchar**) &max_system_variables.completion_type, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, 2, 0, 1, 0}, - {"concurrent-insert", OPT_CONCURRENT_INSERT, - "Use concurrent insert with MyISAM. Disable with --concurrent-insert=0", - (uchar**) &myisam_concurrent_insert, (uchar**) &myisam_concurrent_insert, - 0, GET_ULONG, OPT_ARG, 1, 0, 2, 0, 0, 0}, {"console", OPT_CONSOLE, "Write error output on screen; Don't remove the console window on windows.", (uchar**) &opt_console, (uchar**) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"datadir", 'h', "Path to the database root.", (uchar**) &mysql_data_home, - (uchar**) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#ifndef DBUG_OFF - {"debug", '#', "Debug log.", (uchar**) &default_dbug_option, - (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#endif {"default-character-set", 'C', "Set the default character set (deprecated option, use --character-set-server instead).", (uchar**) &default_character_set_name, (uchar**) &default_character_set_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation (deprecated option, use --collation-server instead).", + {"default-collation", 0, "Set the default collation (deprecated option, use --collation-server instead).", (uchar**) &default_collation_name, (uchar**) &default_collation_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"default-storage-engine", OPT_STORAGE_ENGINE, - "Set the default storage engine (table type) for tables.", - (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.", + {"default-storage-engine", 0, "The default storage engine for new tables", + (uchar**) &default_storage_engine, 0, 0, GET_STR, REQUIRED_ARG, + (longlong)"MyISAM", 0, 0, 0, 0, 0 }, + {"default-time-zone", 0, "Set the default time zone.", (uchar**) &default_tz_name, (uchar**) &default_tz_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE.", - 0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL, "Don't flush key buffers between writes for any MyISAM table (Deprecated option, use --delay-key-write=all instead).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_OPENSSL - {"des-key-file", OPT_DES_KEY_FILE, + {"des-key-file", 0, "Load keys for des_encrypt() and des_encrypt from given file.", (uchar**) &des_key_file, (uchar**) &des_key_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_OPENSSL */ #ifdef HAVE_REPLICATION - {"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT, + {"disconnect-slave-event-count", 0, "Option used by mysql-test for debugging and testing of replication.", (uchar**) &disconnect_slave_event_count, (uchar**) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ - {"enable-locking", OPT_ENABLE_LOCK, + {"enable-locking", 0, "Deprecated option, use --external-locking instead.", (uchar**) &opt_external_locking, (uchar**) &opt_external_locking, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef _WIN32 - {"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).", - (uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL, - NO_ARG, 0, 0, 0, 0, 0, 0}, -#endif #ifdef HAVE_STACK_TRACE_ON_SEGV - {"enable-pstack", OPT_DO_PSTACK, "Print a symbolic stack trace on failure.", + {"enable-pstack", 0, "Print a symbolic stack trace on failure.", (uchar**) &opt_do_pstack, (uchar**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_STACK_TRACE_ON_SEGV */ - {"engine-condition-pushdown", - OPT_ENGINE_CONDITION_PUSHDOWN, - "Push supported query conditions to the storage engine.", - (uchar**) &global_system_variables.engine_condition_pushdown, - (uchar**) &global_system_variables.engine_condition_pushdown, - 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, /* See how it's handled in get_one_option() */ - {"event-scheduler", OPT_EVENT_SCHEDULER, "Enable/disable the event scheduler.", - NULL, NULL, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"exit-info", 'T', "Used for debugging; Use at your own risk!", 0, 0, 0, GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"external-locking", OPT_USE_LOCKING, "Use system (external) locking (disabled by default). With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.", + {"external-locking", 0, "Use system (external) locking (disabled by default). With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.", (uchar**) &opt_external_locking, (uchar**) &opt_external_locking, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0, - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, /* We must always support the next option to make scripts like mysqltest easier to do */ - {"gdb", OPT_DEBUGGING, + {"gdb", 0, "Set up signals usable for debugging", (uchar**) &opt_debugging, (uchar**) &opt_debugging, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"general_log", OPT_GENERAL_LOG, - "Enable|disable general log", (uchar**) &opt_log, - (uchar**) &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_LARGE_PAGE_OPTION - {"large-pages", OPT_ENABLE_LARGE_PAGES, "Enable support for large pages. \ -Disable with --skip-large-pages.", - (uchar**) &opt_large_pages, (uchar**) &opt_large_pages, 0, GET_BOOL, - NO_ARG, 0, 0, 1, 0, 1, 0}, - {"super-large-pages", OPT_ENABLE_SUPER_LARGE_PAGES, - "Enable support for super large pages. \ -Disable with --skip-super-large-pages.", + {"super-large-pages", 0, "Enable support for super large pages.", (uchar**) &opt_super_large_pages, (uchar**) &opt_super_large_pages, 0, - GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, + GET_BOOL, OPT_ARG, 0, 0, 1, 0, 1, 0}, #endif - {"ignore-builtin-innodb", OPT_IGNORE_BUILTIN_INNODB , - "Disable initialization of builtin InnoDB plugin", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection", - (uchar**) &opt_init_connect, (uchar**) &opt_init_connect, 0, GET_STR_ALLOC, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#ifndef DISABLE_GRANT_OPTIONS - {"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.", - (uchar**) &opt_init_file, (uchar**) &opt_init_file, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, -#endif - {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed by a slave server \ -each time the SQL thread starts.", - (uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"language", 'L', "Client error messages in given language. May be given as a full path. " "Deprecated. Use --lc-messages-dir instead.", (uchar**) &lc_messages_dir_ptr, (uchar**) &lc_messages_dir_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"lc-messages-dir", 'L', - "Directory where error messages are.", (uchar**) &lc_messages_dir_ptr, - (uchar**) &lc_messages_dir_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"lc-messages", OPT_LC_ERROR_MESSAGES, + {"lc-messages", 0, "Set the language used for the error messages.", (uchar**) &lc_messages, (uchar**) &lc_messages, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"lc-time-names", OPT_LC_TIME_NAMES, + {"lc-time-names", 0, "Set the language used for the month names and the days of the week.", (uchar**) &lc_time_names_name, (uchar**) &lc_time_names_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"local-infile", OPT_LOCAL_INFILE, - "Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).", - (uchar**) &opt_local_infile, - (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, - 1, 0, 0, 0, 0, 0}, {"log", 'l', "Log connections and queries to file (deprecated option, use " - "--general_log/--general_log_file instead).", (uchar**) &opt_logname, - (uchar**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"general_log_file", OPT_GENERAL_LOG_FILE, - "Log connections and queries to given file.", (uchar**) &opt_logname, - (uchar**) &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "--general-log/--general-log-file instead).", (uchar**) &opt_logname, + (uchar**) &opt_logname, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-bin", OPT_BIN_LOG, "Log update queries in binary format. Optional (but strongly recommended " "to avoid replication problems if server's hostname changes) argument " "should be the chosen location for the binary log files.", (uchar**) &opt_bin_logname, (uchar**) &opt_bin_logname, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"log-bin-index", OPT_BIN_LOG_INDEX, + {"log-bin-index", 0, "File that holds the names for last binary log files.", (uchar**) &opt_binlog_index_name, (uchar**) &opt_binlog_index_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#ifndef TO_BE_REMOVED_IN_5_1_OR_6_0 - /* - In 5.0.6 we introduced the below option, then in 5.0.16 we renamed it to - log-bin-trust-function-creators but kept also the old name for - compatibility; the behaviour was also changed to apply only to functions - (and triggers). In a future release this old name could be removed. - */ - {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, - "(deprecated) Use log-bin-trust-function-creators.", - (uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0, - GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -#endif - /* - This option starts with "log-bin" to emphasize that it is specific of - binary logging. - */ - {"log-bin-trust-function-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, - "If equal to 0 (the default), then when --log-bin is used, creation of " - "a stored function (or trigger) is allowed only to users having the SUPER privilege " - "and only if this stored function (trigger) may not break binary logging." - "Note that if ALL connections to this server ALWAYS use row-based binary " - "logging, the security issues do not exist and the binary logging cannot " - "break, so you can safely set this to 1." - ,(uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0, - GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"log-error", OPT_ERROR_LOG_FILE, "Error log file.", - (uchar**) &log_error_file_ptr, (uchar**) &log_error_file_ptr, 0, GET_STR, - OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.", (uchar**) &myisam_log_filename, (uchar**) &myisam_log_filename, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-long-format", '0', "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef WITH_CSV_STORAGE_ENGINE - {"log-output", OPT_LOG_OUTPUT, - "Syntax: log-output[=value[,value...]], where \"value\" could be TABLE, " - "FILE or NONE.", - (uchar**) &log_output_str, (uchar**) &log_output_str, 0, - GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#endif - {"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES, - "Log queries that are executed without benefit of any index to the slow log if it is open.", - (uchar**) &opt_log_queries_not_using_indexes, (uchar**) &opt_log_queries_not_using_indexes, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"log-short-format", OPT_SHORT_LOG_FORMAT, + {"log-short-format", 0, "Don't log extra information to update and slow-query logs.", (uchar**) &opt_short_log_format, (uchar**) &opt_short_log_format, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"log-slave-updates", OPT_LOG_SLAVE_UPDATES, - "Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.", - (uchar**) &opt_log_slave_updates, (uchar**) &opt_log_slave_updates, 0, GET_BOOL, - NO_ARG, 0, 0, 0, 0, 0, 0}, - {"log-slow-admin-statements", OPT_LOG_SLOW_ADMIN_STATEMENTS, + {"log-slow-admin-statements", 0, "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.", (uchar**) &opt_log_slow_admin_statements, (uchar**) &opt_log_slow_admin_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"log-slow-slave-statements", OPT_LOG_SLOW_SLAVE_STATEMENTS, + {"log-slow-slave-statements", 0, "Log slow statements executed by slave thread to the slow log if it is open.", (uchar**) &opt_log_slow_slave_statements, (uchar**) &opt_log_slow_slave_statements, @@ -6109,19 +5599,15 @@ each time the SQL thread starts.", "mysql.slow_log or hostname-slow.log if --log-output=file is used. " "Must be enabled to activate other slow log options. " "Deprecated option, use --slow-query-log/--slow-query-log-file instead.", - (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG, + (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"slow-query-log-file", OPT_SLOW_QUERY_LOG_FILE, - "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.", - (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"log-tc", OPT_LOG_TC, + {"log-tc", 0, "Path to transaction coordinator log (used for transactions that affect " "more than one storage engine, when binary log is disabled)", (uchar**) &opt_tc_log_file, (uchar**) &opt_tc_log_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_MMAP - {"log-tc-size", OPT_LOG_TC_SIZE, "Size of transaction coordinator log.", + {"log-tc-size", 0, "Size of transaction coordinator log.", (uchar**) &opt_tc_log_size, (uchar**) &opt_tc_log_size, 0, GET_ULONG, REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ULONG_MAX, 0, TC_LOG_PAGE_SIZE, 0}, @@ -6131,199 +5617,37 @@ each time the SQL thread starts.", log and this option justs turns on --log-bin instead.", (uchar**) &opt_update_logname, (uchar**) &opt_update_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"log-warnings", 'W', "Log some not critical warnings to the log file.", - (uchar**) &global_system_variables.log_warnings, - (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0, - 0, 0, 0}, - {"low-priority-updates", OPT_LOW_PRIORITY_UPDATES, - "INSERT/DELETE/UPDATE has lower priority than selects.", - (uchar**) &global_system_variables.low_priority_updates, - (uchar**) &max_system_variables.low_priority_updates, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"master-info-file", OPT_MASTER_INFO_FILE, + {"master-info-file", 0, "The location and name of the file that remembers the master and where the I/O replication \ thread is in the master's binlogs.", (uchar**) &master_info_file, (uchar**) &master_info_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"master-retry-count", OPT_MASTER_RETRY_COUNT, + {"master-retry-count", 0, "The number of tries the slave will make to connect to the master before giving up.", (uchar**) &master_retry_count, (uchar**) &master_retry_count, 0, GET_ULONG, REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION - {"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS, + {"init-rpl-role", 0, "Set the replication role.", + (uchar**)&rpl_status, (uchar**)&rpl_status, &rpl_role_typelib, + GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"max-binlog-dump-events", 0, "Option used by mysql-test for debugging and testing of replication.", (uchar**) &max_binlog_dump_events, (uchar**) &max_binlog_dump_events, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ - {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (uchar**) &locked_in_memory, + {"memlock", 0, "Lock mysqld in memory.", (uchar**) &locked_in_memory, (uchar**) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"myisam-recover", OPT_MYISAM_RECOVER, - "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.", - (uchar**) &myisam_recover_options_str, (uchar**) &myisam_recover_options_str, 0, - GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE - {"ndb-connectstring", OPT_NDB_CONNECTSTRING, - "Connect string for ndbcluster.", - (uchar**) &opt_ndb_connectstring, - (uchar**) &opt_ndb_connectstring, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"ndb-mgmd-host", OPT_NDB_MGMD, - "Set host and port for ndb_mgmd. Syntax: hostname[:port]", - (uchar**) &opt_ndb_mgmd, - (uchar**) &opt_ndb_mgmd, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"ndb-nodeid", OPT_NDB_NODEID, - "Nodeid for this mysqlserver in the cluster.", - (uchar**) &opt_ndb_nodeid, - (uchar**) &opt_ndb_nodeid, - 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, - "Specify number of autoincrement values that are prefetched.", - (uchar**) &global_system_variables.ndb_autoincrement_prefetch_sz, - (uchar**) &max_system_variables.ndb_autoincrement_prefetch_sz, - 0, GET_ULONG, REQUIRED_ARG, 1, 1, 256, 0, 0, 0}, - {"ndb-force-send", OPT_NDB_FORCE_SEND, - "Force send of buffers to ndb immediately without waiting for " - "other threads.", - (uchar**) &global_system_variables.ndb_force_send, - (uchar**) &global_system_variables.ndb_force_send, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - {"ndb_force_send", OPT_NDB_FORCE_SEND, - "same as --ndb-force-send.", - (uchar**) &global_system_variables.ndb_force_send, - (uchar**) &global_system_variables.ndb_force_send, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - {"ndb-extra-logging", OPT_NDB_EXTRA_LOGGING, - "Turn on more logging in the error log.", - (uchar**) &ndb_extra_logging, - (uchar**) &ndb_extra_logging, - 0, GET_INT, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef HAVE_NDB_BINLOG - {"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP, - "Threshold on number of epochs to be behind before reporting binlog status. " - "E.g. 3 means that if the difference between what epoch has been received " - "from the storage nodes and what has been applied to the binlog is 3 or more, " - "a status message will be sent to the cluster log.", - (uchar**) &ndb_report_thresh_binlog_epoch_slip, - (uchar**) &ndb_report_thresh_binlog_epoch_slip, - 0, GET_ULONG, REQUIRED_ARG, 3, 0, 256, 0, 0, 0}, - {"ndb-report-thresh-binlog-mem-usage", OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE, - "Threshold on percentage of free memory before reporting binlog status. E.g. " - "10 means that if amount of available memory for receiving binlog data from " - "the storage nodes goes below 10%, " - "a status message will be sent to the cluster log.", - (uchar**) &ndb_report_thresh_binlog_mem_usage, - (uchar**) &ndb_report_thresh_binlog_mem_usage, - 0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0}, -#endif - {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT, - "Use exact records count during query planning and for fast " - "select count(*), disable for faster queries.", - (uchar**) &global_system_variables.ndb_use_exact_count, - (uchar**) &global_system_variables.ndb_use_exact_count, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT, - "same as --ndb-use-exact-count.", - (uchar**) &global_system_variables.ndb_use_exact_count, - (uchar**) &global_system_variables.ndb_use_exact_count, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - {"ndb-use-transactions", OPT_NDB_USE_TRANSACTIONS, - "Use transactions for large inserts, if enabled then large " - "inserts will be split into several smaller transactions", - (uchar**) &global_system_variables.ndb_use_transactions, - (uchar**) &global_system_variables.ndb_use_transactions, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - {"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS, - "same as --ndb-use-transactions.", - (uchar**) &global_system_variables.ndb_use_transactions, - (uchar**) &global_system_variables.ndb_use_transactions, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - {"ndb-shm", OPT_NDB_SHM, - "Use shared memory connections when available.", - (uchar**) &opt_ndb_shm, - (uchar**) &opt_ndb_shm, - 0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0}, - {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION, - "Select nodes for transactions in a more optimal way.", - (uchar**) &opt_ndb_optimized_node_selection, - (uchar**) &opt_ndb_optimized_node_selection, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - { "ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME, - "A dedicated thread is created to, at the given millisecons interval, invalidate the query cache if another MySQL server in the cluster has changed the data in the database.", - (uchar**) &opt_ndb_cache_check_time, (uchar**) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG, - 0, 0, LONG_TIMEOUT, 0, 1, 0}, - {"ndb-index-stat-enable", OPT_NDB_INDEX_STAT_ENABLE, - "Use ndb index statistics in query optimization.", - (uchar**) &global_system_variables.ndb_index_stat_enable, - (uchar**) &max_system_variables.ndb_index_stat_enable, - 0, GET_BOOL, OPT_ARG, 0, 0, 1, 0, 0, 0}, -#endif - {"ndb-use-copying-alter-table", - OPT_NDB_USE_COPYING_ALTER_TABLE, - "Force ndbcluster to always copy tables at alter table (should only be used if on-line alter table fails).", - (uchar**) &global_system_variables.ndb_use_copying_alter_table, - (uchar**) &global_system_variables.ndb_use_copying_alter_table, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"new", 'n', "Use very new possible 'unsafe' functions.", - (uchar**) &global_system_variables.new_mode, - (uchar**) &max_system_variables.new_mode, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef NOT_YET - {"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands with uses two different table types.", - (uchar**) &opt_no_mix_types, (uchar**) &opt_no_mix_types, 0, GET_BOOL, NO_ARG, - 0, 0, 0, 0, 0, 0}, -#endif - {"old-alter-table", OPT_OLD_ALTER_TABLE, - "Use old, non-optimized alter table.", - (uchar**) &global_system_variables.old_alter_table, - (uchar**) &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG, - 0, 0, 0, 0, 0, 0}, - {"old-passwords", OPT_OLD_PASSWORDS, "Use old password encryption method (needed for 4.0 and older clients).", - (uchar**) &global_system_variables.old_passwords, - (uchar**) &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG, - 0, 0, 0, 0, 0, 0}, {"one-thread", OPT_ONE_THREAD, "(deprecated): Only use one thread (for debugging under Linux). Use thread-handling=no-threads instead", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"old-style-user-limits", OPT_OLD_STYLE_USER_LIMITS, + {"old-style-user-limits", 0, "Enable old-style user limits (before 5.0.3 user resources were counted per each user+host vs. per account)", (uchar**) &opt_old_style_user_limits, (uchar**) &opt_old_style_user_limits, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.", - (uchar**) &pidfile_name_ptr, (uchar**) &pidfile_name_ptr, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection or 0 for default to, in " - "order of preference, my.cnf, $MYSQL_TCP_PORT, " -#if MYSQL_PORT_DEFAULT == 0 - "/etc/services, " -#endif - "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &mysqld_port, - (uchar**) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"port-open-timeout", OPT_PORT_OPEN_TIMEOUT, + {"port-open-timeout", 0, "Maximum time in seconds to wait for the port to become free. " "(Default: no wait)", (uchar**) &mysqld_port_timeout, (uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#if defined(ENABLED_PROFILING) - {"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory", - (uchar**) &global_system_variables.profiling_history_size, - (uchar**) &max_system_variables.profiling_history_size, - 0, GET_ULONG, REQUIRED_ARG, 15, 0, 100, 0, 0, 0}, -#endif - {"relay-log", OPT_RELAY_LOG, - "The location and name to use for relay logs.", - (uchar**) &opt_relay_logname, (uchar**) &opt_relay_logname, 0, - GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"relay-log-index", OPT_RELAY_LOG_INDEX, - "The location and name to use for the file that keeps a list of the last \ -relay logs.", - (uchar**) &opt_relaylog_index_name, (uchar**) &opt_relaylog_index_name, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE, - "The location and name of the file that remembers where the SQL replication \ -thread is in the relay logs.", - (uchar**) &relay_log_info_file, (uchar**) &relay_log_info_file, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replicate-do-db", OPT_REPLICATE_DO_DB, "Tells the slave thread to restrict replication to the specified database. To specify more than one database, use the directive multiple times, once for each database. Note that this will only work if you do not use cross-database queries such as UPDATE some_db.some_table SET foo='bar' while having selected a different or no database. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -6340,7 +5664,7 @@ thread is in the relay logs.", "Updates to a database with a different name than the original. Example: replicate-rewrite-db=master_db_name->slave_db_name.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION - {"replicate-same-server-id", OPT_REPLICATE_SAME_SERVER_ID, + {"replicate-same-server-id", 0, "In replication, if set to 1, do not skip events having our server id. \ Default value is 0 (to break infinite loops in circular replication). \ Can't be set to 1 if --log-slave-updates is used.", @@ -6354,67 +5678,34 @@ Can't be set to 1 if --log-slave-updates is used.", {"replicate-wild-ignore-table", OPT_REPLICATE_WILD_IGNORE_TABLE, "Tells the slave thread to not replicate to the tables that match the given wildcard pattern. To specify more than one table to ignore, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-ignore-table=foo%.bar% will not do updates to tables in databases that start with foo and whose table names start with bar.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - // In replication, we may need to tell the other servers how to connect - {"report-host", OPT_REPORT_HOST, - "Hostname or IP of the slave to be reported to to the master during slave registration. Will appear in the output of SHOW SLAVE HOSTS. Leave unset if you do not want the slave to register itself with the master. Note that it is not sufficient for the master to simply read the IP of the slave off the socket once the slave connects. Due to NAT and other routing issues, that IP may not be valid for connecting to the slave from the master or other hosts.", - (uchar**) &report_host, (uchar**) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0, - 0, 0, 0, 0}, - {"report-password", OPT_REPORT_PASSWORD, "Undocumented.", - (uchar**) &report_password, (uchar**) &report_password, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"report-port", OPT_REPORT_PORT, - "Port for connecting to slave reported to the master during slave registration. Set it only if the slave is listening on a non-default port or if you have a special tunnel from the master or other clients to the slave. If not sure, leave this option unset.", - (uchar**) &report_port, (uchar**) &report_port, 0, GET_UINT, REQUIRED_ARG, - MYSQL_PORT, 0, 0, 0, 0, 0}, - {"report-user", OPT_REPORT_USER, "Undocumented.", (uchar**) &report_user, - (uchar**) &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented.", - (uchar**) &rpl_recovery_rank, (uchar**) &rpl_recovery_rank, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef TO_BE_DELETED - {"safe-show-database", OPT_SAFE_SHOW_DB, + {"safe-show-database", 0, "Deprecated option; use GRANT SHOW DATABASES instead...", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"safe-user-create", OPT_SAFE_USER_CREATE, + {"safe-user-create", 0, "Don't allow new user creation by the user who has no write privileges to the mysql.user table.", (uchar**) &opt_safe_user_create, (uchar**) &opt_safe_user_create, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT, - "Simulate memory shortage when compiled with the --with-debug=full option.", - 0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"secure-auth", OPT_SECURE_AUTH, "Disallow authentication for accounts that have old (pre-4.1) passwords.", - (uchar**) &opt_secure_auth, (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, - my_bool(0), 0, 0, 0, 0, 0}, - {"secure-file-priv", OPT_SECURE_FILE_PRIV, - "Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory", - (uchar**) &opt_secure_file_priv, (uchar**) &opt_secure_file_priv, 0, - GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"server-id", OPT_SERVER_ID, - "Uniquely identifies the server instance in the community of replication partners.", - (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, UINT_MAX32, - 0, 0, 0}, +#if !defined(DBUG_OFF) && defined(SAFEMALLOC) + {"safemalloc", 0, "Enable the memory allocation checking.", + (uchar**) &sf_malloc_quick, (uchar**) &sf_malloc_quick, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"safemalloc-mem-limit", 0, "Simulate memory shortage.", + (uchar**)&sf_malloc_mem_limit, (uchar**)&sf_malloc_mem_limit, 0, GET_UINT, + REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"set-variable", 'O', "Change the value of a variable. Please note that this option is deprecated;you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef HAVE_SMEM - {"shared-memory", OPT_ENABLE_SHARED_MEMORY, - "Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -#endif -#ifdef HAVE_SMEM - {"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#endif - {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO, + {"show-slave-auth-info", 0, "Show user and password in SHOW SLAVE HOSTS on this master", (uchar**) &opt_show_slave_auth_info, (uchar**) &opt_show_slave_auth_info, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DISABLE_GRANT_OPTIONS - {"skip-grant-tables", OPT_SKIP_GRANT, + {"skip-grant-tables", 0, "Start without grant tables. This gives all users FULL ACCESS to all tables!", (uchar**) &opt_noacl, (uchar**) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -6427,22 +5718,9 @@ Can't be set to 1 if --log-slave-updates is used.", {"skip-name-resolve", OPT_SKIP_RESOLVE, "Don't resolve hostnames. All hostnames are IP's or 'localhost'.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip-networking", OPT_SKIP_NETWORKING, - "Don't allow connection with TCP/IP.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, - 0, 0, 0}, {"skip-new", OPT_SKIP_NEW, "Don't use new, possible wrong routines.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, -#ifndef DBUG_OFF -#ifdef SAFEMALLOC - {"skip-safemalloc", OPT_SKIP_SAFEMALLOC, - "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG, - 0, 0, 0, 0, 0, 0}, -#endif -#endif - {"skip-show-database", OPT_SKIP_SHOW_DB, - "Don't allow 'SHOW DATABASE' commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, - 0, 0, 0, 0}, - {"skip-slave-start", OPT_SKIP_SLAVE_START, + {"skip-slave-start", 0, "If set, slave is not autostarted.", (uchar**) &opt_skip_slave_start, (uchar**) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-stack-trace", OPT_SKIP_STACK_TRACE, @@ -6455,44 +5733,22 @@ Can't be set to 1 if --log-slave-updates is used.", "because it has no effect; the implied behavior is already the default.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION - {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR, - "The location where the slave should put its temporary files when \ -replicating a LOAD DATA INFILE command.", - (uchar**) &slave_load_tmpdir, (uchar**) &slave_load_tmpdir, 0, GET_STR_ALLOC, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS, - "Tells the slave thread to continue replication when a query event returns an error from the provided list.", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"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}, -#endif - {"slow-query-log", OPT_SLOW_LOG, - "Enable|disable slow query log", (uchar**) &opt_slow_log, - (uchar**) &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"socket", OPT_SOCKET, "Socket file to use for connection.", - (uchar**) &mysqld_unix_port, (uchar**) &mysqld_unix_port, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef HAVE_REPLICATION - {"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL, + {"sporadic-binlog-dump-fail", 0, "Option used by mysql-test for debugging and testing of replication.", (uchar**) &opt_sporadic_binlog_dump_fail, (uchar**) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ - {"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME, - "The update log is deprecated since version 5.0, is replaced by the binary \ -log and this option does nothing anymore.", + {"sql-bin-update-same", 0, + "The update log is deprecated since version 5.0, is replaced by the " + "binary log and this option does nothing anymore.", 0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"sql-mode", OPT_SQL_MODE, - "Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.", - (uchar**) &sql_mode_str, (uchar**) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0, - 0, 0, 0, 0, 0}, -#ifdef HAVE_OPENSSL -#include "sslopt-longopts.h" -#endif + {"ssl", 0, + "Enable SSL for connection (automatically enabled with other flags).", + (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, + 0, 0, 0}, #ifdef __WIN__ - {"standalone", OPT_STANDALONE, + {"standalone", 0, "Dummy option to start as a standalone program (NT).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif @@ -6504,14 +5760,14 @@ log and this option does nothing anymore.", option if compiled with valgrind support. */ IF_PURIFY(0,1), 0, 0, 0, 0, 0}, - {"sysdate-is-now", OPT_SYSDATE_IS_NOW, + {"sysdate-is-now", 0, "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement.", (uchar**) &global_system_variables.sysdate_is_now, 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, - {"tc-heuristic-recover", OPT_TC_HEURISTIC_RECOVER, + {"tc-heuristic-recover", 0, "Decision to use in heuristic recover process. Possible values are COMMIT or ROLLBACK.", - (uchar**) &opt_tc_heuristic_recover, (uchar**) &opt_tc_heuristic_recover, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + (uchar**) &tc_heuristic_recover, (uchar**) &tc_heuristic_recover, + &tc_heuristic_recover_typelib, GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #if defined(ENABLED_DEBUG_SYNC) {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT, "Enable the debug sync facility " @@ -6520,7 +5776,7 @@ log and this option does nothing anymore.", (uchar**) &opt_debug_sync_timeout, 0, 0, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, 0, 0, 0}, #endif /* defined(ENABLED_DEBUG_SYNC) */ - {"temp-pool", OPT_TEMP_POOL, + {"temp-pool", 0, #if (ENABLE_TEMP_POOL) "Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.", #else @@ -6528,24 +5784,11 @@ log and this option does nothing anymore.", #endif (uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - - {"timed_mutexes", OPT_TIMED_MUTEXES, - "Specify whether to time mutexes (only InnoDB mutexes are currently supported)", - (uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0, - 0, 0, 0, 0, 0}, - {"tmpdir", 't', - "Path for temporary files. Several paths may be specified, separated by a " -#if defined(__WIN__) || defined(__NETWARE__) - "semicolon (;)" -#else - "colon (:)" -#endif - ", in this case they are used in a round-robin fashion.", - (uchar**) &opt_mysql_tmpdir, - (uchar**) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"transaction-isolation", OPT_TX_ISOLATION, - "Default transaction isolation level.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, - 0, 0, 0, 0, 0}, + {"transaction-isolation", 0, + "Default transaction isolation level.", + (uchar**)&global_system_variables.tx_isolation, + (uchar**)&global_system_variables.tx_isolation, &tx_isolation_typelib, + GET_ENUM, REQUIRED_ARG, ISO_REPEATABLE_READ, 0, 0, 0, 0, 0}, {"use-symbolic-links", 's', "Enable symbolic link support. Deprecated option; use --symbolic-links instead.", (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG, IF_PURIFY(0,1), 0, 0, 0, 0, 0}, @@ -6560,556 +5803,19 @@ log and this option does nothing anymore.", (uchar**) &global_system_variables.log_warnings, (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, ULONG_MAX, 0, 0, 0}, - { "back_log", OPT_BACK_LOG, - "The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.", - (uchar**) &back_log, (uchar**) &back_log, 0, GET_ULONG, - REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 }, - {"binlog_cache_size", OPT_BINLOG_CACHE_SIZE, - "The size of the cache to hold the SQL statements for the binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance.", - (uchar**) &binlog_cache_size, (uchar**) &binlog_cache_size, 0, GET_ULONG, - REQUIRED_ARG, 32*1024L, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0}, - {"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE, - "Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!", - (uchar**) &global_system_variables.bulk_insert_buff_size, - (uchar**) &max_system_variables.bulk_insert_buff_size, - 0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ULONG_MAX, 0, 1, 0}, - {"connect_timeout", OPT_CONNECT_TIMEOUT, - "The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.", - (uchar**) &connect_timeout, (uchar**) &connect_timeout, - 0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 }, - { "date_format", OPT_DATE_FORMAT, - "The DATE format (For future).", - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - { "datetime_format", OPT_DATETIME_FORMAT, - "The DATETIME/TIMESTAMP format (for future).", - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - { "default_week_format", OPT_DEFAULT_WEEK_FORMAT, - "The default week format used by WEEK() functions.", - (uchar**) &global_system_variables.default_week_format, - (uchar**) &max_system_variables.default_week_format, - 0, GET_ULONG, REQUIRED_ARG, 0, 0, 7L, 0, 1, 0}, - {"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT, - "After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.", - (uchar**) &delayed_insert_limit, (uchar**) &delayed_insert_limit, 0, GET_ULONG, - REQUIRED_ARG, DELAYED_LIMIT, 1, ULONG_MAX, 0, 1, 0}, - {"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT, - "How long a INSERT DELAYED thread should wait for INSERT statements before terminating.", - (uchar**) &delayed_insert_timeout, (uchar**) &delayed_insert_timeout, 0, - GET_ULONG, REQUIRED_ARG, DELAYED_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, - { "delayed_queue_size", OPT_DELAYED_QUEUE_SIZE, - "What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again.", - (uchar**) &delayed_queue_size, (uchar**) &delayed_queue_size, 0, GET_ULONG, - REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ULONG_MAX, 0, 1, 0}, - {"div_precision_increment", OPT_DIV_PRECINCREMENT, - "Precision of the result of '/' operator will be increased on that value.", - (uchar**) &global_system_variables.div_precincrement, - (uchar**) &max_system_variables.div_precincrement, 0, GET_ULONG, - REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0}, - {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS, - "If non-zero, binary logs will be purged after expire_logs_days " - "days; possible purges happen at startup and at binary log rotation.", - (uchar**) &expire_logs_days, - (uchar**) &expire_logs_days, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, 99, 0, 1, 0}, - { "flush_time", OPT_FLUSH_TIME, - "A dedicated thread is created to flush all tables at the given interval.", - (uchar**) &flush_time, (uchar**) &flush_time, 0, GET_ULONG, REQUIRED_ARG, - FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0}, - { "ft_boolean_syntax", OPT_FT_BOOLEAN_SYNTAX, - "List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE)", - 0, 0, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, - "The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", - (uchar**) &ft_max_word_len, (uchar**) &ft_max_word_len, 0, GET_ULONG, - REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0}, - { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, - "The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", - (uchar**) &ft_min_word_len, (uchar**) &ft_min_word_len, 0, GET_ULONG, - REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0}, - { "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT, - "Number of best matches to use for query expansion", - (uchar**) &ft_query_expansion_limit, (uchar**) &ft_query_expansion_limit, 0, GET_ULONG, - REQUIRED_ARG, 20, 0, 1000, 0, 1, 0}, - { "ft_stopword_file", OPT_FT_STOPWORD_FILE, - "Use stopwords from this file instead of built-in list.", - (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - { "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN, - "The maximum length of the result of function group_concat.", - (uchar**) &global_system_variables.group_concat_max_len, - (uchar**) &max_system_variables.group_concat_max_len, 0, GET_ULONG, - REQUIRED_ARG, 1024, 4, ULONG_MAX, 0, 1, 0}, - {"interactive_timeout", OPT_INTERACTIVE_TIMEOUT, - "The number of seconds the server waits for activity on an interactive connection before closing it.", - (uchar**) &global_system_variables.net_interactive_timeout, - (uchar**) &max_system_variables.net_interactive_timeout, 0, - GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, - {"join_buffer_size", OPT_JOIN_BUFF_SIZE, - "The size of the buffer that is used for full joins.", - (uchar**) &global_system_variables.join_buff_size, - (uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG, - REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ULONG_MAX, - MALLOC_OVERHEAD, IO_SIZE, 0}, - {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE, - "Don't overwrite stale .MYD and .MYI even if no directory is specified.", - (uchar**) &global_system_variables.keep_files_on_create, - (uchar**) &max_system_variables.keep_files_on_create, - 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"key_buffer_size", OPT_KEY_BUFFER_SIZE, - "The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.", - (uchar**) &dflt_key_cache_var.param_buff_size, - (uchar**) 0, - 0, (GET_ULL | GET_ASK_ADDR), - REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD, - IO_SIZE, 0}, - {"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD, - "This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache", - (uchar**) &dflt_key_cache_var.param_age_threshold, - (uchar**) 0, - 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, - 300, 100, ULONG_MAX, 0, 100, 0}, - {"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, - "The default size of key cache blocks", - (uchar**) &dflt_key_cache_var.param_block_size, - (uchar**) 0, - 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, - KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0}, - {"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT, - "The minimum percentage of warm blocks in key cache", - (uchar**) &dflt_key_cache_var.param_division_limit, - (uchar**) 0, - 0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100, - 1, 100, 0, 1, 0}, - {"long_query_time", OPT_LONG_QUERY_TIME, - "Log all queries that have taken more than long_query_time seconds to execute to file. " - "The argument will be treated as a decimal value with microsecond precission.", - (uchar**) &long_query_time, (uchar**) &long_query_time, 0, GET_DOUBLE, - REQUIRED_ARG, 10, 0, LONG_TIMEOUT, 0, 0, 0}, - {"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES, - "If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive. Should be set to 2 if you are using a case insensitive file system", - (uchar**) &lower_case_table_names, - (uchar**) &lower_case_table_names, 0, GET_UINT, OPT_ARG, -#ifdef FN_NO_CASE_SENCE - 1 -#else - 0 -#endif - , 0, 2, 0, 1, 0}, - {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, - "Max packetlength to send/receive from to server.", - (uchar**) &global_system_variables.max_allowed_packet, - (uchar**) &max_system_variables.max_allowed_packet, 0, GET_ULONG, - REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, - {"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE, - "Can be used to restrict the total size used to cache a multi-transaction query.", - (uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0, - GET_ULL, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULONGLONG_MAX, 0, IO_SIZE, 0}, - {"max_binlog_size", OPT_MAX_BINLOG_SIZE, - "Binary log will be rotated automatically when the size exceeds this \ -value. Will also apply to relay logs if max_relay_log_size is 0. \ -The minimum value for this variable is 4096.", - (uchar**) &max_binlog_size, (uchar**) &max_binlog_size, 0, GET_ULONG, - REQUIRED_ARG, 1024*1024L*1024L, IO_SIZE, 1024*1024L*1024L, 0, IO_SIZE, 0}, - {"max_connect_errors", OPT_MAX_CONNECT_ERRORS, - "If there is more than this number of interrupted connections from a host this host will be blocked from further connections.", - (uchar**) &max_connect_errors, (uchar**) &max_connect_errors, 0, GET_ULONG, - REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0}, - // Default max_connections of 151 is larger than Apache's default max - // children, to avoid "too many connections" error in a common setup - {"max_connections", OPT_MAX_CONNECTIONS, - "The number of simultaneous clients allowed.", (uchar**) &max_connections, - (uchar**) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1, - 0}, - {"max_delayed_threads", OPT_MAX_DELAYED_THREADS, - "Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.", - (uchar**) &global_system_variables.max_insert_delayed_threads, - (uchar**) &max_system_variables.max_insert_delayed_threads, - 0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0}, - {"max_error_count", OPT_MAX_ERROR_COUNT, - "Max number of errors/warnings to store for a statement.", - (uchar**) &global_system_variables.max_error_count, - (uchar**) &max_system_variables.max_error_count, - 0, GET_ULONG, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 0, 65535, 0, 1, 0}, - {"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE, - "Don't allow creation of heap tables bigger than this.", - (uchar**) &global_system_variables.max_heap_table_size, - (uchar**) &max_system_variables.max_heap_table_size, 0, GET_ULL, - REQUIRED_ARG, 16*1024*1024L, 16384, MAX_MEM_TABLE_SIZE, - MALLOC_OVERHEAD, 1024, 0}, - {"max_join_size", OPT_MAX_JOIN_SIZE, - "Joins that are probably going to read more than max_join_size records return an error.", - (uchar**) &global_system_variables.max_join_size, - (uchar**) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG, - HA_POS_ERROR, 1, HA_POS_ERROR, 0, 1, 0}, - {"max_length_for_sort_data", OPT_MAX_LENGTH_FOR_SORT_DATA, - "Max number of bytes in sorted records.", - (uchar**) &global_system_variables.max_length_for_sort_data, - (uchar**) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG, - REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, - {"max_prepared_stmt_count", OPT_MAX_PREPARED_STMT_COUNT, - "Maximum number of prepared statements in the server.", - (uchar**) &max_prepared_stmt_count, (uchar**) &max_prepared_stmt_count, - 0, GET_ULONG, REQUIRED_ARG, 16382, 0, 1*1024*1024, 0, 1, 0}, - {"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE, - "If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 excepted, the minimum value for this variable is 4096.", - (uchar**) &max_relay_log_size, (uchar**) &max_relay_log_size, 0, GET_ULONG, - REQUIRED_ARG, 0L, 0L, 1024*1024L*1024L, 0, IO_SIZE, 0}, - { "max_seeks_for_key", OPT_MAX_SEEKS_FOR_KEY, - "Limit assumed max number of seeks when looking up rows based on a key", - (uchar**) &global_system_variables.max_seeks_for_key, - (uchar**) &max_system_variables.max_seeks_for_key, 0, GET_ULONG, - REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0 }, - {"max_sort_length", OPT_MAX_SORT_LENGTH, - "The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).", - (uchar**) &global_system_variables.max_sort_length, - (uchar**) &max_system_variables.max_sort_length, 0, GET_ULONG, - REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, - {"max_sp_recursion_depth", OPT_MAX_SP_RECURSION_DEPTH, - "Maximum stored procedure recursion depth. (discussed with docs).", - (uchar**) &global_system_variables.max_sp_recursion_depth, - (uchar**) &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG, - OPT_ARG, 0, 0, 255, 0, 1, 0 }, - {"max_tmp_tables", OPT_MAX_TMP_TABLES, - "Maximum number of temporary tables a client can keep open at a time.", - (uchar**) &global_system_variables.max_tmp_tables, - (uchar**) &max_system_variables.max_tmp_tables, 0, GET_ULONG, - REQUIRED_ARG, 32, 1, ULONG_MAX, 0, 1, 0}, - {"max_user_connections", OPT_MAX_USER_CONNECTIONS, - "The maximum number of active connections for a single user (0 = no limit).", - (uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT, - REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0}, - {"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT, - "After this many write locks, allow some read locks to run in between.", - (uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG, - REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0}, - {"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT, - "Don't write queries to slow log that examine fewer than min_examined_row_limit rows.", - (uchar**) &global_system_variables.min_examined_row_limit, - (uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0}, - {"multi_range_count", OPT_MULTI_RANGE_COUNT, - "Number of key ranges to request at once.", - (uchar**) &global_system_variables.multi_range_count, - (uchar**) &max_system_variables.multi_range_count, 0, - GET_ULONG, REQUIRED_ARG, 256, 1, ULONG_MAX, 0, 1, 0}, - {"myisam_block_size", OPT_MYISAM_BLOCK_SIZE, - "Block size to be used for MyISAM index pages.", - (uchar**) &opt_myisam_block_size, - (uchar**) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG, - MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH, - 0, MI_MIN_KEY_BLOCK_LENGTH, 0}, - {"myisam_data_pointer_size", OPT_MYISAM_DATA_POINTER_SIZE, - "Default pointer size to be used for MyISAM tables.", - (uchar**) &myisam_data_pointer_size, - (uchar**) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG, - 6, 2, 7, 0, 1, 0}, - {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, - "Deprecated option", - (uchar**) &global_system_variables.myisam_max_extra_sort_file_size, - (uchar**) &max_system_variables.myisam_max_extra_sort_file_size, - 0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH, - 0, (ulonglong) MAX_FILE_SIZE, 0, 1, 0}, - {"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE, - "Don't use the fast sort index method to created index if the temporary file would get bigger than this.", - (uchar**) &global_system_variables.myisam_max_sort_file_size, - (uchar**) &max_system_variables.myisam_max_sort_file_size, 0, - GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE, - 0, 1024*1024, 0}, - {"myisam_mmap_size", OPT_MYISAM_MMAP_SIZE, - "Can be used to restrict the total memory used for memory mmaping of myisam files", - (uchar**) &myisam_mmap_size, (uchar**) &myisam_mmap_size, 0, - GET_ULL, REQUIRED_ARG, SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 0, 1, 0}, - {"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS, - "Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.", - (uchar**) &global_system_variables.myisam_repair_threads, - (uchar**) &max_system_variables.myisam_repair_threads, 0, - GET_ULONG, REQUIRED_ARG, 1, 1, ULONG_MAX, 0, 1, 0}, - {"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE, - "The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.", - (uchar**) &global_system_variables.myisam_sort_buff_size, - (uchar**) &max_system_variables.myisam_sort_buff_size, 0, - GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0}, - {"myisam_use_mmap", OPT_MYISAM_USE_MMAP, - "Use memory mapping for reading and writing MyISAM tables", - (uchar**) &opt_myisam_use_mmap, - (uchar**) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0, - 0, 0, 0, 0, 0}, - {"myisam_stats_method", OPT_MYISAM_STATS_METHOD, - "Specifies how MyISAM index statistics collection code should threat NULLs. " - "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), " - "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".", - (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"net_buffer_length", OPT_NET_BUFFER_LENGTH, - "Buffer length for TCP/IP and socket communication.", - (uchar**) &global_system_variables.net_buffer_length, - (uchar**) &max_system_variables.net_buffer_length, 0, GET_ULONG, - REQUIRED_ARG, 16384, 1024, 1024*1024L, 0, 1024, 0}, - {"net_read_timeout", OPT_NET_READ_TIMEOUT, - "Number of seconds to wait for more data from a connection before aborting the read.", - (uchar**) &global_system_variables.net_read_timeout, - (uchar**) &max_system_variables.net_read_timeout, 0, GET_ULONG, - REQUIRED_ARG, NET_READ_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, - {"net_retry_count", OPT_NET_RETRY_COUNT, - "If a read on a communication port is interrupted, retry this many times before giving up.", - (uchar**) &global_system_variables.net_retry_count, - (uchar**) &max_system_variables.net_retry_count,0, - GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ULONG_MAX, 0, 1, 0}, - {"net_write_timeout", OPT_NET_WRITE_TIMEOUT, - "Number of seconds to wait for a block to be written to a connection before aborting the write.", - (uchar**) &global_system_variables.net_write_timeout, - (uchar**) &max_system_variables.net_write_timeout, 0, GET_ULONG, - REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, - { "old", OPT_OLD_MODE, "Use compatible behavior.", - (uchar**) &global_system_variables.old_mode, - (uchar**) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, - 0, 0, 0, 0, 0, 0}, - {"open_files_limit", OPT_OPEN_FILES_LIMIT, - "If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.", - (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0}, - {"optimizer_prune_level", OPT_OPTIMIZER_PRUNE_LEVEL, - "Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows.", - (uchar**) &global_system_variables.optimizer_prune_level, - (uchar**) &max_system_variables.optimizer_prune_level, - 0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0}, - {"optimizer_search_depth", OPT_OPTIMIZER_SEARCH_DEPTH, - "Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Smaller values than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to MAX_TABLES+2, the optimizer will switch to the original find_best (used for testing/comparison).", - (uchar**) &global_system_variables.optimizer_search_depth, - (uchar**) &max_system_variables.optimizer_search_depth, - 0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0}, - {"optimizer_switch", OPT_OPTIMIZER_SWITCH, - "optimizer_switch=option=val[,option=val...], where option={index_merge, " - "index_merge_union, index_merge_sort_union, index_merge_intersection} and " - "val={on, off, default}.", - (uchar**) &optimizer_switch_str, (uchar**) &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG, - /*OPTIMIZER_SWITCH_DEFAULT*/0, - 0, 0, 0, 0, 0}, - {"plugin_dir", OPT_PLUGIN_DIR, - "Directory for plugins.", - (uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"plugin-load", OPT_PLUGIN_LOAD, + {"plugin-load", 0, "Optional semicolon-separated list of plugins to load, where each plugin is " "identified as name=library, where name is the plugin name and library " "is the plugin library in plugin_dir.", (uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE, - "The size of the buffer that is allocated when preloading indexes", - (uchar**) &global_system_variables.preload_buff_size, - (uchar**) &max_system_variables.preload_buff_size, 0, GET_ULONG, - REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0}, - {"query_alloc_block_size", OPT_QUERY_ALLOC_BLOCK_SIZE, - "Allocation block size for query parsing and execution", - (uchar**) &global_system_variables.query_alloc_block_size, - (uchar**) &max_system_variables.query_alloc_block_size, 0, GET_ULONG, - REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, -#ifdef HAVE_QUERY_CACHE - {"query_cache_limit", OPT_QUERY_CACHE_LIMIT, - "Don't cache results that are bigger than this.", - (uchar**) &query_cache_limit, (uchar**) &query_cache_limit, 0, GET_ULONG, - REQUIRED_ARG, 1024*1024L, 0, ULONG_MAX, 0, 1, 0}, - {"query_cache_min_res_unit", OPT_QUERY_CACHE_MIN_RES_UNIT, - "minimal size of unit in wich space for results is allocated (last unit will be trimed after writing all result data.", - (uchar**) &query_cache_min_res_unit, (uchar**) &query_cache_min_res_unit, - 0, GET_ULONG, REQUIRED_ARG, QUERY_CACHE_MIN_RESULT_DATA_SIZE, - 0, ULONG_MAX, 0, 1, 0}, -#endif /*HAVE_QUERY_CACHE*/ - {"query_cache_size", OPT_QUERY_CACHE_SIZE, - "The memory allocated to store results from old queries.", - (uchar**) &query_cache_size, (uchar**) &query_cache_size, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1024, 0}, -#ifdef HAVE_QUERY_CACHE - {"query_cache_type", OPT_QUERY_CACHE_TYPE, - "0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT SQL_CACHE ... queries.", - (uchar**) &global_system_variables.query_cache_type, - (uchar**) &max_system_variables.query_cache_type, - 0, GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0}, - {"query_cache_wlock_invalidate", OPT_QUERY_CACHE_WLOCK_INVALIDATE, - "Invalidate queries in query cache on LOCK for write", - (uchar**) &global_system_variables.query_cache_wlock_invalidate, - (uchar**) &max_system_variables.query_cache_wlock_invalidate, - 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, -#endif /*HAVE_QUERY_CACHE*/ - {"query_prealloc_size", OPT_QUERY_PREALLOC_SIZE, - "Persistent buffer for query parsing and execution", - (uchar**) &global_system_variables.query_prealloc_size, - (uchar**) &max_system_variables.query_prealloc_size, 0, GET_ULONG, - REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE, - ULONG_MAX, 0, 1024, 0}, - {"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE, - "Allocation block size for storing ranges during optimization", - (uchar**) &global_system_variables.range_alloc_block_size, - (uchar**) &max_system_variables.range_alloc_block_size, 0, GET_ULONG, - REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX, - 0, 1024, 0}, - {"read_buffer_size", OPT_RECORD_BUFFER, - "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.", + {"record_buffer", 0, "Deprecated; use --read-buffer-size instead.", (uchar**) &global_system_variables.read_buff_size, (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, - 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, - 0}, - {"read_only", OPT_READONLY, - "Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege", - (uchar**) &opt_readonly, - (uchar**) &opt_readonly, - 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, - {"read_rnd_buffer_size", OPT_RECORD_RND_BUFFER, - "When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks. If not set, then it's set to the value of record_buffer.", - (uchar**) &global_system_variables.read_rnd_buff_size, - (uchar**) &max_system_variables.read_rnd_buff_size, 0, - GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD, - INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, - {"record_buffer", OPT_RECORD_BUFFER, - "Alias for read_buffer_size", - (uchar**) &global_system_variables.read_buff_size, - (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, - 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, -#ifdef HAVE_REPLICATION - {"relay_log_purge", OPT_RELAY_LOG_PURGE, - "0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.", - (uchar**) &relay_log_purge, - (uchar**) &relay_log_purge, 0, GET_BOOL, NO_ARG, - 1, 0, 1, 0, 1, 0}, - {"relay_log_recovery", OPT_RELAY_LOG_RECOVERY, - "Enables automatic relay log recovery right after the database startup, " - "which means that the IO Thread starts re-fetching from the master " - "right after the last transaction processed.", - (uchar**) &relay_log_recovery, - (uchar**) &relay_log_recovery, 0, GET_BOOL, NO_ARG, - 0, 0, 1, 0, 1, 0}, - {"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT, - "Maximum space to use for all relay logs.", - (uchar**) &relay_log_space_limit, - (uchar**) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L, - (longlong) ULONG_MAX, 0, 1, 0}, - {"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL, - "Use compression on master/slave protocol.", - (uchar**) &opt_slave_compressed_protocol, - (uchar**) &opt_slave_compressed_protocol, - 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, - {"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT, - "Number of seconds to wait for more data from a master/slave connection before aborting the read.", - (uchar**) &slave_net_timeout, (uchar**) &slave_net_timeout, 0, - GET_ULONG, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, - {"slave_transaction_retries", OPT_SLAVE_TRANS_RETRIES, - "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.", - (uchar**) &slave_trans_retries, (uchar**) &slave_trans_retries, 0, - GET_ULONG, REQUIRED_ARG, 10L, 0L, (longlong) ULONG_MAX, 0, 1, 0}, -#endif /* HAVE_REPLICATION */ - {"slow_launch_time", OPT_SLOW_LAUNCH_TIME, - "If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented.", - (uchar**) &slow_launch_time, (uchar**) &slow_launch_time, 0, GET_ULONG, - REQUIRED_ARG, 2L, 0L, LONG_TIMEOUT, 0, 1, 0}, - {"sort_buffer_size", OPT_SORT_BUFFER, - "Each thread that needs to do a sort allocates a buffer of this size.", - (uchar**) &global_system_variables.sortbuff_size, - (uchar**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG, - MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD, - 1, 0}, - {"sync-binlog", OPT_SYNC_BINLOG, - "Synchronously flush binary log to disk after every #th event. " - "Use 0 (default) to disable synchronous flushing.", - (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_UINT, - REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, - {"sync-relay-log", OPT_SYNC_RELAY_LOG, - "Synchronously flush relay log to disk after every #th event. " - "Use 0 (default) to disable synchronous flushing.", - (uchar**) &sync_relaylog_period, (uchar**) &sync_relaylog_period, 0, GET_UINT, - REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, - {"sync-relay-log-info", OPT_SYNC_RELAY_LOG_INFO, - "Synchronously flush relay log info to disk after #th transaction. " - "Use 0 (default) to disable synchronous flushing.", - (uchar**) &sync_relayloginfo_period, (uchar**) &sync_relayloginfo_period, 0, GET_UINT, - REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, - {"sync-master-info", OPT_SYNC_MASTER_INFO, - "Synchronously flush master info to disk after every #th event. " - "Use 0 (default) to disable synchronous flushing.", - (uchar**) &sync_masterinfo_period, (uchar**) &sync_masterinfo_period, 0, GET_UINT, - REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, - {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.", - (uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, - 0, 0, 0, 0}, - {"table_cache", OPT_TABLE_OPEN_CACHE, - "Deprecated; use --table_open_cache instead.", + 128*1024L, IO_SIZE*2, INT_MAX32, 0, IO_SIZE, 0}, + {"table_cache", 0, "Deprecated; use --table-open-cache instead.", (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0}, - {"table_definition_cache", OPT_TABLE_DEF_CACHE, - "The number of cached table definitions.", - (uchar**) &table_def_size, (uchar**) &table_def_size, - 0, GET_ULONG, REQUIRED_ARG, TABLE_DEF_CACHE_DEFAULT, TABLE_DEF_CACHE_MIN, - 512*1024L, 0, 1, 0}, - {"table_open_cache", OPT_TABLE_OPEN_CACHE, - "The number of cached open tables.", - (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG, - REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0}, - {"table_lock_wait_timeout", OPT_TABLE_LOCK_WAIT_TIMEOUT, - "Timeout in seconds to wait for a table level lock before returning an " - "error. Used only if the connection has active cursors.", - (uchar**) &table_lock_wait_timeout, (uchar**) &table_lock_wait_timeout, - 0, GET_ULONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0}, - {"thread_cache_size", OPT_THREAD_CACHE_SIZE, - "How many threads we should keep in a cache for reuse.", - (uchar**) &thread_cache_size, (uchar**) &thread_cache_size, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, 16384, 0, 1, 0}, - {"thread_concurrency", OPT_THREAD_CONCURRENCY, - "Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.", - (uchar**) &concurrency, (uchar**) &concurrency, 0, GET_ULONG, REQUIRED_ARG, - DEFAULT_CONCURRENCY, 1, 512, 0, 1, 0}, -#if HAVE_POOL_OF_THREADS == 1 - {"thread_pool_size", OPT_THREAD_CACHE_SIZE, - "How many threads we should create to handle query requests in case of 'thread_handling=pool-of-threads'", - (uchar**) &thread_pool_size, (uchar**) &thread_pool_size, 0, GET_ULONG, - REQUIRED_ARG, 20, 1, 16384, 0, 1, 0}, -#endif - {"thread_stack", OPT_THREAD_STACK, - "The stack size for each thread.", (uchar**) &my_thread_stack_size, - (uchar**) &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK, - 1024L*128L, ULONG_MAX, 0, 1024, 0}, - { "time_format", OPT_TIME_FORMAT, - "The TIME format (for future).", - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"tmp_table_size", OPT_TMP_TABLE_SIZE, - "If an internal in-memory temporary table exceeds this size, MySQL will" - " automatically convert it to an on-disk MyISAM table.", - (uchar**) &global_system_variables.tmp_table_size, - (uchar**) &max_system_variables.tmp_table_size, 0, GET_ULL, - REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0}, - {"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE, - "Allocation block size for transactions to be stored in binary log", - (uchar**) &global_system_variables.trans_alloc_block_size, - (uchar**) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG, - REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, - {"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE, - "Persistent buffer for transactions to be stored in binary log", - (uchar**) &global_system_variables.trans_prealloc_size, - (uchar**) &max_system_variables.trans_prealloc_size, 0, GET_ULONG, - REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, - {"thread_handling", OPT_THREAD_HANDLING, - "Define threads usage for handling queries: " - "one-thread-per-connection or no-threads", 0, 0, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"updatable_views_with_limit", OPT_UPDATABLE_VIEWS_WITH_LIMIT, - "1 = YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools).", - (uchar**) &global_system_variables.updatable_views_with_limit, - (uchar**) &max_system_variables.updatable_views_with_limit, - 0, GET_ULONG, REQUIRED_ARG, 1, 0, 1, 0, 1, 0}, - {"wait_timeout", OPT_WAIT_TIMEOUT, - "The number of seconds the server waits for activity on a connection before closing it.", - (uchar**) &global_system_variables.net_wait_timeout, - (uchar**) &max_system_variables.net_wait_timeout, 0, GET_ULONG, - REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT), - 0, 1, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -7638,6 +6344,12 @@ SHOW_VAR status_vars[]= { {NullS, NullS, SHOW_LONG} }; +static bool all_options_add_terminator() +{ + 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); +} + #ifndef EMBEDDED_LIBRARY static void print_version(void) { @@ -7647,8 +6359,52 @@ static void print_version(void) server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT); } +/** Compares two options' names, treats - and _ the same */ +static int option_cmp(my_option *a, my_option *b) +{ + const char *sa= a->name; + const char *sb= b->name; + for (; *sa || *sb; sa++, sb++) + { + if (*sa < *sb) + { + if (*sa == '-' && *sb == '_') + continue; + else + return -1; + } + if (*sa > *sb) + { + if (*sa == '_' && *sb == '-') + continue; + else + return 1; + } + } + DBUG_ASSERT(a->name == b->name); + return 0; +} + +static void print_help() +{ + MEM_ROOT mem_root; + init_alloc_root(&mem_root, 4096, 4096); + + pop_dynamic(&all_options); + add_plugin_options(&all_options, &mem_root); + sort_dynamic(&all_options, (qsort_cmp) option_cmp); + all_options_add_terminator(); + + my_print_help((my_option*) all_options.buffer); + my_print_variables((my_option*) all_options.buffer); + + free_root(&mem_root, MYF(0)); + delete_dynamic(&all_options); +} + static void usage(void) { + DBUG_ENTER("usage"); if (!(default_charset_info= get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY, MYF(MY_WME)))) @@ -7658,7 +6414,7 @@ static void usage(void) print_version(); puts("\ Copyright (C) 2000-2008 MySQL AB, by Monty and others\n\ -Copyright (C) 2008 Sun Microsystems, Inc.\n\ +Copyright (C) 2008,2009 Sun Microsystems, Inc.\n\ This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ and you are welcome to modify and redistribute it under the GPL license\n\n\ Starts the MySQL database server\n"); @@ -7686,7 +6442,7 @@ Starts the MySQL database server\n"); set_ports(); /* Print out all the options including plugin supplied options */ - my_print_help_inc_plugins(my_long_options, sizeof(my_long_options)/sizeof(my_option)); + print_help(); if (! plugins_are_initialized) { @@ -7699,15 +6455,12 @@ because execution stopped before plugins were initialized."); To see what values a running MySQL server is using, type\n\ 'mysqladmin variables' instead of 'mysqld --verbose --help'."); } + DBUG_VOID_RETURN; } #endif /*!EMBEDDED_LIBRARY*/ - /** - Initialize all MySQL global variables to default values. - - We don't need to set numeric variables refered to in my_long_options - as these are initialized by my_getopt. + Initialize MySQL global variables to default values. @note The reason to set a lot of global variables to zero is to allow one to @@ -7715,27 +6468,24 @@ To see what values a running MySQL server is using, type\n\ It's also needed on some exotic platforms where global variables are not set to 0 when a program starts. - We don't need to set numeric variables refered to in my_long_options + We don't need to set variables refered to in my_long_options as these are initialized by my_getopt. */ static int mysql_init_variables(void) { - int error; /* Things reset to zero */ opt_skip_slave_start= opt_reckless_slave = 0; mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0; myisam_test_invalid_symlink= test_if_data_home_dir; opt_log= opt_slow_log= 0; opt_update_log= 0; - log_output_options= find_bit_type(log_output_str, &log_output_typelib); opt_bin_log= 0; opt_disable_networking= opt_skip_show_db=0; opt_ignore_builtin_innodb= 0; opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0; opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name ! opt_secure_auth= 0; - opt_secure_file_priv= 0; opt_bootstrap= opt_myisam_log= 0; mqh_used= 0; segfaulted= kill_in_progress= 0; @@ -7776,25 +6526,12 @@ static int mysql_init_variables(void) table_alias_charset= &my_charset_bin; character_set_filesystem= &my_charset_bin; - opt_date_time_formats[0]= opt_date_time_formats[1]= opt_date_time_formats[2]= 0; - - /* Things with default values that are not zero */ - delay_key_write_options= (uint) DELAY_KEY_WRITE_ON; - slave_exec_mode_options= 0; - slave_exec_mode_options= (uint) - find_bit_type_or_exit(slave_exec_mode_str, &slave_exec_mode_typelib, NULL, - &error); - if (error) - return 1; opt_specialflag= SPECIAL_ENGLISH; unix_sock= ip_sock= INVALID_SOCKET; mysql_home_ptr= mysql_home; pidfile_name_ptr= pidfile_name; log_error_file_ptr= log_error_file; lc_messages_dir_ptr= lc_messages_dir; - mysql_data_home= mysql_real_data_home; - thd_startup_options= (OPTION_BIN_LOG | - OPTION_QUOTE_SHOW_CREATE | OPTION_SQL_NOTES); protocol_version= PROTOCOL_VERSION; what_to_log= ~ (1L << (uint) COM_TIME); refresh_version= 1L; /* Increments on each reload */ @@ -7802,8 +6539,6 @@ static int mysql_init_variables(void) my_atomic_rwlock_init(&global_query_id_lock); my_atomic_rwlock_init(&thread_running_lock); strmov(server_version, MYSQL_SERVER_VERSION); - myisam_recover_options_str= sql_mode_str= "OFF"; - myisam_stats_method_str= "nulls_unequal"; threads.empty(); thread_cache.empty(); key_caches.empty(); @@ -7817,12 +6552,9 @@ static int mysql_init_variables(void) multi_keycache_init(); /* Set directory paths */ - strmake(mysql_real_data_home, get_relative_path(MYSQL_DATADIR), - sizeof(mysql_real_data_home)-1); - mysql_data_home_buff[0]=FN_CURLIB; // all paths are relative from here - mysql_data_home_buff[1]=0; - mysql_data_home_len= 2; - + mysql_real_data_home_len= + strmake(mysql_real_data_home, get_relative_path(MYSQL_DATADIR), + sizeof(mysql_real_data_home)-1) - mysql_real_data_home; /* Replication parameters */ master_info_file= (char*) "master.info", relay_log_info_file= (char*) "relay-log.info"; @@ -7833,28 +6565,10 @@ static int mysql_init_variables(void) charsets_dir= 0; default_character_set_name= (char*) MYSQL_DEFAULT_CHARSET_NAME; default_collation_name= compiled_default_collation_name; - sys_charset_system.value= (char*) system_charset_info->csname; character_set_filesystem_name= (char*) "binary"; lc_messages= (char*) "en_US"; lc_time_names_name= (char*) "en_US"; - /* Set default values for some option variables */ - default_storage_engine_str= (char*) "MyISAM"; - global_system_variables.table_plugin= NULL; - global_system_variables.tx_isolation= ISO_REPEATABLE_READ; - global_system_variables.select_limit= (ulonglong) HA_POS_ERROR; - max_system_variables.select_limit= (ulonglong) HA_POS_ERROR; - global_system_variables.max_join_size= (ulonglong) HA_POS_ERROR; - max_system_variables.max_join_size= (ulonglong) HA_POS_ERROR; - global_system_variables.old_passwords= 0; - global_system_variables.old_alter_table= 0; - global_system_variables.binlog_format= BINLOG_FORMAT_UNSPEC; - /* - Default behavior for 4.1 and 5.0 is to treat NULL values as unequal - when collecting index statistics for MyISAM tables. - */ - global_system_variables.myisam_stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL; - global_system_variables.optimizer_switch= OPTIMIZER_SWITCH_DEFAULT; /* Variables that depends on compile options */ #ifndef DBUG_OFF default_dbug_option=IF_WIN("d:t:i:O,\\mysqld.trace", @@ -7866,12 +6580,7 @@ static int mysql_init_variables(void) #else have_profiling = SHOW_OPTION_NO; #endif - global_system_variables.ndb_index_stat_enable=FALSE; - max_system_variables.ndb_index_stat_enable=TRUE; - global_system_variables.ndb_index_stat_cache_entries=32; - max_system_variables.ndb_index_stat_cache_entries=~0L; - global_system_variables.ndb_index_stat_update_freq=20; - max_system_variables.ndb_index_stat_update_freq=~0L; + #ifdef HAVE_OPENSSL have_ssl=SHOW_OPTION_YES; #else @@ -7952,14 +6661,11 @@ static int mysql_init_variables(void) return 0; } - my_bool mysqld_get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - int error; - switch(optid) { case '#': #ifndef DBUG_OFF @@ -7968,7 +6674,7 @@ mysqld_get_one_option(int optid, opt_endinfo=1; /* unireg: memory allocation */ break; case 'a': - global_system_variables.sql_mode= fix_sql_mode(MODE_ANSI); + global_system_variables.sql_mode= MODE_ANSI; global_system_variables.tx_isolation= ISO_SERIALIZABLE; break; case 'b': @@ -7985,8 +6691,7 @@ mysqld_get_one_option(int optid, case 'h': strmake(mysql_real_data_home,argument, sizeof(mysql_real_data_home)-1); /* Correct pointer set by my_getopt (for embedded library) */ - mysql_data_home= mysql_real_data_home; - mysql_data_home_len= strlen(mysql_data_home); + mysql_real_data_home_ptr= mysql_real_data_home; break; case 'u': if (!mysqld_user || !strcmp(mysqld_user, argument)) @@ -7996,22 +6701,10 @@ mysqld_get_one_option(int optid, break; case 'L': strmake(lc_messages_dir, argument, sizeof(lc_messages_dir)-1); + lc_messages_dir_ptr= lc_messages_dir; break; -#ifdef HAVE_REPLICATION - case OPT_SLAVE_SKIP_ERRORS: - init_slave_skip_errors(argument); - break; - case OPT_SLAVE_EXEC_MODE: - slave_exec_mode_options= (uint) - find_bit_type_or_exit(argument, &slave_exec_mode_typelib, "", &error); - if (error) - return 1; - break; -#endif - case OPT_SAFEMALLOC_MEM_LIMIT: -#if !defined(DBUG_OFF) && defined(SAFEMALLOC) - sf_malloc_mem_limit = atoi(argument); -#endif + case OPT_BINLOG_FORMAT: + binlog_format_used= true; break; #include #ifndef EMBEDDED_LIBRARY @@ -8031,12 +6724,6 @@ mysqld_get_one_option(int optid, test_flags= argument ? (uint) atoi(argument) : 0; opt_endinfo=1; break; - case (int) OPT_BIG_TABLES: - thd_startup_options|=OPTION_BIG_TABLES; - break; - case (int) OPT_IGNORE_BUILTIN_INNODB: - opt_ignore_builtin_innodb= 1; - break; case (int) OPT_ISAM_LOG: opt_myisam_log=1; break; @@ -8046,17 +6733,7 @@ mysqld_get_one_option(int optid, case (int) OPT_BIN_LOG: opt_bin_log= test(argument != disabled_my_option); break; - case (int) OPT_ERROR_LOG_FILE: - opt_error_log= 1; - break; #ifdef HAVE_REPLICATION - case (int) OPT_INIT_RPL_ROLE: - { - int role; - role= find_type_or_exit(argument, &rpl_role_typelib, opt->name); - rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE; - break; - } case (int)OPT_REPLICATE_IGNORE_DB: { rpl_filter->add_ignore_db(argument); @@ -8103,13 +6780,6 @@ mysqld_get_one_option(int optid, binlog_filter->add_ignore_db(argument); break; } - case OPT_BINLOG_FORMAT: - { - int id; - id= find_type_or_exit(argument, &binlog_format_typelib, opt->name); - global_system_variables.binlog_format= opt_binlog_format_id= id - 1; - break; - } case (int)OPT_BINLOG_DO_DB: { binlog_filter->add_do_db(argument); @@ -8156,38 +6826,11 @@ mysqld_get_one_option(int optid, WARN_DEPRECATED(NULL, 7, 0, "--log-slow-queries", "'--slow-query-log'/'--slow-query-log-file'"); opt_slow_log= 1; break; -#ifdef WITH_CSV_STORAGE_ENGINE - case OPT_LOG_OUTPUT: - { - if (!argument || !argument[0]) - { - log_output_options= LOG_FILE; - log_output_str= log_output_typelib.type_names[1]; - } - else - { - log_output_str= argument; - log_output_options= - find_bit_type_or_exit(argument, &log_output_typelib, opt->name, &error); - if (error) - return 1; - } - break; - } -#endif - case OPT_EVENT_SCHEDULER: -#ifndef HAVE_EVENT_SCHEDULER - sql_perror("Event scheduler is not supported in embedded build."); -#else - if (Events::set_opt_event_scheduler(argument)) - return 1; -#endif - break; case (int) OPT_SKIP_NEW: opt_specialflag|= SPECIAL_NO_NEW_FUNC; - delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE; + delay_key_write_options= DELAY_KEY_WRITE_NONE; myisam_concurrent_insert=0; - myisam_recover_options= HA_RECOVER_NONE; + myisam_recover_options= HA_RECOVER_OFF; sp_automatic_privileges=0; my_use_symdir=0; ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE); @@ -8197,7 +6840,7 @@ mysqld_get_one_option(int optid, break; case (int) OPT_SAFE: opt_specialflag|= SPECIAL_SAFE_MODE; - delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE; + delay_key_write_options= DELAY_KEY_WRITE_NONE; myisam_recover_options= HA_RECOVER_DEFAULT; ha_open_options&= ~(HA_OPEN_DELAY_KEY_WRITE); break; @@ -8216,18 +6859,6 @@ mysqld_get_one_option(int optid, case (int) OPT_SKIP_RESOLVE: opt_specialflag|=SPECIAL_NO_RESOLVE; break; - case (int) OPT_SKIP_NETWORKING: -#if defined(__NETWARE__) - sql_perror("Can't start server: skip-networking option is currently not supported on NetWare"); - return 1; -#endif - opt_disable_networking=1; - mysqld_port=0; - break; - case (int) OPT_SKIP_SHOW_DB: - opt_skip_show_db=1; - opt_specialflag|=SPECIAL_SKIP_SHOW_DB; - break; case (int) OPT_WANT_CORE: test_flags |= TEST_CORE_ON_SIGNAL; break; @@ -8259,25 +6890,10 @@ mysqld_get_one_option(int optid, freeaddrinfo(res_lst); } break; - case (int) OPT_PID_FILE: - strmake(pidfile_name, argument, sizeof(pidfile_name)-1); - break; -#ifdef __WIN__ - case (int) OPT_STANDALONE: /* Dummy option for NT */ - break; -#endif case OPT_CONSOLE: if (opt_console) opt_error_log= 0; // Force logs to stdout break; - case (int) OPT_FLUSH: - myisam_flush=1; - flush_time=0; // No auto flush - break; - case OPT_LOW_PRIORITY_UPDATES: - thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY; - global_system_variables.low_priority_updates=1; - break; case OPT_BOOTSTRAP: opt_noacl=opt_bootstrap=1; break; @@ -8286,188 +6902,14 @@ mysqld_get_one_option(int optid, break; case OPT_DELAY_KEY_WRITE_ALL: if (argument != disabled_my_option) - argument= (char*) "ALL"; - /* Fall through */ - case OPT_DELAY_KEY_WRITE: - if (argument == disabled_my_option) - delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE; - else if (! argument) - delay_key_write_options= (uint) DELAY_KEY_WRITE_ON; + delay_key_write_options= DELAY_KEY_WRITE_ALL; else - { - int type; - type= find_type_or_exit(argument, &delay_key_write_typelib, opt->name); - delay_key_write_options= (uint) type-1; - } + delay_key_write_options= DELAY_KEY_WRITE_NONE; break; - case OPT_CHARSETS_DIR: - strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir)-1); - charsets_dir = mysql_charsets_dir; - break; - case OPT_TX_ISOLATION: - { - int type; - type= find_type_or_exit(argument, &tx_isolation_typelib, opt->name); - global_system_variables.tx_isolation= (type-1); - break; - } -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE - case OPT_NDB_MGMD: - case OPT_NDB_NODEID: - { - int len= my_snprintf(opt_ndb_constrbuf+opt_ndb_constrbuf_len, - sizeof(opt_ndb_constrbuf)-opt_ndb_constrbuf_len, - "%s%s%s",opt_ndb_constrbuf_len > 0 ? ",":"", - optid == OPT_NDB_NODEID ? "nodeid=" : "", - argument); - opt_ndb_constrbuf_len+= len; - } - /* fall through to add the connectstring to the end - * and set opt_ndbcluster_connectstring - */ - case OPT_NDB_CONNECTSTRING: - if (opt_ndb_connectstring && opt_ndb_connectstring[0]) - my_snprintf(opt_ndb_constrbuf+opt_ndb_constrbuf_len, - sizeof(opt_ndb_constrbuf)-opt_ndb_constrbuf_len, - "%s%s", opt_ndb_constrbuf_len > 0 ? ",":"", - opt_ndb_connectstring); - else - opt_ndb_constrbuf[opt_ndb_constrbuf_len]= 0; - opt_ndbcluster_connectstring= opt_ndb_constrbuf; - break; - case OPT_NDB_DISTRIBUTION: - int id; - id= find_type_or_exit(argument, &ndb_distribution_typelib, opt->name); - opt_ndb_distribution_id= (enum ndb_distribution)(id-1); - break; - case OPT_NDB_EXTRA_LOGGING: - if (!argument) - ndb_extra_logging++; - else if (argument == disabled_my_option) - ndb_extra_logging= 0L; - else - ndb_extra_logging= atoi(argument); - break; -#endif - case OPT_MYISAM_RECOVER: - { - if (!argument) - { - myisam_recover_options= HA_RECOVER_DEFAULT; - myisam_recover_options_str= myisam_recover_typelib.type_names[0]; - } - else if (!argument[0]) - { - myisam_recover_options= HA_RECOVER_NONE; - myisam_recover_options_str= "OFF"; - } - else - { - myisam_recover_options_str=argument; - myisam_recover_options= - find_bit_type_or_exit(argument, &myisam_recover_typelib, opt->name, - &error); - if (error) - return 1; - } - ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; - break; - } - case OPT_CONCURRENT_INSERT: - /* The following code is mainly here to emulate old behavior */ - if (!argument) /* --concurrent-insert */ - myisam_concurrent_insert= 1; - else if (argument == disabled_my_option) - myisam_concurrent_insert= 0; /* --skip-concurrent-insert */ - break; - case OPT_TC_HEURISTIC_RECOVER: - tc_heuristic_recover= find_type_or_exit(argument, - &tc_heuristic_recover_typelib, - opt->name); - break; - case OPT_MYISAM_STATS_METHOD: - { - ulong method_conv; - int method; - LINT_INIT(method_conv); - - myisam_stats_method_str= argument; - method= find_type_or_exit(argument, &myisam_stats_method_typelib, - opt->name); - switch (method-1) { - case 2: - method_conv= MI_STATS_METHOD_IGNORE_NULLS; - break; - case 1: - method_conv= MI_STATS_METHOD_NULLS_EQUAL; - break; - case 0: - default: - method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; - break; - } - global_system_variables.myisam_stats_method= method_conv; - break; - } - case OPT_SQL_MODE: - { - sql_mode_str= argument; - global_system_variables.sql_mode= - find_bit_type_or_exit(argument, &sql_mode_typelib, opt->name, &error); - if (error) - return 1; - global_system_variables.sql_mode= fix_sql_mode(global_system_variables. - sql_mode); - break; - } - case OPT_OPTIMIZER_SWITCH: - { - bool not_used; - char *error= 0; - uint error_len= 0; - optimizer_switch_str= argument; - global_system_variables.optimizer_switch= - (ulong)find_set_from_flags(&optimizer_switch_typelib, - optimizer_switch_typelib.count, - global_system_variables.optimizer_switch, - global_system_variables.optimizer_switch, - argument, strlen(argument), NULL, - &error, &error_len, ¬_used); - if (error) - { - char buf[512]; - char *cbuf= buf; - cbuf += my_snprintf(buf, 512, "Error in parsing optimizer_switch setting near %*s\n", error_len, error); - sql_perror(buf); - return 1; - } - break; - } case OPT_ONE_THREAD: - global_system_variables.thread_handling= - SCHEDULER_ONE_THREAD_PER_CONNECTION; - break; - case OPT_THREAD_HANDLING: - { - global_system_variables.thread_handling= - find_type_or_exit(argument, &thread_handling_typelib, opt->name)-1; - break; - } - case OPT_FT_BOOLEAN_SYNTAX: - if (ft_boolean_check_syntax_string((uchar*) argument)) - { - sql_print_error("Invalid ft-boolean-syntax string: %s\n", argument); - return 1; - } - strmake(ft_boolean_syntax, argument, sizeof(ft_boolean_syntax)-1); - break; - case OPT_SKIP_SAFEMALLOC: -#ifdef SAFEMALLOC - sf_malloc_quick=1; -#endif + thread_handling= SCHEDULER_ONE_THREAD_PER_CONNECTION; break; case OPT_LOWER_CASE_TABLE_NAMES: - lower_case_table_names= argument ? atoi(argument) : 1; lower_case_table_names_used= 1; break; #if defined(ENABLED_DEBUG_SYNC) @@ -8559,24 +7001,92 @@ static int get_options(int *argc,char **argv) int ho_error; my_getopt_register_get_addr(mysql_getopt_value); - strmake(def_ft_boolean_syntax, ft_boolean_syntax, - sizeof(ft_boolean_syntax)-1); 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); + 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(); + /* 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_long_options, + if ((ho_error= handle_options(argc, &argv, (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. */ + /* + Options have been parsed. Now some of them need additional special + handling, like custom value checking, checking of incompatibilites + between options, setting of multiple variables, etc. + Do them here. + */ + if ((opt_log_slow_admin_statements || opt_log_queries_not_using_indexes || opt_log_slow_slave_statements) && !opt_slow_log) sql_print_warning("options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set"); + if (log_error_file_ptr != disabled_my_option) + opt_error_log= 1; + else + log_error_file_ptr= const_cast(""); + + opt_init_connect.length=strlen(opt_init_connect.str); + opt_init_slave.length=strlen(opt_init_slave.str); + + if (global_system_variables.low_priority_updates) + thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY; + + if (ft_boolean_check_syntax_string((uchar*) ft_boolean_syntax)) + { + sql_print_error("Invalid ft-boolean-syntax string: %s\n", + ft_boolean_syntax); + return 1; + } + + if (opt_disable_networking) + { +#if defined(__NETWARE__) + sql_print_error("Can't start server: skip-networking option is currently not supported on NetWare"); + return 1; +#endif + mysqld_port= 0; + } + if (opt_skip_show_db) + opt_specialflag|= SPECIAL_SKIP_SHOW_DB; + + if (myisam_flush) + flush_time= 0; + +#ifdef HAVE_REPLICATION + if (opt_slave_skip_errors) + init_slave_skip_errors(opt_slave_skip_errors); +#endif + + if (global_system_variables.max_join_size == HA_POS_ERROR) + global_system_variables.option_bits|= OPTION_BIG_SELECTS; + else + global_system_variables.option_bits&= ~OPTION_BIG_SELECTS; + + if (global_system_variables.option_bits & OPTION_AUTOCOMMIT) + global_system_variables.option_bits&= ~OPTION_NOT_AUTOCOMMIT; + else + global_system_variables.option_bits|= OPTION_NOT_AUTOCOMMIT; + + global_system_variables.sql_mode= + expand_sql_mode(global_system_variables.sql_mode); #if defined(HAVE_BROKEN_REALPATH) my_use_symdir=0; my_disable_symlinks=1; @@ -8595,15 +7105,13 @@ static int get_options(int *argc,char **argv) test_flags&= ~TEST_CORE_ON_SIGNAL; } /* Set global MyISAM variables from delay_key_write_options */ - fix_delay_key_write((THD*) 0, OPT_GLOBAL); - /* Set global slave_exec_mode from its option */ - fix_slave_exec_mode(OPT_GLOBAL); + fix_delay_key_write(0, 0, OPT_GLOBAL); #ifndef EMBEDDED_LIBRARY if (mysqld_chroot) set_root(mysqld_chroot); #else - global_system_variables.thread_handling = SCHEDULER_NO_THREADS; + thread_handling = SCHEDULER_NO_THREADS; max_allowed_packet= global_system_variables.max_allowed_packet; net_buffer_length= global_system_variables.net_buffer_length; #endif @@ -8616,34 +7124,27 @@ static int get_options(int *argc,char **argv) */ my_disable_locking= myisam_single_user= test(opt_external_locking == 0); my_default_record_cache_size=global_system_variables.read_buff_size; - myisam_max_temp_length= - (my_off_t) global_system_variables.myisam_max_sort_file_size; - /* Set global variables based on startup options */ - myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size); - - /* long_query_time is in microseconds */ - global_system_variables.long_query_time= max_system_variables.long_query_time= - (longlong) (long_query_time * 1000000.0); + global_system_variables.long_query_time= (ulonglong) + (global_system_variables.long_query_time_double * 1e6); if (opt_short_log_format) opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT; if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE, - &global_system_variables.date_format) || + &global_date_format) || init_global_datetime_format(MYSQL_TIMESTAMP_TIME, - &global_system_variables.time_format) || + &global_time_format) || init_global_datetime_format(MYSQL_TIMESTAMP_DATETIME, - &global_system_variables.datetime_format)) + &global_datetime_format)) return 1; #ifdef EMBEDDED_LIBRARY one_thread_scheduler(&thread_scheduler); #else - if (global_system_variables.thread_handling <= - SCHEDULER_ONE_THREAD_PER_CONNECTION) + if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION) one_thread_per_connection_scheduler(&thread_scheduler); - else if (global_system_variables.thread_handling == SCHEDULER_NO_THREADS) + else if (thread_handling == SCHEDULER_NO_THREADS) one_thread_scheduler(&thread_scheduler); else pool_of_threads_scheduler(&thread_scheduler); /* purecov: tested */ @@ -8729,7 +7230,7 @@ static int fix_paths(void) convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS); (void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir (void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home); - (void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home); + (void) my_load_path(pidfile_name, pidfile_name_ptr, mysql_real_data_home); (void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr : get_relative_path(PLUGINDIR), mysql_home); opt_plugin_dir_ptr= opt_plugin_dir; @@ -8749,23 +7250,22 @@ static int fix_paths(void) (void) my_load_path(lc_messages_dir, lc_messages_dir, buff); /* If --character-sets-dir isn't given, use shared library dir */ - if (charsets_dir != mysql_charsets_dir) - { + if (charsets_dir) + strmake(mysql_charsets_dir, charsets_dir, sizeof(mysql_charsets_dir)-1); + else strxnmov(mysql_charsets_dir, sizeof(mysql_charsets_dir)-1, buff, CHARSET_DIR, NullS); - } (void) my_load_path(mysql_charsets_dir, mysql_charsets_dir, buff); convert_dirname(mysql_charsets_dir, mysql_charsets_dir, NullS); charsets_dir=mysql_charsets_dir; if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir)) return 1; + if (!opt_mysql_tmpdir) + opt_mysql_tmpdir= mysql_tmpdir; #ifdef HAVE_REPLICATION if (!slave_load_tmpdir) - { - if (!(slave_load_tmpdir = (char*) my_strdup(mysql_tmpdir, MYF(MY_FAE)))) - return 1; - } + slave_load_tmpdir= mysql_tmpdir; #endif /* HAVE_REPLICATION */ /* Convert the secure-file-priv option to system format, allowing @@ -8774,106 +7274,12 @@ static int fix_paths(void) if (opt_secure_file_priv) { convert_dirname(buff, opt_secure_file_priv, NullS); - my_free(opt_secure_file_priv, MYF(0)); + x_free(opt_secure_file_priv); opt_secure_file_priv= my_strdup(buff, MYF(MY_FAE)); } return 0; } - -static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib, - const char *option, int *error) -{ - ulong result; - const char **ptr; - - *error= 0; - if ((result= find_bit_type(x, bit_lib)) == ~(ulong) 0) - { - char *buff= (char *) my_alloca(2048); - char *cbuf; - ptr= bit_lib->type_names; - cbuf= buff + ((!*x) ? - my_snprintf(buff, 2048, "No option given to %s\n", option) : - my_snprintf(buff, 2048, "Wrong option to %s. Option(s) given: %s\n", - option, x)); - cbuf+= my_snprintf(cbuf, 2048 - (cbuf-buff), "Alternatives are: '%s'", *ptr); - while (*++ptr) - cbuf+= my_snprintf(cbuf, 2048 - (cbuf-buff), ",'%s'", *ptr); - my_snprintf(cbuf, 2048 - (cbuf-buff), "\n"); - sql_perror(buff); - *error= 1; - my_afree(buff); - return 0; - } - - return result; -} - - -/** - @return - a bitfield from a string of substrings separated by ',' - or - ~(ulong) 0 on error. -*/ - -static ulong find_bit_type(const char *x, TYPELIB *bit_lib) -{ - bool found_end; - int found_count; - const char *end,*i,*j; - const char **array, *pos; - ulong found,found_int,bit; - DBUG_ENTER("find_bit_type"); - DBUG_PRINT("enter",("x: '%s'",x)); - - found=0; - found_end= 0; - pos=(char *) x; - while (*pos == ' ') pos++; - found_end= *pos == 0; - while (!found_end) - { - if (!*(end=strcend(pos,','))) /* Let end point at fieldend */ - { - while (end > pos && end[-1] == ' ') - end--; /* Skip end-space */ - found_end=1; - } - found_int=0; found_count=0; - for (array=bit_lib->type_names, bit=1 ; (i= *array++) ; bit<<=1) - { - j=pos; - while (j != end) - { - if (my_toupper(mysqld_charset,*i++) != - my_toupper(mysqld_charset,*j++)) - goto skip; - } - found_int=bit; - if (! *i) - { - found_count=1; - break; - } - else if (j != pos) // Half field found - { - found_count++; // Could be one of two values - } -skip: ; - } - if (found_count != 1) - DBUG_RETURN(~(ulong) 0); // No unique value - found|=found_int; - pos=end+1; - } - - DBUG_PRINT("exit",("bit-field: %ld",(ulong) found)); - DBUG_RETURN(found); -} /* find_bit_type */ - - /** Check if file system used for databases is case insensitive. @@ -8976,11 +7382,6 @@ void refresh_status(THD *thd) This section should go away soon *****************************************************************************/ -#ifndef WITH_NDBCLUSTER_STORAGE_ENGINE -ulong ndb_cache_check_time; -ulong ndb_extra_logging; -#endif - /***************************************************************************** Instantiate templates *****************************************************************************/ @@ -8991,7 +7392,6 @@ template class I_List; template class I_List_iterator; template class I_List; template class I_List; -template class I_List; template class I_List; template class I_List_iterator; #endif diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ac5b1f575de..741815585e2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -5834,7 +5834,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field, SEL_ARG *tree= 0; MEM_ROOT *alloc= param->mem_root; uchar *str; - ulong orig_sql_mode; + ulonglong orig_sql_mode; int err; DBUG_ENTER("get_mm_leaf"); @@ -7574,7 +7574,6 @@ void SEL_ARG::test_use_count(SEL_ARG *root) #endif - /* Calculate estimate of number records that will be retrieved by a range scan on given index using given SEL_ARG intervals tree. @@ -7811,8 +7810,8 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree, param->range_count++; if (!tmp_min_flag && ! tmp_max_flag && (uint) key_tree->part+1 == param->table->key_info[keynr].key_parts && - (param->table->key_info[keynr].flags & (HA_NOSAME | HA_END_SPACE_KEY)) == - HA_NOSAME && min_key_length == max_key_length && + param->table->key_info[keynr].flags & HA_NOSAME && + min_key_length == max_key_length && !memcmp(param->min_key, param->max_key, min_key_length) && !param->first_null_comp) { @@ -8105,8 +8104,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, { KEY *table_key=quick->head->key_info+quick->index; flag=EQ_RANGE; - if ((table_key->flags & (HA_NOSAME | HA_END_SPACE_KEY)) == HA_NOSAME && - key->part == table_key->key_parts-1) + if ((table_key->flags & HA_NOSAME) && key->part == table_key->key_parts-1) { if (!(table_key->flags & HA_NULL_PART_KEY) || !null_part_in_key(key, @@ -8155,8 +8153,7 @@ bool QUICK_RANGE_SELECT::unique_key_range() if ((tmp->flag & (EQ_RANGE | NULL_RANGE)) == EQ_RANGE) { KEY *key=head->key_info+index; - return ((key->flags & (HA_NOSAME | HA_END_SPACE_KEY)) == HA_NOSAME && - key->key_length == tmp->min_length); + return (key->flags & HA_NOSAME) && key->key_length == tmp->min_length; } } return 0; @@ -8274,8 +8271,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, range->min_length= range->max_length= ref->key_length; range->min_keypart_map= range->max_keypart_map= make_prev_keypart_map(ref->key_parts); - range->flag= ((ref->key_length == key_info->key_length && - (key_info->flags & HA_END_SPACE_KEY) == 0) ? EQ_RANGE : 0); + range->flag= (ref->key_length == key_info->key_length ? EQ_RANGE : 0); if (!(quick->key_parts=key_part=(KEY_PART *) alloc_root(&quick->alloc,sizeof(KEY_PART)*ref->key_parts))) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 8392b2c1c3d..c4df268279a 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -38,7 +38,7 @@ #define SLAVE_ERRMSG_SIZE (FN_REFLEN+64) -RPL_STATUS rpl_status=RPL_NULL; +uint rpl_status=RPL_NULL; pthread_mutex_t LOCK_rpl_status; pthread_cond_t COND_rpl_status; HASH slave_list; @@ -49,7 +49,7 @@ TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-1,"", const char* rpl_status_type[]= { - "AUTH_MASTER","ACTIVE_SLAVE","IDLE_SLAVE", "LOST_SOLDIER","TROOP_SOLDIER", + "AUTH_MASTER","IDLE_SLAVE","ACTIVE_SLAVE","LOST_SOLDIER","TROOP_SOLDIER", "RECOVERY_CAPTAIN","NULL",NullS }; TYPELIB rpl_status_typelib= {array_elements(rpl_status_type)-1,"", @@ -98,9 +98,6 @@ static int init_failsafe_rpl_thread(THD* thd) } thd->mem_root->free= thd->mem_root->used= 0; - if (thd->variables.max_join_size == HA_POS_ERROR) - thd->options|= OPTION_BIG_SELECTS; - thd_proc_info(thd, "Thread initialized"); thd->version=refresh_version; thd->set_time(); diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h index bce2c727050..f140b026bc1 100644 --- a/sql/repl_failsafe.h +++ b/sql/repl_failsafe.h @@ -22,11 +22,11 @@ #include "my_sys.h" #include "slave.h" -typedef enum {RPL_AUTH_MASTER=0,RPL_ACTIVE_SLAVE,RPL_IDLE_SLAVE, +typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE, RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER, RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */, RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS; -extern RPL_STATUS rpl_status; +extern uint rpl_status; extern pthread_mutex_t LOCK_rpl_status; extern pthread_cond_t COND_rpl_status; diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index 8e80620dd2c..8f3a41fbeef 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -366,7 +366,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_rli.cc b/sql/rpl_rli.cc index 4bbafa0253a..70d24f42985 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1043,7 +1043,7 @@ bool Relay_log_info::is_until_satisfied(THD *thd, Log_event *ev) DBUG_RETURN(FALSE); log_name= group_master_log_name; log_pos= (!ev)? group_master_log_pos : - ((thd->options & OPTION_BEGIN || !ev->log_pos) ? + ((thd->variables.option_bits & OPTION_BEGIN || !ev->log_pos) ? group_master_log_pos : ev->log_pos - ev->data_written); } else @@ -1168,7 +1168,7 @@ void Relay_log_info::stmt_done(my_off_t event_master_log_pos, middle of the "transaction". START SLAVE will resume at BEGIN while the MyISAM table has already been updated. */ - if ((sql_thd->options & OPTION_BEGIN) && opt_using_transactions) + if ((sql_thd->variables.option_bits & OPTION_BEGIN) && opt_using_transactions) inc_event_relay_log_pos(); else { @@ -1221,8 +1221,8 @@ void Relay_log_info::cleanup_context(THD *thd, bool error) /* Cleanup for the flags that have been set at do_apply_event. */ - thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS; - thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS; + thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS; DBUG_VOID_RETURN; } diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index ec314e50cc7..33b708cb1bd 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -22,6 +22,7 @@ struct RPL_TABLE_LIST; class Master_info; +extern uint sql_slave_skip_counter; /**************************************************************************** @@ -426,7 +427,7 @@ public: @retval false Replication thread is currently not inside a group */ bool is_in_group() const { - return (sql_thd->options & OPTION_BEGIN) || + return (sql_thd->variables.option_bits & OPTION_BEGIN) || (m_flags & (1UL << IN_STMT)); } diff --git a/sql/set_var.cc b/sql/set_var.cc index 42829590942..65218dce1eb 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -13,2134 +13,324 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - @file - - @brief - Handling of MySQL SQL variables - - @details - To add a new variable, one has to do the following: - - - Use one of the 'sys_var... classes from set_var.h or write a specific - one for the variable type. - - Define it in the 'variable definition list' in this file. - - If the variable is thread specific, add it to 'system_variables' struct. - If not, add it to mysqld.cc and an declaration in 'mysql_priv.h' - - If the variable should be changed from the command line, add a definition - of it in the my_option structure list in mysqld.cc - - Don't forget to initialize new fields in global_system_variables and - max_system_variables! - - @todo - Add full support for the variable character_set (for 4.1) - - @todo - When updating myisam_delay_key_write, we should do a 'flush tables' - of all MyISAM tables to ensure that they are reopen with the - new attribute. - - @note - Be careful with var->save_result: sys_var::check() only updates - ulonglong_value; so other members of the union are garbage then; to use - them you must first assign a value to them (in specific ::check() for - example). -*/ - #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation #endif +/* variable declarations are in sys_vars.cc now !!! */ + #include "mysql_priv.h" -#include -#include "slave.h" -#include "rpl_mi.h" -#include -#include -#include -#include - -#include "events.h" - -/* WITH_NDBCLUSTER_STORAGE_ENGINE */ -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE -extern ulong ndb_cache_check_time; -extern char opt_ndb_constrbuf[]; -extern ulong ndb_extra_logging; -#endif - -#ifdef HAVE_NDB_BINLOG -extern ulong ndb_report_thresh_binlog_epoch_slip; -extern ulong ndb_report_thresh_binlog_mem_usage; -#endif - -extern CHARSET_INFO *character_set_filesystem; - +#include "sys_vars_shared.h" static HASH system_variable_hash; +static PolyLock_mutex PLock_global_system_variables(&LOCK_global_system_variables); -const char *bool_type_names[]= { "OFF", "ON", NullS }; -TYPELIB bool_typelib= -{ - array_elements(bool_type_names)-1, "", bool_type_names, NULL -}; - -const char *delay_key_write_type_names[]= { "OFF", "ON", "ALL", NullS }; -TYPELIB delay_key_write_typelib= -{ - array_elements(delay_key_write_type_names)-1, "", - delay_key_write_type_names, NULL -}; - -const char *slave_exec_mode_names[]= -{ "STRICT", "IDEMPOTENT", NullS }; -static const unsigned int slave_exec_mode_names_len[]= -{ sizeof("STRICT") - 1, sizeof("IDEMPOTENT") - 1, 0 }; -TYPELIB slave_exec_mode_typelib= -{ - array_elements(slave_exec_mode_names)-1, "", - slave_exec_mode_names, (unsigned int *) slave_exec_mode_names_len -}; - -static int sys_check_ftb_syntax(THD *thd, set_var *var); -static bool sys_update_ftb_syntax(THD *thd, set_var * var); -static void sys_default_ftb_syntax(THD *thd, enum_var_type type); -static bool sys_update_init_connect(THD*, set_var*); -static void sys_default_init_connect(THD*, enum_var_type type); -static bool sys_update_init_slave(THD*, set_var*); -static void sys_default_init_slave(THD*, enum_var_type type); -static bool set_option_bit(THD *thd, set_var *var); -static bool set_option_log_bin_bit(THD *thd, set_var *var); -static bool set_option_autocommit(THD *thd, set_var *var); -static int check_log_update(THD *thd, set_var *var); -static bool set_log_update(THD *thd, set_var *var); -static int check_pseudo_thread_id(THD *thd, set_var *var); -void fix_binlog_format_after_update(THD *thd, enum_var_type type); -static void fix_low_priority_updates(THD *thd, enum_var_type type); -static int check_tx_isolation(THD *thd, set_var *var); -static void fix_tx_isolation(THD *thd, enum_var_type type); -static int check_completion_type(THD *thd, set_var *var); -static void fix_completion_type(THD *thd, enum_var_type type); -static void fix_net_read_timeout(THD *thd, enum_var_type type); -static void fix_net_write_timeout(THD *thd, enum_var_type type); -static void fix_net_retry_count(THD *thd, enum_var_type type); -static void fix_max_join_size(THD *thd, enum_var_type type); -#ifdef HAVE_QUERY_CACHE -static void fix_query_cache_size(THD *thd, enum_var_type type); -static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type); -#endif -static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type); -static void fix_max_binlog_size(THD *thd, enum_var_type type); -static void fix_max_relay_log_size(THD *thd, enum_var_type type); -static void fix_max_connections(THD *thd, enum_var_type type); -static int check_max_delayed_threads(THD *thd, set_var *var); -static void fix_thd_mem_root(THD *thd, enum_var_type type); -static void fix_trans_mem_root(THD *thd, enum_var_type type); -static void fix_server_id(THD *thd, enum_var_type type); -bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd, - const char *name, longlong val); -static KEY_CACHE *create_key_cache(const char *name, uint length); -void fix_sql_mode_var(THD *thd, enum_var_type type); -static uchar *get_error_count(THD *thd); -static uchar *get_warning_count(THD *thd); -static uchar *get_tmpdir(THD *thd); -static int sys_check_log_path(THD *thd, set_var *var); -static bool sys_update_general_log_path(THD *thd, set_var * var); -static void sys_default_general_log_path(THD *thd, enum_var_type type); -static bool sys_update_slow_log_path(THD *thd, set_var * var); -static void sys_default_slow_log_path(THD *thd, enum_var_type type); -static uchar *get_myisam_mmap_size(THD *thd); - -/* - Variable definition list - - These are variables that can be set from the command line, in - alphabetic order. - - The variables are linked into the list. A variable is added to - it in the constructor (see sys_var class for details). +/** + Return variable name and length for hashing of variables. */ -static sys_var_chain vars = { NULL, NULL }; - -static sys_var_thd_ulong -sys_auto_increment_increment(&vars, "auto_increment_increment", - &SV::auto_increment_increment, NULL, NULL, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_thd_ulong -sys_auto_increment_offset(&vars, "auto_increment_offset", - &SV::auto_increment_offset, NULL, NULL, - sys_var::SESSION_VARIABLE_IN_BINLOG); - -static sys_var_bool_ptr sys_automatic_sp_privileges(&vars, "automatic_sp_privileges", - &sp_automatic_privileges); - -static sys_var_const sys_back_log(&vars, "back_log", - OPT_GLOBAL, SHOW_LONG, - (uchar*) &back_log); -static sys_var_const_os_str sys_basedir(&vars, "basedir", mysql_home); -static sys_var_long_ptr sys_binlog_cache_size(&vars, "binlog_cache_size", - &binlog_cache_size); -static sys_var_thd_binlog_format sys_binlog_format(&vars, "binlog_format", - &SV::binlog_format); -static sys_var_thd_ulong sys_bulk_insert_buff_size(&vars, "bulk_insert_buffer_size", - &SV::bulk_insert_buff_size); -static sys_var_const_os sys_character_sets_dir(&vars, - "character_sets_dir", - OPT_GLOBAL, SHOW_CHAR, - (uchar*) - mysql_charsets_dir); -static sys_var_character_set_sv -sys_character_set_server(&vars, "character_set_server", - &SV::collation_server, &default_charset_info, 0, - sys_var::SESSION_VARIABLE_IN_BINLOG); -sys_var_const_str sys_charset_system(&vars, "character_set_system", - (char *)my_charset_utf8_general_ci.name); -static sys_var_character_set_database -sys_character_set_database(&vars, "character_set_database", - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_character_set_client -sys_character_set_client(&vars, "character_set_client", - &SV::character_set_client, - &default_charset_info, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_character_set_sv -sys_character_set_connection(&vars, "character_set_connection", - &SV::collation_connection, - &default_charset_info, 0, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_character_set_sv sys_character_set_results(&vars, "character_set_results", - &SV::character_set_results, - &default_charset_info, true); -static sys_var_character_set_sv sys_character_set_filesystem(&vars, "character_set_filesystem", - &SV::character_set_filesystem, - &character_set_filesystem); -static sys_var_thd_ulong sys_completion_type(&vars, "completion_type", - &SV::completion_type, - check_completion_type, - fix_completion_type); -static sys_var_collation_sv -sys_collation_connection(&vars, "collation_connection", - &SV::collation_connection, &default_charset_info, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_collation_sv -sys_collation_database(&vars, "collation_database", &SV::collation_database, - &default_charset_info, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_collation_sv -sys_collation_server(&vars, "collation_server", &SV::collation_server, - &default_charset_info, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_long_ptr sys_concurrent_insert(&vars, "concurrent_insert", - &myisam_concurrent_insert); -static sys_var_long_ptr sys_connect_timeout(&vars, "connect_timeout", - &connect_timeout); -static sys_var_const_os_str sys_datadir(&vars, "datadir", mysql_real_data_home); -#ifndef DBUG_OFF -static sys_var_thd_dbug sys_dbug(&vars, "debug"); -#endif -static sys_var_enum sys_delay_key_write(&vars, "delay_key_write", - &delay_key_write_options, - &delay_key_write_typelib, - fix_delay_key_write); -static sys_var_long_ptr sys_delayed_insert_limit(&vars, "delayed_insert_limit", - &delayed_insert_limit); -static sys_var_long_ptr sys_delayed_insert_timeout(&vars, "delayed_insert_timeout", - &delayed_insert_timeout); -static sys_var_long_ptr sys_delayed_queue_size(&vars, "delayed_queue_size", - &delayed_queue_size); - -#ifdef HAVE_EVENT_SCHEDULER -static sys_var_event_scheduler sys_event_scheduler(&vars, "event_scheduler"); -#endif - -static sys_var_long_ptr sys_expire_logs_days(&vars, "expire_logs_days", - &expire_logs_days); -static sys_var_bool_ptr sys_flush(&vars, "flush", &myisam_flush); -static sys_var_long_ptr sys_flush_time(&vars, "flush_time", &flush_time); -static sys_var_str sys_ft_boolean_syntax(&vars, "ft_boolean_syntax", - sys_check_ftb_syntax, - sys_update_ftb_syntax, - sys_default_ftb_syntax, - ft_boolean_syntax); -static sys_var_const sys_ft_max_word_len(&vars, "ft_max_word_len", - OPT_GLOBAL, SHOW_LONG, - (uchar*) &ft_max_word_len); -static sys_var_const sys_ft_min_word_len(&vars, "ft_min_word_len", - OPT_GLOBAL, SHOW_LONG, - (uchar*) &ft_min_word_len); -static sys_var_const sys_ft_query_expansion_limit(&vars, - "ft_query_expansion_limit", - OPT_GLOBAL, SHOW_LONG, - (uchar*) - &ft_query_expansion_limit); -static sys_var_const sys_ft_stopword_file(&vars, "ft_stopword_file", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) &ft_stopword_file); - -static sys_var_const sys_ignore_builtin_innodb(&vars, "ignore_builtin_innodb", - OPT_GLOBAL, SHOW_BOOL, - (uchar*) &opt_ignore_builtin_innodb); - -sys_var_str sys_init_connect(&vars, "init_connect", 0, - sys_update_init_connect, - sys_default_init_connect,0); -static sys_var_const sys_init_file(&vars, "init_file", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) &opt_init_file); -sys_var_str sys_init_slave(&vars, "init_slave", 0, - sys_update_init_slave, - sys_default_init_slave,0); -static sys_var_thd_ulong sys_interactive_timeout(&vars, "interactive_timeout", - &SV::net_interactive_timeout); -static sys_var_thd_ulong sys_join_buffer_size(&vars, "join_buffer_size", - &SV::join_buff_size); -static sys_var_key_buffer_size sys_key_buffer_size(&vars, "key_buffer_size"); -static sys_var_key_cache_long sys_key_cache_block_size(&vars, "key_cache_block_size", - offsetof(KEY_CACHE, - param_block_size)); -static sys_var_key_cache_long sys_key_cache_division_limit(&vars, "key_cache_division_limit", - offsetof(KEY_CACHE, - param_division_limit)); -static sys_var_key_cache_long sys_key_cache_age_threshold(&vars, "key_cache_age_threshold", - offsetof(KEY_CACHE, - param_age_threshold)); -static sys_var_const sys_large_files_support(&vars, "large_files_support", - OPT_GLOBAL, SHOW_BOOL, - (uchar*) &opt_large_files); -static sys_var_const sys_large_page_size(&vars, "large_page_size", - OPT_GLOBAL, SHOW_INT, - (uchar*) &opt_large_page_size); -static sys_var_const sys_large_pages(&vars, "large_pages", - OPT_GLOBAL, SHOW_MY_BOOL, - (uchar*) &opt_large_pages); -static sys_var_const sys_language(&vars, "lc_messages_dir", - OPT_GLOBAL, SHOW_CHAR, - (uchar*) lc_messages_dir); -static sys_var_bool_ptr sys_local_infile(&vars, "local_infile", - &opt_local_infile); -#ifdef HAVE_MLOCKALL -static sys_var_const sys_locked_in_memory(&vars, "locked_in_memory", - OPT_GLOBAL, SHOW_MY_BOOL, - (uchar*) &locked_in_memory); -#endif -static sys_var_const sys_log_bin(&vars, "log_bin", - OPT_GLOBAL, SHOW_BOOL, - (uchar*) &opt_bin_log); -static sys_var_bool_ptr -sys_trust_function_creators(&vars, "log_bin_trust_function_creators", - &trust_function_creators); -static sys_var_const sys_log_error(&vars, "log_error", - OPT_GLOBAL, SHOW_CHAR, - (uchar*) log_error_file); -static sys_var_bool_ptr - sys_log_queries_not_using_indexes(&vars, "log_queries_not_using_indexes", - &opt_log_queries_not_using_indexes); -static sys_var_thd_ulong sys_log_warnings(&vars, "log_warnings", &SV::log_warnings); -static sys_var_microseconds sys_var_long_query_time(&vars, "long_query_time", - &SV::long_query_time); -static sys_var_thd_bool sys_low_priority_updates(&vars, "low_priority_updates", - &SV::low_priority_updates, - fix_low_priority_updates); -#ifndef TO_BE_DELETED /* Alias for the low_priority_updates */ -static sys_var_thd_bool sys_sql_low_priority_updates(&vars, "sql_low_priority_updates", - &SV::low_priority_updates, - fix_low_priority_updates); -#endif -static sys_var_const sys_lower_case_file_system(&vars, - "lower_case_file_system", - OPT_GLOBAL, SHOW_MY_BOOL, - (uchar*) - &lower_case_file_system); -static sys_var_const sys_lower_case_table_names(&vars, - "lower_case_table_names", - OPT_GLOBAL, SHOW_INT, - (uchar*) - &lower_case_table_names); -static sys_var_thd_ulong_session_readonly sys_max_allowed_packet(&vars, "max_allowed_packet", - &SV::max_allowed_packet); -static sys_var_ulonglong_ptr sys_max_binlog_cache_size(&vars, "max_binlog_cache_size", - &max_binlog_cache_size); -static sys_var_long_ptr sys_max_binlog_size(&vars, "max_binlog_size", - &max_binlog_size, - fix_max_binlog_size); -static sys_var_long_ptr sys_max_connections(&vars, "max_connections", - &max_connections, - fix_max_connections); -static sys_var_long_ptr sys_max_connect_errors(&vars, "max_connect_errors", - &max_connect_errors); -static sys_var_thd_ulong sys_max_insert_delayed_threads(&vars, "max_insert_delayed_threads", - &SV::max_insert_delayed_threads, - check_max_delayed_threads, - fix_max_connections); -static sys_var_thd_ulong sys_max_delayed_threads(&vars, "max_delayed_threads", - &SV::max_insert_delayed_threads, - check_max_delayed_threads, - fix_max_connections); -static sys_var_thd_ulong sys_max_error_count(&vars, "max_error_count", - &SV::max_error_count); -static sys_var_thd_ulonglong sys_max_heap_table_size(&vars, "max_heap_table_size", - &SV::max_heap_table_size); -static sys_var_thd_ulong sys_pseudo_thread_id(&vars, "pseudo_thread_id", - &SV::pseudo_thread_id, - check_pseudo_thread_id, 0, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_thd_ha_rows sys_max_join_size(&vars, "max_join_size", - &SV::max_join_size, - fix_max_join_size); -static sys_var_thd_ulong sys_max_seeks_for_key(&vars, "max_seeks_for_key", - &SV::max_seeks_for_key); -static sys_var_thd_ulong sys_max_length_for_sort_data(&vars, "max_length_for_sort_data", - &SV::max_length_for_sort_data); -#ifndef TO_BE_DELETED /* Alias for max_join_size */ -static sys_var_thd_ha_rows sys_sql_max_join_size(&vars, "sql_max_join_size", - &SV::max_join_size, - fix_max_join_size); -#endif -static sys_var_long_ptr_global -sys_max_prepared_stmt_count(&vars, "max_prepared_stmt_count", - &max_prepared_stmt_count, - &LOCK_prepared_stmt_count); -static sys_var_long_ptr sys_max_relay_log_size(&vars, "max_relay_log_size", - &max_relay_log_size, - fix_max_relay_log_size); -static sys_var_thd_ulong sys_max_sort_length(&vars, "max_sort_length", - &SV::max_sort_length); -static sys_var_thd_ulong sys_max_sp_recursion_depth(&vars, "max_sp_recursion_depth", - &SV::max_sp_recursion_depth); -static sys_var_max_user_conn sys_max_user_connections(&vars, "max_user_connections"); -static sys_var_thd_ulong sys_max_tmp_tables(&vars, "max_tmp_tables", - &SV::max_tmp_tables); -static sys_var_long_ptr sys_max_write_lock_count(&vars, "max_write_lock_count", - &max_write_lock_count); -static sys_var_thd_ulong sys_min_examined_row_limit(&vars, "min_examined_row_limit", - &SV::min_examined_row_limit); -static sys_var_thd_ulong sys_multi_range_count(&vars, "multi_range_count", - &SV::multi_range_count); -static sys_var_long_ptr sys_myisam_data_pointer_size(&vars, "myisam_data_pointer_size", - &myisam_data_pointer_size); -static sys_var_thd_ulonglong sys_myisam_max_sort_file_size(&vars, "myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1); -static sys_var_const sys_myisam_recover_options(&vars, "myisam_recover_options", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) - &myisam_recover_options_str); -static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_threads", &SV::myisam_repair_threads); -static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size); -static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap", - &opt_myisam_use_mmap); - -static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method", - &SV::myisam_stats_method, - &myisam_stats_method_typelib, - NULL); - -#ifdef _WIN32 -/* purecov: begin inspected */ -static sys_var_const sys_named_pipe(&vars, "named_pipe", - OPT_GLOBAL, SHOW_MY_BOOL, - (uchar*) &opt_enable_named_pipe); -/* purecov: end */ -#endif -static sys_var_thd_ulong_session_readonly sys_net_buffer_length(&vars, "net_buffer_length", - &SV::net_buffer_length); -static sys_var_thd_ulong sys_net_read_timeout(&vars, "net_read_timeout", - &SV::net_read_timeout, - 0, fix_net_read_timeout); -static sys_var_thd_ulong sys_net_write_timeout(&vars, "net_write_timeout", - &SV::net_write_timeout, - 0, fix_net_write_timeout); -static sys_var_thd_ulong sys_net_retry_count(&vars, "net_retry_count", - &SV::net_retry_count, - 0, fix_net_retry_count); -static sys_var_thd_bool sys_new_mode(&vars, "new", &SV::new_mode); -static sys_var_bool_ptr_readonly sys_old_mode(&vars, "old", - &global_system_variables.old_mode); -/* these two cannot be static */ -sys_var_thd_bool sys_old_alter_table(&vars, "old_alter_table", - &SV::old_alter_table); -sys_var_thd_bool sys_old_passwords(&vars, "old_passwords", &SV::old_passwords); -static sys_var_const sys_open_files_limit(&vars, "open_files_limit", - OPT_GLOBAL, SHOW_LONG, - (uchar*) - &open_files_limit); -static sys_var_thd_ulong sys_optimizer_prune_level(&vars, "optimizer_prune_level", - &SV::optimizer_prune_level); -static sys_var_thd_ulong sys_optimizer_search_depth(&vars, "optimizer_search_depth", - &SV::optimizer_search_depth); -static sys_var_thd_optimizer_switch sys_optimizer_switch(&vars, "optimizer_switch", - &SV::optimizer_switch); -static sys_var_const sys_pid_file(&vars, "pid_file", - OPT_GLOBAL, SHOW_CHAR, - (uchar*) pidfile_name); -static sys_var_const_os sys_plugin_dir(&vars, "plugin_dir", - OPT_GLOBAL, SHOW_CHAR, - (uchar*) opt_plugin_dir); -static sys_var_const sys_port(&vars, "port", - OPT_GLOBAL, SHOW_INT, - (uchar*) &mysqld_port); -static sys_var_thd_ulong sys_preload_buff_size(&vars, "preload_buffer_size", - &SV::preload_buff_size); -static sys_var_const sys_protocol_version(&vars, "protocol_version", - OPT_GLOBAL, SHOW_INT, - (uchar*) - &protocol_version); -static sys_var_thd_ulong sys_read_buff_size(&vars, "read_buffer_size", - &SV::read_buff_size); -static sys_var_opt_readonly sys_readonly(&vars, "read_only", &opt_readonly); -static sys_var_thd_ulong sys_read_rnd_buff_size(&vars, "read_rnd_buffer_size", - &SV::read_rnd_buff_size); -static sys_var_thd_ulong sys_div_precincrement(&vars, "div_precision_increment", - &SV::div_precincrement); -static sys_var_long_ptr sys_rpl_recovery_rank(&vars, "rpl_recovery_rank", - &rpl_recovery_rank); - -static sys_var_thd_ulong sys_range_alloc_block_size(&vars, "range_alloc_block_size", - &SV::range_alloc_block_size); -static sys_var_thd_ulong sys_query_alloc_block_size(&vars, "query_alloc_block_size", - &SV::query_alloc_block_size, - 0, fix_thd_mem_root); -static sys_var_thd_ulong sys_query_prealloc_size(&vars, "query_prealloc_size", - &SV::query_prealloc_size, - 0, fix_thd_mem_root); -#ifdef HAVE_SMEM -/* purecov: begin tested */ -static sys_var_const sys_shared_memory(&vars, "shared_memory", - OPT_GLOBAL, SHOW_MY_BOOL, - (uchar*) - &opt_enable_shared_memory); -static sys_var_const sys_shared_memory_base_name(&vars, - "shared_memory_base_name", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) - &shared_memory_base_name); -/* purecov: end */ -#endif -static sys_var_const sys_skip_external_locking(&vars, - "skip_external_locking", - OPT_GLOBAL, SHOW_MY_BOOL, - (uchar*) - &my_disable_locking); -static sys_var_const sys_skip_networking(&vars, "skip_networking", - OPT_GLOBAL, SHOW_BOOL, - (uchar*) &opt_disable_networking); -static sys_var_const sys_skip_show_database(&vars, "skip_show_database", - OPT_GLOBAL, SHOW_BOOL, - (uchar*) &opt_skip_show_db); - -static sys_var_const sys_socket(&vars, "socket", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) &mysqld_unix_port); - -#ifdef HAVE_THR_SETCONCURRENCY -/* purecov: begin tested */ -static sys_var_const sys_thread_concurrency(&vars, "thread_concurrency", - OPT_GLOBAL, SHOW_LONG, - (uchar*) &concurrency); -/* purecov: end */ -#endif -static sys_var_const sys_thread_stack(&vars, "thread_stack", - OPT_GLOBAL, SHOW_LONG, - (uchar*) &my_thread_stack_size); -static sys_var_readonly_os sys_tmpdir(&vars, "tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir); -static sys_var_thd_ulong sys_trans_alloc_block_size(&vars, "transaction_alloc_block_size", - &SV::trans_alloc_block_size, - 0, fix_trans_mem_root); -static sys_var_thd_ulong sys_trans_prealloc_size(&vars, "transaction_prealloc_size", - &SV::trans_prealloc_size, - 0, fix_trans_mem_root); -sys_var_enum_const sys_thread_handling(&vars, "thread_handling", - &SV::thread_handling, - &thread_handling_typelib, - NULL); - -#ifdef HAVE_QUERY_CACHE -static sys_var_long_ptr sys_query_cache_size(&vars, "query_cache_size", - &query_cache_size, - fix_query_cache_size); -static sys_var_long_ptr sys_query_cache_limit(&vars, "query_cache_limit", - &query_cache.query_cache_limit); -static sys_var_long_ptr - sys_query_cache_min_res_unit(&vars, "query_cache_min_res_unit", - &query_cache_min_res_unit, - fix_query_cache_min_res_unit); -static int check_query_cache_type(THD *thd, set_var *var); -static sys_var_thd_enum sys_query_cache_type(&vars, "query_cache_type", - &SV::query_cache_type, - &query_cache_type_typelib, NULL, - check_query_cache_type); -static sys_var_thd_bool -sys_query_cache_wlock_invalidate(&vars, "query_cache_wlock_invalidate", - &SV::query_cache_wlock_invalidate); -#endif /* HAVE_QUERY_CACHE */ -static sys_var_bool_ptr sys_secure_auth(&vars, "secure_auth", &opt_secure_auth); -static sys_var_const_str_ptr sys_secure_file_priv(&vars, "secure_file_priv", - &opt_secure_file_priv); -static sys_var_long_ptr sys_server_id(&vars, "server_id", &server_id, fix_server_id); -static sys_var_bool_ptr sys_slave_compressed_protocol(&vars, "slave_compressed_protocol", - &opt_slave_compressed_protocol); -static sys_var_set_slave_mode slave_exec_mode(&vars, - "slave_exec_mode", - &slave_exec_mode_options, - &slave_exec_mode_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", - &SV::sortbuff_size); -/* - sql_mode should *not* have binlog_mode=SESSION_VARIABLE_IN_BINLOG: - even though it is written to the binlog, the slave ignores the - MODE_NO_DIR_IN_CREATE variable, so slave's value differs from - master's (see log_event.cc: Query_log_event::do_apply_event()). -*/ -static sys_var_thd_sql_mode sys_sql_mode(&vars, "sql_mode", - &SV::sql_mode); -#ifdef HAVE_OPENSSL -extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher, - *opt_ssl_key; -static sys_var_const_os_str_ptr sys_ssl_ca(&vars, "ssl_ca", &opt_ssl_ca); -static sys_var_const_os_str_ptr sys_ssl_capath(&vars, "ssl_capath", &opt_ssl_capath); -static sys_var_const_os_str_ptr sys_ssl_cert(&vars, "ssl_cert", &opt_ssl_cert); -static sys_var_const_os_str_ptr sys_ssl_cipher(&vars, "ssl_cipher", &opt_ssl_cipher); -static sys_var_const_os_str_ptr sys_ssl_key(&vars, "ssl_key", &opt_ssl_key); -#else -static sys_var_const_os_str sys_ssl_ca(&vars, "ssl_ca", NULL); -static sys_var_const_os_str sys_ssl_capath(&vars, "ssl_capath", NULL); -static sys_var_const_os_str sys_ssl_cert(&vars, "ssl_cert", NULL); -static sys_var_const_os_str sys_ssl_cipher(&vars, "ssl_cipher", NULL); -static sys_var_const_os_str sys_ssl_key(&vars, "ssl_key", NULL); -#endif -static sys_var_thd_enum -sys_updatable_views_with_limit(&vars, "updatable_views_with_limit", - &SV::updatable_views_with_limit, - &updatable_views_with_limit_typelib); - -static sys_var_thd_storage_engine sys_storage_engine(&vars, "storage_engine", - &SV::table_plugin); -static sys_var_bool_ptr sys_sync_frm(&vars, "sync_frm", &opt_sync_frm); -static sys_var_const_str sys_system_time_zone(&vars, "system_time_zone", - system_time_zone); -static sys_var_long_ptr sys_table_def_size(&vars, "table_definition_cache", - &table_def_size); -static sys_var_long_ptr sys_table_cache_size(&vars, "table_open_cache", - &table_cache_size); -static sys_var_long_ptr sys_table_lock_wait_timeout(&vars, "table_lock_wait_timeout", - &table_lock_wait_timeout); - -#if defined(ENABLED_DEBUG_SYNC) -/* Debug Sync Facility. Implemented in debug_sync.cc. */ -static sys_var_debug_sync sys_debug_sync(&vars, "debug_sync"); -#endif /* defined(ENABLED_DEBUG_SYNC) */ - -static sys_var_long_ptr sys_thread_cache_size(&vars, "thread_cache_size", - &thread_cache_size); -#if HAVE_POOL_OF_THREADS == 1 -sys_var_long_ptr sys_thread_pool_size(&vars, "thread_pool_size", - &thread_pool_size); -#endif -static sys_var_thd_enum sys_tx_isolation(&vars, "tx_isolation", - &SV::tx_isolation, - &tx_isolation_typelib, - fix_tx_isolation, - check_tx_isolation); -static sys_var_thd_ulonglong sys_tmp_table_size(&vars, "tmp_table_size", - &SV::tmp_table_size); -static sys_var_bool_ptr sys_timed_mutexes(&vars, "timed_mutexes", - &timed_mutexes); -static sys_var_const_str sys_version(&vars, "version", server_version); -static sys_var_const_str sys_version_comment(&vars, "version_comment", - MYSQL_COMPILATION_COMMENT); -static sys_var_const_str sys_version_compile_machine(&vars, "version_compile_machine", - MACHINE_TYPE); -static sys_var_const_str sys_version_compile_os(&vars, "version_compile_os", - SYSTEM_TYPE); -static sys_var_thd_ulong sys_net_wait_timeout(&vars, "wait_timeout", - &SV::net_wait_timeout); - -/* Condition pushdown to storage engine */ -static sys_var_thd_bool -sys_engine_condition_pushdown(&vars, "engine_condition_pushdown", - &SV::engine_condition_pushdown); - -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE -/* ndb thread specific variable settings */ -static sys_var_thd_ulong -sys_ndb_autoincrement_prefetch_sz(&vars, "ndb_autoincrement_prefetch_sz", - &SV::ndb_autoincrement_prefetch_sz); -static sys_var_thd_bool -sys_ndb_force_send(&vars, "ndb_force_send", &SV::ndb_force_send); -#ifdef HAVE_NDB_BINLOG -static sys_var_long_ptr -sys_ndb_report_thresh_binlog_epoch_slip(&vars, "ndb_report_thresh_binlog_epoch_slip", - &ndb_report_thresh_binlog_epoch_slip); -static sys_var_long_ptr -sys_ndb_report_thresh_binlog_mem_usage(&vars, "ndb_report_thresh_binlog_mem_usage", - &ndb_report_thresh_binlog_mem_usage); -#endif -static sys_var_thd_bool -sys_ndb_use_exact_count(&vars, "ndb_use_exact_count", &SV::ndb_use_exact_count); -static sys_var_thd_bool -sys_ndb_use_transactions(&vars, "ndb_use_transactions", &SV::ndb_use_transactions); -static sys_var_long_ptr -sys_ndb_cache_check_time(&vars, "ndb_cache_check_time", &ndb_cache_check_time); -static sys_var_const_str -sys_ndb_connectstring(&vars, "ndb_connectstring", opt_ndb_constrbuf); -static sys_var_thd_bool -sys_ndb_index_stat_enable(&vars, "ndb_index_stat_enable", - &SV::ndb_index_stat_enable); -static sys_var_thd_ulong -sys_ndb_index_stat_cache_entries(&vars, "ndb_index_stat_cache_entries", - &SV::ndb_index_stat_cache_entries); -static sys_var_thd_ulong -sys_ndb_index_stat_update_freq(&vars, "ndb_index_stat_update_freq", - &SV::ndb_index_stat_update_freq); -static sys_var_long_ptr -sys_ndb_extra_logging(&vars, "ndb_extra_logging", &ndb_extra_logging); -static sys_var_thd_bool -sys_ndb_use_copying_alter_table(&vars, "ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table); -#endif //WITH_NDBCLUSTER_STORAGE_ENGINE - -/* Time/date/datetime formats */ - -static sys_var_thd_date_time_format sys_time_format(&vars, "time_format", - &SV::time_format, - MYSQL_TIMESTAMP_TIME); -static sys_var_thd_date_time_format sys_date_format(&vars, "date_format", - &SV::date_format, - MYSQL_TIMESTAMP_DATE); -static sys_var_thd_date_time_format sys_datetime_format(&vars, "datetime_format", - &SV::datetime_format, - MYSQL_TIMESTAMP_DATETIME); - -/* Variables that are bits in THD */ - -sys_var_thd_bit sys_autocommit(&vars, "autocommit", 0, - set_option_autocommit, - OPTION_NOT_AUTOCOMMIT, - 1); -static sys_var_thd_bit sys_big_tables(&vars, "big_tables", 0, - set_option_bit, - OPTION_BIG_TABLES); -#ifndef TO_BE_DELETED /* Alias for big_tables */ -static sys_var_thd_bit sys_sql_big_tables(&vars, "sql_big_tables", 0, - set_option_bit, - OPTION_BIG_TABLES); -#endif -static sys_var_thd_bit sys_big_selects(&vars, "sql_big_selects", 0, - set_option_bit, - OPTION_BIG_SELECTS); -static sys_var_thd_bit sys_log_off(&vars, "sql_log_off", - check_log_update, - set_option_bit, - OPTION_LOG_OFF); -static sys_var_thd_bit sys_log_update(&vars, "sql_log_update", - check_log_update, - set_log_update, - OPTION_BIN_LOG); -static sys_var_thd_bit sys_log_binlog(&vars, "sql_log_bin", - check_log_update, - set_option_log_bin_bit, - OPTION_BIN_LOG); -static sys_var_thd_bit sys_sql_warnings(&vars, "sql_warnings", 0, - set_option_bit, - OPTION_WARNINGS); -static sys_var_thd_bit sys_sql_notes(&vars, "sql_notes", 0, - set_option_bit, - OPTION_SQL_NOTES); -static sys_var_thd_bit sys_auto_is_null(&vars, "sql_auto_is_null", 0, - set_option_bit, - OPTION_AUTO_IS_NULL, 0, - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_thd_bit sys_safe_updates(&vars, "sql_safe_updates", 0, - set_option_bit, - OPTION_SAFE_UPDATES); -static sys_var_thd_bit sys_buffer_results(&vars, "sql_buffer_result", 0, - set_option_bit, - OPTION_BUFFER_RESULT); -static sys_var_thd_bit sys_quote_show_create(&vars, "sql_quote_show_create", 0, - set_option_bit, - OPTION_QUOTE_SHOW_CREATE); -static sys_var_thd_bit sys_foreign_key_checks(&vars, "foreign_key_checks", 0, - set_option_bit, - OPTION_NO_FOREIGN_KEY_CHECKS, - 1, sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0, - set_option_bit, - OPTION_RELAXED_UNIQUE_CHECKS, - 1, - sys_var::SESSION_VARIABLE_IN_BINLOG); -#if defined(ENABLED_PROFILING) -static sys_var_thd_bit sys_profiling(&vars, "profiling", NULL, - set_option_bit, - ulonglong(OPTION_PROFILING)); -static sys_var_thd_ulong sys_profiling_history_size(&vars, "profiling_history_size", - &SV::profiling_history_size); -#endif - -/* Local state variables */ - -static sys_var_thd_ha_rows sys_select_limit(&vars, "sql_select_limit", - &SV::select_limit); -static sys_var_timestamp sys_timestamp(&vars, "timestamp", - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_last_insert_id -sys_last_insert_id(&vars, "last_insert_id", - sys_var::SESSION_VARIABLE_IN_BINLOG); -/* - identity is an alias for last_insert_id(), so that we are compatible - with Sybase -*/ -static sys_var_last_insert_id -sys_identity(&vars, "identity", sys_var::SESSION_VARIABLE_IN_BINLOG); - -static sys_var_thd_lc_messages -sys_lc_messages(&vars, "lc_messages", sys_var::NOT_IN_BINLOG); - -static sys_var_thd_lc_time_names -sys_lc_time_names(&vars, "lc_time_names", sys_var::SESSION_VARIABLE_IN_BINLOG); - -/* - insert_id should *not* be marked as written to the binlog (i.e., it - should *not* have binlog_status==SESSION_VARIABLE_IN_BINLOG), - because we want any statement that refers to insert_id explicitly to - be unsafe. (By "explicitly", we mean using @@session.insert_id, - whereas insert_id is used "implicitly" when NULL value is inserted - into an auto_increment column). - - We want statements referring explicitly to @@session.insert_id to be - unsafe, because insert_id is modified internally by the slave sql - thread when NULL values are inserted in an AUTO_INCREMENT column. - This modification interfers with the value of the - @@session.insert_id variable if @@session.insert_id is referred - explicitly by an insert statement (as is seen by executing "SET - @@session.insert_id=0; CREATE TABLE t (a INT, b INT KEY - AUTO_INCREMENT); INSERT INTO t(a) VALUES (@@session.insert_id);" in - statement-based logging mode: t will be different on master and - slave). -*/ -static sys_var_insert_id sys_insert_id(&vars, "insert_id"); -static sys_var_readonly sys_error_count(&vars, "error_count", - OPT_SESSION, - SHOW_LONG, - get_error_count); -static sys_var_readonly sys_warning_count(&vars, "warning_count", - OPT_SESSION, - SHOW_LONG, - get_warning_count); - -static sys_var_rand_seed1 sys_rand_seed1(&vars, "rand_seed1", - sys_var::SESSION_VARIABLE_IN_BINLOG); -static sys_var_rand_seed2 sys_rand_seed2(&vars, "rand_seed2", - sys_var::SESSION_VARIABLE_IN_BINLOG); - -static sys_var_thd_ulong sys_default_week_format(&vars, "default_week_format", - &SV::default_week_format); - -sys_var_thd_ulong sys_group_concat_max_len(&vars, "group_concat_max_len", - &SV::group_concat_max_len); - -sys_var_thd_time_zone sys_time_zone(&vars, "time_zone", - sys_var::SESSION_VARIABLE_IN_BINLOG); - -/* Global read-only variable containing hostname */ -static sys_var_const_str sys_hostname(&vars, "hostname", glob_hostname); - -#ifndef EMBEDDED_LIBRARY -static sys_var_const_str_ptr sys_repl_report_host(&vars, "report_host", &report_host); -static sys_var_const_str_ptr sys_repl_report_user(&vars, "report_user", &report_user); -static sys_var_const_str_ptr sys_repl_report_password(&vars, "report_password", &report_password); - -static uchar *slave_get_report_port(THD *thd) +static uchar *get_sys_var_length(const sys_var *var, size_t *length, + my_bool first) { - thd->sys_var_tmp.long_value= report_port; - return (uchar*) &thd->sys_var_tmp.long_value; + *length= var->name.length; + return (uchar*) var->name.str; } -static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_LONG, slave_get_report_port); +sys_var_chain all_sys_vars = { NULL, NULL }; -#endif +int sys_var_init(DYNAMIC_ARRAY *long_options) +{ + uint count= 0; + uint saved_elements= long_options->elements; -sys_var_thd_bool sys_keep_files_on_create(&vars, "keep_files_on_create", - &SV::keep_files_on_create); -/* Read only variables */ + DBUG_ENTER("sys_var_init"); -static sys_var_have_variable sys_have_compress(&vars, "have_compress", &have_compress); -static sys_var_have_variable sys_have_crypt(&vars, "have_crypt", &have_crypt); -static sys_var_have_plugin sys_have_csv(&vars, "have_csv", C_STRING_WITH_LEN("csv"), MYSQL_STORAGE_ENGINE_PLUGIN); -static sys_var_have_variable sys_have_dlopen(&vars, "have_dynamic_loading", &have_dlopen); -static sys_var_have_variable sys_have_geometry(&vars, "have_geometry", &have_geometry); -static sys_var_have_plugin sys_have_innodb(&vars, "have_innodb", C_STRING_WITH_LEN("innodb"), MYSQL_STORAGE_ENGINE_PLUGIN); -static sys_var_have_plugin sys_have_ndbcluster(&vars, "have_ndbcluster", C_STRING_WITH_LEN("ndbcluster"), MYSQL_STORAGE_ENGINE_PLUGIN); -static sys_var_have_variable sys_have_openssl(&vars, "have_openssl", &have_ssl); -static sys_var_have_variable sys_have_ssl(&vars, "have_ssl", &have_ssl); -static sys_var_have_plugin sys_have_partition_db(&vars, "have_partitioning", C_STRING_WITH_LEN("partition"), MYSQL_STORAGE_ENGINE_PLUGIN); -static sys_var_have_variable sys_have_profiling(&vars, "have_profiling", &have_profiling); -static sys_var_have_variable sys_have_query_cache(&vars, "have_query_cache", - &have_query_cache); -static sys_var_have_variable sys_have_rtree_keys(&vars, "have_rtree_keys", &have_rtree_keys); -static sys_var_have_variable sys_have_symlink(&vars, "have_symlink", &have_symlink); -/* Global read-only variable describing server license */ -static sys_var_const_str sys_license(&vars, "license", STRINGIFY_ARG(LICENSE)); -/* Global variables which enable|disable logging */ -static sys_var_log_state sys_var_general_log(&vars, "general_log", &opt_log, - QUERY_LOG_GENERAL); -/* Synonym of "general_log" for consistency with SHOW VARIABLES output */ -static sys_var_log_state sys_var_log(&vars, "log", &opt_log, - QUERY_LOG_GENERAL); -static sys_var_log_state sys_var_slow_query_log(&vars, "slow_query_log", &opt_slow_log, - QUERY_LOG_SLOW); -/* Synonym of "slow_query_log" for consistency with SHOW VARIABLES output */ -static sys_var_log_state sys_var_log_slow(&vars, "log_slow_queries", - &opt_slow_log, QUERY_LOG_SLOW); -sys_var_str sys_var_general_log_path(&vars, "general_log_file", sys_check_log_path, - sys_update_general_log_path, - sys_default_general_log_path, - opt_logname); -sys_var_str sys_var_slow_log_path(&vars, "slow_query_log_file", sys_check_log_path, - sys_update_slow_log_path, - sys_default_slow_log_path, - opt_slow_logname); -static sys_var_log_output sys_var_log_output_state(&vars, "log_output", &log_output_options, - &log_output_typelib, 0); -static sys_var_readonly sys_myisam_mmap_size(&vars, "myisam_mmap_size", - OPT_GLOBAL, - SHOW_LONGLONG, - get_myisam_mmap_size); + for (sys_var *var=all_sys_vars.first; var; var= var->next, count++) + if (var->register_option(long_options)) + goto error; + if (my_hash_init(&system_variable_hash, system_charset_info, 100, 0, + 0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE)) + goto error; + + if (mysql_add_sys_var_chain(all_sys_vars.first)) + goto error; + + DBUG_RETURN(0); + +error: + fprintf(stderr, "failed to initialize System variables"); + long_options->elements= saved_elements; + DBUG_RETURN(1); +} + +void sys_var_end() +{ + DBUG_ENTER("sys_var_end"); + + my_hash_free(&system_variable_hash); + + for (sys_var *var=all_sys_vars.first; var; var= var->next) + var->~sys_var(); + + DBUG_VOID_RETURN; +} + +/** + sys_var constructor + + @param chain variables are linked into chain for mysql_add_sys_var_chain() + @param name_arg the name of the variable. @sa my_option::name + @param comment shown in mysqld --help, @sa my_option::comment + @param flags_arg or'ed flag_enum values + @param off offset of the global variable value from the + &global_system_variables. + @param getopt_id -1 for no command-line option, otherwise @sa my_option::id + @param getopt_arg_type @sa my_option::arg_type + @param show_val_type_arg what value_ptr() returns for sql_show.cc + @param def_val default value, @sa my_option::def_value + @param lock mutex or rw_lock that protects the global variable + *in addition* to LOCK_global_system_variables. + @param binlog_status_enum @sa binlog_status_enum + @param on_check_func a function to be called at the end of sys_var::check, + put your additional checks here + @param on_update_func a function to be called at the end of sys_var::update, + any post-update activity should happen here + @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 +*/ +sys_var::sys_var(sys_var_chain *chain, const char *name_arg, + const char *comment, int flags_arg, ptrdiff_t off, + int getopt_id, 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) : + next(0), + binlog_status(binlog_status_arg), + flags(flags_arg), 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) +{ + name.str= name_arg; + name.length= strlen(name_arg); + DBUG_ASSERT(name.length <= NAME_CHAR_LEN); + + bzero(&option, sizeof(option)); + option.name= name_arg; + option.id= getopt_id; + option.comment= comment; + option.arg_type= getopt_arg_type; + option.value= (uchar **)global_var_ptr(); + option.def_value= def_val; + + deprecated.version= deprecated_version; + deprecated.substitute= substitute; + DBUG_ASSERT((deprecated_version != 0) || (substitute == 0)); + DBUG_ASSERT(deprecated_version % 100 == 0); + DBUG_ASSERT(!deprecated_version || MYSQL_VERSION_ID < deprecated_version); + + if (chain->last) + chain->last->next= this; + else + chain->first= this; + chain->last= this; +} + +bool sys_var::update(THD *thd, set_var *var) +{ + enum_var_type type= var->type; + if (type == OPT_GLOBAL || scope() == GLOBAL) + { + /* + Yes, both locks need to be taken before an update, just as + both are taken to get a value. If we'll take only 'guard' here, + then value_ptr() for strings won't be safe in SHOW VARIABLES anymore, + to make it safe we'll need value_ptr_unlock(). + */ + AutoWLock lock1(&PLock_global_system_variables); + AutoWLock lock2(guard); + return global_update(thd, var) || + (on_update && on_update(this, thd, OPT_GLOBAL)); + } + else + return session_update(thd, var) || + (on_update && on_update(this, thd, OPT_SESSION)); +} + +uchar *sys_var::session_value_ptr(THD *thd, LEX_STRING *base) +{ + return session_var_ptr(thd); +} + +uchar *sys_var::global_value_ptr(THD *thd, LEX_STRING *base) +{ + return global_var_ptr(); +} bool sys_var::check(THD *thd, set_var *var) { - var->save_result.ulonglong_value= var->value->val_int(); - return 0; -} - -bool sys_var_str::check(THD *thd, set_var *var) -{ - int res; - if (!check_func) - return 0; - - if ((res=(*check_func)(thd, var)) < 0) + do_deprecated_warning(thd); + if ((var->value && do_check(thd, var)) + || (on_check && on_check(this, thd, var))) { - ErrConvString err(&var->value->str_value); - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr()); - } - return res; -} - -/* - Functions to check and update variables -*/ - - -/* - Update variables 'init_connect, init_slave'. - - In case of 'DEFAULT' value - (for example: 'set GLOBAL init_connect=DEFAULT') - 'var' parameter is NULL pointer. -*/ - -bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex, - set_var *var) -{ - char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0); - uint new_length= (var ? var->value->str_value.length() : 0); - if (!old_value) - old_value= (char*) ""; - if (!(res= my_strndup(old_value, new_length, MYF(0)))) - return 1; - /* - Replace the old value in such a way that the any thread using - the value will work. - */ - rw_wrlock(var_mutex); - old_value= var_str->value; - var_str->value= res; - var_str->value_length= new_length; - var_str->is_os_charset= FALSE; - rw_unlock(var_mutex); - my_free(old_value, MYF(MY_ALLOW_ZERO_PTR)); - return 0; -} - - -static bool sys_update_init_connect(THD *thd, set_var *var) -{ - return update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, var); -} - - -static void sys_default_init_connect(THD* thd, enum_var_type type) -{ - update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0); -} - - -static bool sys_update_init_slave(THD *thd, set_var *var) -{ - return update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, var); -} - - -static void sys_default_init_slave(THD* thd, enum_var_type type) -{ - update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0); -} - -static int sys_check_ftb_syntax(THD *thd, set_var *var) -{ - if (thd->security_ctx->master_access & SUPER_ACL) - return (ft_boolean_check_syntax_string((uchar*) - var->value->str_value.c_ptr()) ? - -1 : 0); - else - { - my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); - return 1; - } -} - -static bool sys_update_ftb_syntax(THD *thd, set_var * var) -{ - strmake(ft_boolean_syntax, var->value->str_value.c_ptr(), - sizeof(ft_boolean_syntax)-1); - -#ifdef HAVE_QUERY_CACHE - query_cache.flush(); -#endif /* HAVE_QUERY_CACHE */ - - return 0; -} - -static void sys_default_ftb_syntax(THD *thd, enum_var_type type) -{ - strmake(ft_boolean_syntax, def_ft_boolean_syntax, - sizeof(ft_boolean_syntax)-1); -} - - -/** - If one sets the LOW_PRIORIY UPDATES flag, we also must change the - used lock type. -*/ - -static void fix_low_priority_updates(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - thr_upgraded_concurrent_insert_lock= - (global_system_variables.low_priority_updates ? - TL_WRITE_LOW_PRIORITY : TL_WRITE); - else - thd->update_lock_default= (thd->variables.low_priority_updates ? - TL_WRITE_LOW_PRIORITY : TL_WRITE); -} - - -static void -fix_myisam_max_sort_file_size(THD *thd, enum_var_type type) -{ - myisam_max_temp_length= - (my_off_t) global_system_variables.myisam_max_sort_file_size; -} - -/** - Set the OPTION_BIG_SELECTS flag if max_join_size == HA_POS_ERROR. -*/ - -static void fix_max_join_size(THD *thd, enum_var_type type) -{ - if (type != OPT_GLOBAL) - { - if (thd->variables.max_join_size == HA_POS_ERROR) - thd->options|= OPTION_BIG_SELECTS; - else - thd->options&= ~OPTION_BIG_SELECTS; - } -} - - -/** - Can't change the 'next' tx_isolation while we are already in - a transaction -*/ -static int check_tx_isolation(THD *thd, set_var *var) -{ - if (var->type == OPT_DEFAULT && (thd->server_status & SERVER_STATUS_IN_TRANS)) - { - my_error(ER_CANT_CHANGE_TX_ISOLATION, MYF(0)); - return 1; - } - return 0; -} - -/* - If one doesn't use the SESSION modifier, the isolation level - is only active for the next command. -*/ -static void fix_tx_isolation(THD *thd, enum_var_type type) -{ - if (type == OPT_SESSION) - thd->session_tx_isolation= ((enum_tx_isolation) - thd->variables.tx_isolation); -} - -static void fix_completion_type(THD *thd __attribute__((unused)), - enum_var_type type __attribute__((unused))) {} - -static int check_completion_type(THD *thd, set_var *var) -{ - longlong val= var->value->val_int(); - if (val < 0 || val > 2) - { - char buf[64]; - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, llstr(val, buf)); - return 1; - } - return 0; -} - - -/* - If we are changing the thread variable, we have to copy it to NET too -*/ - -#ifdef HAVE_REPLICATION -static void fix_net_read_timeout(THD *thd, enum_var_type type) -{ - if (type != OPT_GLOBAL) - my_net_set_read_timeout(&thd->net, thd->variables.net_read_timeout); -} - - -static void fix_net_write_timeout(THD *thd, enum_var_type type) -{ - if (type != OPT_GLOBAL) - my_net_set_write_timeout(&thd->net, thd->variables.net_write_timeout); -} - -static void fix_net_retry_count(THD *thd, enum_var_type type) -{ - if (type != OPT_GLOBAL) - thd->net.retry_count=thd->variables.net_retry_count; -} -#else /* HAVE_REPLICATION */ -static void fix_net_read_timeout(THD *thd __attribute__((unused)), - enum_var_type type __attribute__((unused))) -{} -static void fix_net_write_timeout(THD *thd __attribute__((unused)), - enum_var_type type __attribute__((unused))) -{} -static void fix_net_retry_count(THD *thd __attribute__((unused)), - enum_var_type type __attribute__((unused))) -{} -#endif /* HAVE_REPLICATION */ - -#ifdef HAVE_QUERY_CACHE -static void fix_query_cache_size(THD *thd, enum_var_type type) -{ - ulong new_cache_size= query_cache.resize(query_cache_size); - - /* - Note: query_cache_size is a global variable reflecting the - requested cache size. See also query_cache_size_arg - */ - - if (query_cache_size != new_cache_size) - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), - query_cache_size, new_cache_size); - - query_cache_size= new_cache_size; -} - - -/** - Trigger before query_cache_type variable is updated. - @param thd Thread handler - @param var Pointer to the new variable status - - @return Status code - @retval 1 Failure - @retval 0 Success -*/ - -static int check_query_cache_type(THD *thd, set_var *var) -{ - /* - Don't allow changes of the query_cache_type if the query cache - is disabled. - */ - if (query_cache.is_disabled()) - { - my_error(ER_QUERY_CACHE_DISABLED,MYF(0)); - return 1; - } - - return 0; -} - - -static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type) -{ - query_cache_min_res_unit= - query_cache.set_min_res_unit(query_cache_min_res_unit); -} -#endif - - -extern void fix_delay_key_write(THD *thd, enum_var_type type) -{ - switch ((enum_delay_key_write) delay_key_write_options) { - case DELAY_KEY_WRITE_NONE: - myisam_delay_key_write=0; - break; - case DELAY_KEY_WRITE_ON: - myisam_delay_key_write=1; - break; - case DELAY_KEY_WRITE_ALL: - myisam_delay_key_write=1; - ha_open_options|= HA_OPEN_DELAY_KEY_WRITE; - break; - } -} - -bool sys_var_set::update(THD *thd, set_var *var) -{ - *value= var->save_result.ulong_value; - return 0; -} - -uchar *sys_var_set::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - char buff[256]; - String tmp(buff, sizeof(buff), &my_charset_latin1); - ulong length; - ulong val= *value; - - tmp.length(0); - for (uint i= 0; val; val>>= 1, i++) - { - if (val & 1) + if (!thd->is_error()) { - tmp.append(enum_names->type_names[i], - enum_names->type_lengths[i]); - tmp.append(','); + char buff[STRING_BUFFER_USUAL_SIZE]; + String str(buff, sizeof(buff), system_charset_info), *res; + + if (!var->value) + { + str.set(STRING_WITH_LEN("DEFAULT"), &my_charset_latin1); + res= &str; + } + else if (!(res=var->value->val_str(&str))) + { + str.set(STRING_WITH_LEN("NULL"), &my_charset_latin1); + res= &str; + } + ErrConvString err(res); + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name.str, err.ptr()); } + return true; } - - if ((length= tmp.length())) - length--; - return (uchar*) thd->strmake(tmp.ptr(), length); + return false; } -void sys_var_set_slave_mode::set_default(THD *thd, enum_var_type type) +uchar *sys_var::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { - slave_exec_mode_options= 0; - bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT); -} - -bool sys_var_set_slave_mode::check(THD *thd, set_var *var) -{ - bool rc= sys_var_set::check(thd, var); - if (!rc && - bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_STRICT) == 1 && - bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_IDEMPOTENT) == 1) + if (type == OPT_GLOBAL || scope() == GLOBAL) { - rc= true; - my_error(ER_SLAVE_AMBIGOUS_EXEC_MODE, MYF(0), ""); + safe_mutex_assert_owner(&LOCK_global_system_variables); + AutoRLock lock(guard); + return global_value_ptr(thd, base); } - return rc; + else + return session_value_ptr(thd, base); } -bool sys_var_set_slave_mode::update(THD *thd, set_var *var) +bool sys_var::set_default(THD *thd, enum_var_type type) { - bool rc; - pthread_mutex_lock(&LOCK_global_system_variables); - rc= sys_var_set::update(thd, var); - pthread_mutex_unlock(&LOCK_global_system_variables); - return rc; + LEX_STRING empty={0,0}; + set_var var(type, 0, &empty, 0); + + if (type == OPT_GLOBAL || scope() == GLOBAL) + global_save_default(thd, &var); + else + session_save_default(thd, &var); + + return check(thd, &var) || update(thd, &var); } -void fix_slave_exec_mode(enum_var_type type) +void sys_var::do_deprecated_warning(THD *thd) { - DBUG_ENTER("fix_slave_exec_mode"); - compile_time_assert(sizeof(slave_exec_mode_options) * CHAR_BIT - > SLAVE_EXEC_MODE_LAST_BIT - 1); - if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 && - bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1) + if (deprecated.version) { - sql_print_error("Ambiguous slave modes combination." - " STRICT will be used"); - bit_do_clear(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT); + char buf1[NAME_CHAR_LEN + 3], buf2[10]; + strxnmov(buf1, sizeof(buf1)-1, "@@", name.str, 0); + my_snprintf(buf2, sizeof(buf2), "%d.%d", deprecated.version/100/100, + deprecated.version/100%100); + uint errmsg= deprecated.substitute + ? ER_WARN_DEPRECATED_SYNTAX_WITH_VER + : ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT; + if (thd) + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DEPRECATED_SYNTAX, ER(errmsg), + buf1, buf2, deprecated.substitute); + else + sql_print_warning(ER_DEFAULT(errmsg), buf1, buf2, deprecated.substitute); } - if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 0) - bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT); - DBUG_VOID_RETURN; } - -bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) { - /* - All variables that affect writing to binary log (either format or - turning logging on and off) use the same checking. We call the - superclass ::check function to assign the variable correctly, and - then check the value. - */ - bool result= sys_var_thd_enum::check(thd, var); - if (!result) - result= check_log_update(thd, var); - return result; -} - - -bool sys_var_thd_binlog_format::is_readonly() const -{ - /* - Under certain circumstances, the variable is read-only (unchangeable): - */ - THD *thd= current_thd; - /* - If RBR and open temporary tables, their CREATE TABLE may not be in the - binlog, so we can't toggle to SBR in this connection. - The test below will also prevent SET GLOBAL, well it was not easy to test - if global or not here. - And this test will also prevent switching from RBR to RBR (a no-op which - should not happen too often). - - If we don't have row-based replication compiled in, the variable - is always read-only. - */ - if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) && - thd->temporary_tables) - { - my_error(ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, MYF(0)); - return 1; - } - /* - if in a stored function/trigger, it's too late to change mode - */ - if (thd->in_sub_stmt) - { - my_error(ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0)); - return 1; - } - return sys_var_thd_enum::is_readonly(); -} - - -void fix_binlog_format_after_update(THD *thd, enum_var_type type) -{ - thd->reset_current_stmt_binlog_row_based(); -} - - -static void fix_max_binlog_size(THD *thd, enum_var_type type) -{ - DBUG_ENTER("fix_max_binlog_size"); - DBUG_PRINT("info",("max_binlog_size=%lu max_relay_log_size=%lu", - max_binlog_size, max_relay_log_size)); - mysql_bin_log.set_max_size(max_binlog_size); -#ifdef HAVE_REPLICATION - if (!max_relay_log_size) - active_mi->rli.relay_log.set_max_size(max_binlog_size); -#endif - DBUG_VOID_RETURN; -} - -static void fix_max_relay_log_size(THD *thd, enum_var_type type) -{ - DBUG_ENTER("fix_max_relay_log_size"); - DBUG_PRINT("info",("max_binlog_size=%lu max_relay_log_size=%lu", - max_binlog_size, max_relay_log_size)); -#ifdef HAVE_REPLICATION - active_mi->rli.relay_log.set_max_size(max_relay_log_size ? - max_relay_log_size: max_binlog_size); -#endif - DBUG_VOID_RETURN; -} - - -static int check_max_delayed_threads(THD *thd, set_var *var) -{ - longlong val= var->value->val_int(); - if (var->type != OPT_GLOBAL && val != 0 && - val != (longlong) global_system_variables.max_insert_delayed_threads) - { - char buf[64]; - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, llstr(val, buf)); - return 1; - } - return 0; -} - -static void fix_max_connections(THD *thd, enum_var_type type) -{ -#ifndef EMBEDDED_LIBRARY - resize_thr_alarm(max_connections + - global_system_variables.max_insert_delayed_threads + 10); -#endif -} - - -static void fix_thd_mem_root(THD *thd, enum_var_type type) -{ - if (type != OPT_GLOBAL) - reset_root_defaults(thd->mem_root, - thd->variables.query_alloc_block_size, - thd->variables.query_prealloc_size); -} - - -static void fix_trans_mem_root(THD *thd, enum_var_type type) -{ - if (type != OPT_GLOBAL) - reset_root_defaults(&thd->transaction.mem_root, - thd->variables.trans_alloc_block_size, - thd->variables.trans_prealloc_size); -} - - -static void fix_server_id(THD *thd, enum_var_type type) -{ - server_id_supplied = 1; - thd->server_id= server_id; -} - - /** Throw warning (error in STRICT mode) if value for variable needed bounding. - Only call from check(), not update(), because an error in update() would be - bad mojo. Plug-in interface also uses this. + Plug-in interface also uses this. - @param thd thread handle - @param fixed did we have to correct the value? (throw warn/err if so) - @param unsignd is value's type unsigned? - @param name variable's name - @param val variable's value + @param thd thread handle + @param name variable's name + @param fixed did we have to correct the value? (throw warn/err if so) + @param is_unsigned is value's type unsigned? + @param v variable's value - @retval TRUE on error, FALSE otherwise (warning or OK) + @retval true on error, false otherwise (warning or ok) */ -bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd, - const char *name, longlong val) +bool throw_bounds_warning(THD *thd, const char *name, + bool fixed, bool is_unsigned, longlong v) { - if (fixed) + if (fixed || (!is_unsigned && v < 0)) { char buf[22]; - if (unsignd) - ullstr((ulonglong) val, buf); + if (is_unsigned) + ullstr((ulonglong) v, buf); else - llstr(val, buf); + llstr(v, buf); if (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) { my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buf); - return TRUE; + return true; } - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_TRUNCATED_WRONG_VALUE, ER(ER_TRUNCATED_WRONG_VALUE), name, buf); } - return FALSE; + return false; } - -/** - check an unsigned user-supplied value for a systemvariable against bounds. - - TODO: This is a wrapper function to call clipping from within an update() - function. Calling bounds from within update() is fair game in theory, - but we can only send warnings from in there, not errors, and besides, - it violates our model of separating check from update phase. - To avoid breaking out of the server with an ASSERT() in strict mode, - we pretend we're not in strict mode when we go through here. Bug#43233 - was opened to remind us to replace this kludge with The Right Thing, - which of course is to do the check in the actual check phase, and then - throw an error or warning accordingly. - - @param thd thread handle - @param num the value to limit - @param option_limits the bounds-record, or NULL if none - */ -static void bound_unsigned(THD *thd, ulonglong *num, - const struct my_option *option_limits) +bool throw_bounds_warning(THD *thd, const char *name, bool fixed, double v) { - if (option_limits) + if (fixed) { - my_bool fixed = FALSE; - ulonglong unadjusted= *num; + char buf[64]; - *num= getopt_ull_limit_value(unadjusted, option_limits, &fixed); + snprintf(buf, sizeof(buf)-1, "%g", v); - if (fixed) + if (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) { - ulong ssm= thd->variables.sql_mode; - thd->variables.sql_mode&= ~MODE_STRICT_ALL_TABLES; - throw_bounds_warning(thd, fixed, TRUE, option_limits->name, unadjusted); - thd->variables.sql_mode= ssm; + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buf); + return true; } + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_TRUNCATED_WRONG_VALUE, + ER(ER_TRUNCATED_WRONG_VALUE), name, buf); } + return false; } - -/** - Get unsigned system-variable. - Negative value does not wrap around, but becomes zero. - Check user-supplied value for a systemvariable against bounds. - If we needed to adjust the value, throw a warning or error depending - on SQL-mode. - - @param thd thread handle - @param var the system-variable to get - @param user_max a limit given with --maximum-variable-name=... or 0 - @param var_type function will bound on systems where necessary. - - @retval TRUE on error, FALSE otherwise (warning or OK) - */ -static bool get_unsigned(THD *thd, set_var *var, ulonglong user_max, - ulong var_type) -{ - int warnings= 0; - ulonglong unadjusted; - const struct my_option *limits= var->var->option_limits; - struct my_option fallback; - - /* get_unsigned() */ - if (var->value->unsigned_flag) - var->save_result.ulonglong_value= (ulonglong) var->value->val_int(); - else - { - longlong v= var->value->val_int(); - var->save_result.ulonglong_value= (ulonglong) ((v < 0) ? 0 : v); - if (v < 0) - { - warnings++; - if (throw_bounds_warning(thd, TRUE, FALSE, var->var->name, v)) - return TRUE; /* warning was promoted to error, give up */ - } - } - - unadjusted= var->save_result.ulonglong_value; - - /* max, if any */ - - if ((user_max > 0) && (unadjusted > user_max)) - { - var->save_result.ulonglong_value= user_max; - - if ((warnings == 0) && throw_bounds_warning(thd, TRUE, TRUE, - var->var->name, - (longlong) unadjusted)) - return TRUE; - - warnings++; - } - - /* - if the sysvar doesn't have a proper bounds record but the check - function would like bounding to ULONG where its size differs from - that of ULONGLONG, we make up a bogus limits record here and let - the usual suspects handle the actual limiting. - */ - - if (!limits && var_type != GET_ULL) - { - bzero(&fallback, sizeof(fallback)); - fallback.var_type= var_type; - limits= &fallback; - } - - /* fix_unsigned() */ - if (limits) - { - my_bool fixed; - - var->save_result.ulonglong_value= getopt_ull_limit_value(var->save_result. - ulonglong_value, - limits, &fixed); - - if ((warnings == 0) && throw_bounds_warning(thd, fixed, TRUE, - var->var->name, - (longlong) unadjusted)) - return TRUE; - } - - return FALSE; -} - - -bool sys_var_uint_ptr::check(THD *thd, set_var *var) -{ - var->save_result.ulong_value= (ulong) var->value->val_uint(); - return 0; -} - -bool sys_var_uint_ptr::update(THD *thd, set_var *var) -{ - *value= (uint) var->save_result.ulong_value; - return 0; -} - -void sys_var_uint_ptr::set_default(THD *thd, enum_var_type type) -{ - *value= (uint) option_limits->def_value; -} - -sys_var_long_ptr:: -sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr_arg, - sys_after_update_func after_update_arg) - :sys_var_long_ptr_global(chain, name_arg, value_ptr_arg, - &LOCK_global_system_variables, after_update_arg) -{} - - -bool sys_var_long_ptr_global::check(THD *thd, set_var *var) -{ - return get_unsigned(thd, var, 0, GET_ULONG); -} - -bool sys_var_long_ptr_global::update(THD *thd, set_var *var) -{ - pthread_mutex_lock(guard); - *value= (ulong) var->save_result.ulonglong_value; - pthread_mutex_unlock(guard); - return 0; -} - - -void sys_var_long_ptr_global::set_default(THD *thd, enum_var_type type) -{ - my_bool not_used; - pthread_mutex_lock(guard); - *value= (ulong) getopt_ull_limit_value((ulong) option_limits->def_value, - option_limits, ¬_used); - pthread_mutex_unlock(guard); -} - - -bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var) -{ - ulonglong tmp= var->save_result.ulonglong_value; - pthread_mutex_lock(&LOCK_global_system_variables); - bound_unsigned(thd, &tmp, option_limits); - *value= (ulonglong) tmp; - pthread_mutex_unlock(&LOCK_global_system_variables); - return 0; -} - - -void sys_var_ulonglong_ptr::set_default(THD *thd, enum_var_type type) -{ - my_bool not_used; - pthread_mutex_lock(&LOCK_global_system_variables); - *value= getopt_ull_limit_value((ulonglong) option_limits->def_value, - option_limits, ¬_used); - pthread_mutex_unlock(&LOCK_global_system_variables); -} - - -bool sys_var_bool_ptr::update(THD *thd, set_var *var) -{ - *value= (my_bool) var->save_result.ulong_value; - return 0; -} - - -void sys_var_bool_ptr::set_default(THD *thd, enum_var_type type) -{ - *value= (my_bool) option_limits->def_value; -} - - -bool sys_var_enum::update(THD *thd, set_var *var) -{ - *value= (uint) var->save_result.ulong_value; - return 0; -} - - -uchar *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) -{ - return (uchar*) enum_names->type_names[*value]; -} - - -uchar *sys_var_enum_const::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - return (uchar*) enum_names->type_names[global_system_variables.*offset]; -} - -bool sys_var_thd_ulong::check(THD *thd, set_var *var) -{ - if (get_unsigned(thd, var, max_system_variables.*offset, GET_ULONG)) - return TRUE; - DBUG_ASSERT(var->save_result.ulonglong_value <= ULONG_MAX); - return ((check_func && (*check_func)(thd, var))); -} - -bool sys_var_thd_ulong::update(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - global_system_variables.*offset= (ulong) var->save_result.ulonglong_value; - else - thd->variables.*offset= (ulong) var->save_result.ulonglong_value; - - return 0; -} - - -void sys_var_thd_ulong::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - { - my_bool not_used; - /* We will not come here if option_limits is not set */ - global_system_variables.*offset= - (ulong) getopt_ull_limit_value((ulong) option_limits->def_value, - option_limits, ¬_used); - } - else - thd->variables.*offset= global_system_variables.*offset; -} - - -uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - if (type == OPT_GLOBAL) - return (uchar*) &(global_system_variables.*offset); - return (uchar*) &(thd->variables.*offset); -} - - -bool sys_var_thd_ha_rows::update(THD *thd, set_var *var) -{ - ulonglong tmp= var->save_result.ulonglong_value; - - /* Don't use bigger value than given with --maximum-variable-name=.. */ - if ((ha_rows) tmp > max_system_variables.*offset) - tmp= max_system_variables.*offset; - - bound_unsigned(thd, &tmp, option_limits); - - if (var->type == OPT_GLOBAL) - { - /* Lock is needed to make things safe on 32 bit systems */ - pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.*offset= (ha_rows) tmp; - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.*offset= (ha_rows) tmp; - return 0; -} - - -void sys_var_thd_ha_rows::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - { - my_bool not_used; - /* We will not come here if option_limits is not set */ - pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.*offset= - (ha_rows) getopt_ull_limit_value((ha_rows) option_limits->def_value, - option_limits, ¬_used); - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.*offset= global_system_variables.*offset; -} - - -uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - if (type == OPT_GLOBAL) - return (uchar*) &(global_system_variables.*offset); - return (uchar*) &(thd->variables.*offset); -} - -bool sys_var_thd_ulonglong::check(THD *thd, set_var *var) -{ - return get_unsigned(thd, var, max_system_variables.*offset, GET_ULL); -} - -bool sys_var_thd_ulonglong::update(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - { - /* Lock is needed to make things safe on 32 bit systems */ - pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.*offset= (ulonglong) - var->save_result.ulonglong_value; - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.*offset= (ulonglong) var->save_result.ulonglong_value; - return 0; -} - - -void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - { - my_bool not_used; - pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.*offset= - getopt_ull_limit_value((ulonglong) option_limits->def_value, - option_limits, ¬_used); - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.*offset= global_system_variables.*offset; -} - - -uchar *sys_var_thd_ulonglong::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - if (type == OPT_GLOBAL) - return (uchar*) &(global_system_variables.*offset); - return (uchar*) &(thd->variables.*offset); -} - - -bool sys_var_thd_bool::update(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - global_system_variables.*offset= (my_bool) var->save_result.ulong_value; - else - thd->variables.*offset= (my_bool) var->save_result.ulong_value; - return 0; -} - - -void sys_var_thd_bool::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.*offset= (my_bool) option_limits->def_value; - else - thd->variables.*offset= global_system_variables.*offset; -} - - -uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - if (type == OPT_GLOBAL) - return (uchar*) &(global_system_variables.*offset); - return (uchar*) &(thd->variables.*offset); -} - - -bool sys_var::check_enum(THD *thd, set_var *var, const TYPELIB *enum_names) -{ - char buff[STRING_BUFFER_USUAL_SIZE]; - const char *value; - String str(buff, sizeof(buff), system_charset_info), *res; - - if (var->value->result_type() == STRING_RESULT) - { - if (!(res=var->value->val_str(&str)) || - ((long) (var->save_result.ulong_value= - (ulong) find_type(enum_names, res->ptr(), - res->length(), FALSE) - 1)) < 0) - { - if (res) - { - ErrConvString err(res); - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr()); - return 1; - } - value= "NULL"; - goto err; - } - } - else - { - ulonglong tmp=var->value->val_int(); - if (tmp >= enum_names->count) - { - llstr(tmp,buff); - value=buff; // Wrong value is here - goto err; - } - var->save_result.ulong_value= (ulong) tmp; // Save for update - } - return 0; - -err: - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, value); - return 1; -} - - -bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names) -{ - bool not_used; - char buff[STRING_BUFFER_USUAL_SIZE], *error= 0; - uint error_len= 0; - String str(buff, sizeof(buff), system_charset_info), *res; - - if (var->value->result_type() == STRING_RESULT) - { - if (!(res= var->value->val_str(&str))) - { - strmov(buff, "NULL"); - goto err; - } - - if (!m_allow_empty_value && - res->length() == 0) - { - buff[0]= 0; - goto err; - } - - var->save_result.ulong_value= ((ulong) - find_set(enum_names, res->c_ptr(), - res->length(), - NULL, - &error, &error_len, - ¬_used)); - if (error_len) - { - ErrConvString err(error, error_len, res->charset()); - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr()); - return 1; - } - } - else - { - ulonglong tmp= var->value->val_int(); - - if (!m_allow_empty_value && - tmp == 0) - { - buff[0]= '0'; - buff[1]= 0; - goto err; - } - - /* - For when the enum is made to contain 64 elements, as 1ULL<<64 is - undefined, we guard with a "count<64" test. - */ - if (unlikely((tmp >= ((ULL(1)) << enum_names->count)) && - (enum_names->count < 64))) - { - llstr(tmp, buff); - goto err; - } - var->save_result.ulong_value= (ulong) tmp; // Save for update - } - return 0; - -err: - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buff); - return 1; -} - - CHARSET_INFO *sys_var::charset(THD *thd) { - return is_os_charset ? thd->variables.character_set_filesystem : + return is_os_charset ? thd->variables.character_set_filesystem : system_charset_info; } - -bool sys_var_thd_enum::update(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - global_system_variables.*offset= var->save_result.ulong_value; - else - thd->variables.*offset= var->save_result.ulong_value; - return 0; -} - - -void sys_var_thd_enum::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.*offset= (ulong) option_limits->def_value; - else - thd->variables.*offset= global_system_variables.*offset; -} - - -uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - ulong tmp= ((type == OPT_GLOBAL) ? - global_system_variables.*offset : - thd->variables.*offset); - return (uchar*) enum_names->type_names[tmp]; -} - -bool sys_var_thd_bit::check(THD *thd, set_var *var) -{ - return (check_enum(thd, var, &bool_typelib) || - (check_func && (*check_func)(thd, var))); -} - -bool sys_var_thd_bit::update(THD *thd, set_var *var) -{ - int res= (*update_func)(thd, var); - return res; -} - - -uchar *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - /* - If reverse is 0 (default) return 1 if bit is set. - If reverse is 1, return 0 if bit is set - */ - thd->sys_var_tmp.my_bool_value= ((thd->options & bit_flag) ? - !reverse : reverse); - return (uchar*) &thd->sys_var_tmp.my_bool_value; -} - - -/** Update a date_time format variable based on given value. */ - -void sys_var_thd_date_time_format::update2(THD *thd, enum_var_type type, - DATE_TIME_FORMAT *new_value) -{ - DATE_TIME_FORMAT *old; - DBUG_ENTER("sys_var_date_time_format::update2"); - DBUG_DUMP("positions", (uchar*) new_value->positions, - sizeof(new_value->positions)); - - if (type == OPT_GLOBAL) - { - pthread_mutex_lock(&LOCK_global_system_variables); - old= (global_system_variables.*offset); - (global_system_variables.*offset)= new_value; - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - { - old= (thd->variables.*offset); - (thd->variables.*offset)= new_value; - } - my_free((char*) old, MYF(MY_ALLOW_ZERO_PTR)); - DBUG_VOID_RETURN; -} - - -bool sys_var_thd_date_time_format::update(THD *thd, set_var *var) -{ - DATE_TIME_FORMAT *new_value; - /* We must make a copy of the last value to get it into normal memory */ - new_value= date_time_format_copy((THD*) 0, - var->save_result.date_time_format); - if (!new_value) - return 1; // Out of memory - update2(thd, var->type, new_value); // Can't fail - return 0; -} - - -bool sys_var_thd_date_time_format::check(THD *thd, set_var *var) -{ - char buff[STRING_BUFFER_USUAL_SIZE]; - String str(buff,sizeof(buff), system_charset_info), *res; - DATE_TIME_FORMAT *format; - - if (!(res=var->value->val_str(&str))) - res= &my_empty_string; - - if (!(format= date_time_format_make(date_time_type, - res->ptr(), res->length()))) - { - ErrConvString err(res); - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr()); - return 1; - } - - /* - We must copy result to thread space to not get a memory leak if - update is aborted - */ - var->save_result.date_time_format= date_time_format_copy(thd, format); - my_free((char*) format, MYF(0)); - return var->save_result.date_time_format == 0; -} - - -void sys_var_thd_date_time_format::set_default(THD *thd, enum_var_type type) -{ - DATE_TIME_FORMAT *res= 0; - - if (type == OPT_GLOBAL) - { - const char *format; - if ((format= opt_date_time_formats[date_time_type])) - res= date_time_format_make(date_time_type, format, strlen(format)); - } - else - { - /* Make copy with malloc */ - res= date_time_format_copy((THD *) 0, global_system_variables.*offset); - } - - if (res) // Should always be true - update2(thd, type, res); -} - - -uchar *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - if (type == OPT_GLOBAL) - { - char *res; - /* - We do a copy here just to be sure things will work even if someone - is modifying the original string while the copy is accessed - (Can't happen now in SQL SHOW, but this is a good safety for the future) - */ - res= thd->strmake((global_system_variables.*offset)->format.str, - (global_system_variables.*offset)->format.length); - return (uchar*) res; - } - return (uchar*) (thd->variables.*offset)->format.str; -} - - typedef struct old_names_map_st { const char *old_name; const char *new_name; } my_old_conv; -static my_old_conv old_conv[]= +static my_old_conv old_conv[]= { - { "cp1251_koi8" , "cp1251" }, - { "cp1250_latin2" , "cp1250" }, - { "kam_latin2" , "keybcs2" }, - { "mac_latin2" , "MacRoman" }, - { "macce_latin2" , "MacCE" }, - { "pc2_latin2" , "pclatin2" }, - { "vga_latin2" , "pclatin1" }, - { "koi8_cp1251" , "koi8r" }, - { "win1251ukr_koi8_ukr" , "win1251ukr" }, - { "koi8_ukr_win1251ukr" , "koi8u" }, - { NULL , NULL } + { "cp1251_koi8" , "cp1251" }, + { "cp1250_latin2" , "cp1250" }, + { "kam_latin2" , "keybcs2" }, + { "mac_latin2" , "MacRoman" }, + { "macce_latin2" , "MacCE" }, + { "pc2_latin2" , "pclatin2" }, + { "vga_latin2" , "pclatin1" }, + { "koi8_cp1251" , "koi8r" }, + { "win1251ukr_koi8_ukr" , "win1251ukr" }, + { "koi8_ukr_win1251ukr" , "koi8u" }, + { NULL , NULL } }; CHARSET_INFO *get_old_charset_by_name(const char *name) { my_old_conv *conv; - + for (conv= old_conv; conv->old_name; conv++) { if (!my_strcasecmp(&my_charset_latin1, name, conv->old_name)) @@ -2149,1169 +339,6 @@ CHARSET_INFO *get_old_charset_by_name(const char *name) return NULL; } - -bool sys_var_collation::check(THD *thd, set_var *var) -{ - CHARSET_INFO *tmp; - LINT_INIT(tmp); - - if (var->value->result_type() == STRING_RESULT) - { - char buff[STRING_BUFFER_USUAL_SIZE]; - String str(buff,sizeof(buff), system_charset_info), *res; - if (!(res=var->value->val_str(&str))) - { - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL"); - return 1; - } - if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0)))) - { - ErrConvString err(res); - my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr()); - return 1; - } - } - else // INT_RESULT - { - if (!(tmp=get_charset((int) var->value->val_int(),MYF(0)))) - { - char buf[20]; - int10_to_str((int) var->value->val_int(), buf, -10); - my_error(ER_UNKNOWN_COLLATION, MYF(0), buf); - return 1; - } - } - var->save_result.charset= tmp; // Save for update - return 0; -} - - -bool sys_var_character_set::check(THD *thd, set_var *var) -{ - CHARSET_INFO *tmp; - LINT_INIT(tmp); - - if (var->value->result_type() == STRING_RESULT) - { - char buff[STRING_BUFFER_USUAL_SIZE]; - String str(buff,sizeof(buff), system_charset_info), *res; - if (!(res=var->value->val_str(&str))) - { - if (!nullable) - { - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL"); - return 1; - } - tmp= NULL; - } - else if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))) && - !(tmp=get_old_charset_by_name(res->c_ptr()))) - { - ErrConvString err(res); - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr()); - return 1; - } - } - else // INT_RESULT - { - if (!(tmp=get_charset((int) var->value->val_int(),MYF(0)))) - { - char buf[20]; - int10_to_str((int) var->value->val_int(), buf, -10); - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), buf); - return 1; - } - } - var->save_result.charset= tmp; // Save for update - return 0; -} - - -bool sys_var_character_set::update(THD *thd, set_var *var) -{ - ci_ptr(thd,var->type)[0]= var->save_result.charset; - thd->update_charset(); - return 0; -} - - -uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - CHARSET_INFO *cs= ci_ptr(thd,type)[0]; - return cs ? (uchar*) cs->csname : (uchar*) NULL; -} - - -void sys_var_character_set_sv::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.*offset= *global_default; - else - { - thd->variables.*offset= global_system_variables.*offset; - thd->update_charset(); - } -} -CHARSET_INFO **sys_var_character_set_sv::ci_ptr(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - return &(global_system_variables.*offset); - else - return &(thd->variables.*offset); -} - - -bool sys_var_character_set_client::check(THD *thd, set_var *var) -{ - if (sys_var_character_set_sv::check(thd, var)) - return 1; - /* Currently, UCS-2 cannot be used as a client character set */ - if (var->save_result.charset->mbminlen > 1) - { - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, - var->save_result.charset->csname); - return 1; - } - return 0; -} - - -CHARSET_INFO ** sys_var_character_set_database::ci_ptr(THD *thd, - enum_var_type type) -{ - if (type == OPT_GLOBAL) - return &global_system_variables.collation_database; - else - return &thd->variables.collation_database; -} - - -void sys_var_character_set_database::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.collation_database= default_charset_info; - else - { - thd->variables.collation_database= thd->db_charset; - thd->update_charset(); - } -} - - -bool sys_var_collation_sv::update(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - global_system_variables.*offset= var->save_result.charset; - else - { - thd->variables.*offset= var->save_result.charset; - thd->update_charset(); - } - return 0; -} - - -void sys_var_collation_sv::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.*offset= *global_default; - else - { - thd->variables.*offset= global_system_variables.*offset; - thd->update_charset(); - } -} - - -uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - CHARSET_INFO *cs= ((type == OPT_GLOBAL) ? - global_system_variables.*offset : thd->variables.*offset); - return cs ? (uchar*) cs->name : (uchar*) "NULL"; -} - - -LEX_STRING default_key_cache_base= {(char *) "default", 7 }; - -static KEY_CACHE zero_key_cache; - -KEY_CACHE *get_key_cache(LEX_STRING *cache_name) -{ - safe_mutex_assert_owner(&LOCK_global_system_variables); - if (!cache_name || ! cache_name->length) - cache_name= &default_key_cache_base; - return ((KEY_CACHE*) find_named(&key_caches, - cache_name->str, cache_name->length, 0)); -} - - -uchar *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - KEY_CACHE *key_cache= get_key_cache(base); - if (!key_cache) - key_cache= &zero_key_cache; - return (uchar*) key_cache + offset ; -} - - -bool sys_var_key_buffer_size::update(THD *thd, set_var *var) -{ - ulonglong tmp= var->save_result.ulonglong_value; - LEX_STRING *base_name= &var->base; - KEY_CACHE *key_cache; - bool error= 0; - - /* If no basename, assume it's for the key cache named 'default' */ - if (!base_name->length) - base_name= &default_key_cache_base; - - pthread_mutex_lock(&LOCK_global_system_variables); - key_cache= get_key_cache(base_name); - - if (!key_cache) - { - /* Key cache didn't exists */ - if (!tmp) // Tried to delete cache - goto end; // Ok, nothing to do - if (!(key_cache= create_key_cache(base_name->str, base_name->length))) - { - error= 1; - goto end; - } - } - - /* - Abort if some other thread is changing the key cache - TODO: This should be changed so that we wait until the previous - assignment is done and then do the new assign - */ - if (key_cache->in_init) - goto end; - - if (!tmp) // Zero size means delete - { - if (key_cache == dflt_key_cache) - { - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, - ER(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE)); - goto end; // Ignore default key cache - } - - if (key_cache->key_cache_inited) // If initied - { - /* - Move tables using this key cache to the default key cache - and clear the old key cache. - */ - NAMED_LIST *list; - key_cache= (KEY_CACHE *) find_named(&key_caches, base_name->str, - base_name->length, &list); - key_cache->in_init= 1; - pthread_mutex_unlock(&LOCK_global_system_variables); - error= reassign_keycache_tables(thd, key_cache, dflt_key_cache); - pthread_mutex_lock(&LOCK_global_system_variables); - key_cache->in_init= 0; - } - /* - 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 - */ - goto end; - } - - bound_unsigned(thd, &tmp, option_limits); - key_cache->param_buff_size= (ulonglong) tmp; - - /* If key cache didn't exist initialize it, else resize it */ - key_cache->in_init= 1; - pthread_mutex_unlock(&LOCK_global_system_variables); - - if (!key_cache->key_cache_inited) - error= (bool) (ha_init_key_cache("", key_cache)); - else - error= (bool)(ha_resize_key_cache(key_cache)); - - pthread_mutex_lock(&LOCK_global_system_variables); - key_cache->in_init= 0; - -end: - pthread_mutex_unlock(&LOCK_global_system_variables); - return error; -} - - -/** - @todo - Abort if some other thread is changing the key cache. - This should be changed so that we wait until the previous - assignment is done and then do the new assign -*/ -bool sys_var_key_cache_long::update(THD *thd, set_var *var) -{ - ulonglong tmp= var->value->val_int(); - LEX_STRING *base_name= &var->base; - bool error= 0; - - if (!base_name->length) - base_name= &default_key_cache_base; - - pthread_mutex_lock(&LOCK_global_system_variables); - KEY_CACHE *key_cache= get_key_cache(base_name); - - if (!key_cache && !(key_cache= create_key_cache(base_name->str, - base_name->length))) - { - error= 1; - goto end; - } - - /* - Abort if some other thread is changing the key cache - TODO: This should be changed so that we wait until the previous - assignment is done and then do the new assign - */ - if (key_cache->in_init) - goto end; - - bound_unsigned(thd, &tmp, option_limits); - *((ulong*) (((char*) key_cache) + offset))= (ulong) tmp; - - /* - Don't create a new key cache if it didn't exist - (key_caches are created only when the user sets block_size) - */ - key_cache->in_init= 1; - - pthread_mutex_unlock(&LOCK_global_system_variables); - - error= (bool) (ha_resize_key_cache(key_cache)); - - pthread_mutex_lock(&LOCK_global_system_variables); - key_cache->in_init= 0; - -end: - pthread_mutex_unlock(&LOCK_global_system_variables); - return error; -} - - -bool sys_var_log_state::update(THD *thd, set_var *var) -{ - bool res; - - if (this == &sys_var_log) - WARN_DEPRECATED(thd, 7, 0, "@@log", "'@@general_log'"); - else if (this == &sys_var_log_slow) - WARN_DEPRECATED(thd, 7, 0, "@@log_slow_queries", "'@@slow_query_log'"); - - pthread_mutex_lock(&LOCK_global_system_variables); - if (!var->save_result.ulong_value) - { - logger.deactivate_log_handler(thd, log_type); - res= false; - } - else - res= logger.activate_log_handler(thd, log_type); - pthread_mutex_unlock(&LOCK_global_system_variables); - return res; -} - -void sys_var_log_state::set_default(THD *thd, enum_var_type type) -{ - if (this == &sys_var_log) - WARN_DEPRECATED(thd, 7, 0, "@@log", "'@@general_log'"); - else if (this == &sys_var_log_slow) - WARN_DEPRECATED(thd, 7, 0, "@@log_slow_queries", "'@@slow_query_log'"); - - pthread_mutex_lock(&LOCK_global_system_variables); - logger.deactivate_log_handler(thd, log_type); - pthread_mutex_unlock(&LOCK_global_system_variables); -} - - -static int sys_check_log_path(THD *thd, set_var *var) -{ - char path[FN_REFLEN], buff[FN_REFLEN]; - MY_STAT f_stat; - String str(buff, sizeof(buff), system_charset_info), *res; - const char *log_file_str; - size_t path_length; - - if (!(res= var->value->val_str(&str))) - goto err; - - log_file_str= res->c_ptr(); - bzero(&f_stat, sizeof(MY_STAT)); - - path_length= unpack_filename(path, log_file_str); - - if (!path_length) - { - /* File name is empty. */ - - goto err; - } - - if (my_stat(path, &f_stat, MYF(0))) - { - /* - A file system object exists. Check if argument is a file and we have - 'write' permission. - */ - - if (!MY_S_ISREG(f_stat.st_mode) || - !(f_stat.st_mode & MY_S_IWRITE)) - goto err; - - return 0; - } - - /* Get dirname of the file path. */ - (void) dirname_part(path, log_file_str, &path_length); - - /* Dirname is empty if file path is relative. */ - if (!path_length) - return 0; - - /* - Check if directory exists and we have permission to create file and - write to file. - */ - if (my_access(path, (F_OK|W_OK))) - goto err; - - return 0; - -err: - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, - res ? log_file_str : "NULL"); - return 1; -} - - -bool update_sys_var_str_path(THD *thd, sys_var_str *var_str, - set_var *var, const char *log_ext, - bool log_state, uint log_type) -{ - MYSQL_QUERY_LOG *file_log; - char buff[FN_REFLEN]; - char *res= 0, *old_value= 0; - bool result= 0; - uint str_length= 0; - - if (var) - { - String str(buff, sizeof(buff), system_charset_info), *newval; - - newval= var->value->val_str(&str); - old_value= newval->c_ptr_safe(); - str_length= strlen(old_value); - } - - - - switch (log_type) { - case QUERY_LOG_SLOW: - file_log= logger.get_slow_log_file_handler(); - break; - case QUERY_LOG_GENERAL: - file_log= logger.get_log_file_handler(); - break; - default: - assert(0); // Impossible - } - - if (!old_value) - { - old_value= make_default_log_name(buff, log_ext); - str_length= strlen(old_value); - } - if (!(res= my_strndup(old_value, str_length, MYF(MY_FAE+MY_WME)))) - { - result= 1; - goto err; - } - - pthread_mutex_lock(&LOCK_global_system_variables); - logger.lock_exclusive(); - - if (file_log && log_state) - file_log->close(0); - old_value= var_str->value; - var_str->value= res; - var_str->value_length= str_length; - my_free(old_value, MYF(MY_ALLOW_ZERO_PTR)); - if (file_log && log_state) - { - switch (log_type) { - case QUERY_LOG_SLOW: - file_log->open_slow_log(sys_var_slow_log_path.value); - break; - case QUERY_LOG_GENERAL: - file_log->open_query_log(sys_var_general_log_path.value); - break; - default: - DBUG_ASSERT(0); - } - } - - logger.unlock(); - pthread_mutex_unlock(&LOCK_global_system_variables); - -err: - return result; -} - - -static bool sys_update_general_log_path(THD *thd, set_var * var) -{ - return update_sys_var_str_path(thd, &sys_var_general_log_path, - var, ".log", opt_log, QUERY_LOG_GENERAL); -} - - -static void sys_default_general_log_path(THD *thd, enum_var_type type) -{ - (void) update_sys_var_str_path(thd, &sys_var_general_log_path, - 0, ".log", opt_log, QUERY_LOG_GENERAL); -} - - -static bool sys_update_slow_log_path(THD *thd, set_var * var) -{ - return update_sys_var_str_path(thd, &sys_var_slow_log_path, - var, "-slow.log", opt_slow_log, - QUERY_LOG_SLOW); -} - - -static void sys_default_slow_log_path(THD *thd, enum_var_type type) -{ - (void) update_sys_var_str_path(thd, &sys_var_slow_log_path, - 0, "-slow.log", opt_slow_log, - QUERY_LOG_SLOW); -} - - -bool sys_var_log_output::update(THD *thd, set_var *var) -{ - pthread_mutex_lock(&LOCK_global_system_variables); - logger.lock_exclusive(); - logger.init_slow_log(var->save_result.ulong_value); - logger.init_general_log(var->save_result.ulong_value); - *value= var->save_result.ulong_value; - logger.unlock(); - pthread_mutex_unlock(&LOCK_global_system_variables); - return 0; -} - - -void sys_var_log_output::set_default(THD *thd, enum_var_type type) -{ - pthread_mutex_lock(&LOCK_global_system_variables); - logger.lock_exclusive(); - logger.init_slow_log(LOG_FILE); - logger.init_general_log(LOG_FILE); - *value= LOG_FILE; - logger.unlock(); - pthread_mutex_unlock(&LOCK_global_system_variables); -} - - -uchar *sys_var_log_output::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - char buff[256]; - String tmp(buff, sizeof(buff), &my_charset_latin1); - ulong length; - ulong val= *value; - - tmp.length(0); - for (uint i= 0; val; val>>= 1, i++) - { - if (val & 1) - { - tmp.append(log_output_typelib.type_names[i], - log_output_typelib.type_lengths[i]); - tmp.append(','); - } - } - - if ((length= tmp.length())) - length--; - return (uchar*) thd->strmake(tmp.ptr(), length); -} - - -/***************************************************************************** - Functions to handle SET NAMES and SET CHARACTER SET -*****************************************************************************/ - -int set_var_collation_client::check(THD *thd) -{ - /* Currently, UCS-2 cannot be used as a client character set */ - if (character_set_client->mbminlen > 1) - { - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client", - character_set_client->csname); - return 1; - } - return 0; -} - -int set_var_collation_client::update(THD *thd) -{ - thd->variables.character_set_client= character_set_client; - thd->variables.character_set_results= character_set_results; - thd->variables.collation_connection= collation_connection; - thd->update_charset(); - thd->protocol_text.init(thd); - thd->protocol_binary.init(thd); - return 0; -} - -/****************************************************************************/ - -bool sys_var_timestamp::update(THD *thd, set_var *var) -{ - thd->set_time((time_t) var->save_result.ulonglong_value); - return 0; -} - - -void sys_var_timestamp::set_default(THD *thd, enum_var_type type) -{ - thd->user_time=0; -} - - -uchar *sys_var_timestamp::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - thd->sys_var_tmp.long_value= (long) thd->start_time; - return (uchar*) &thd->sys_var_tmp.long_value; -} - - -bool sys_var_last_insert_id::update(THD *thd, set_var *var) -{ - thd->first_successful_insert_id_in_prev_stmt= - var->save_result.ulonglong_value; - return 0; -} - - -uchar *sys_var_last_insert_id::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - /* - this tmp var makes it robust againt change of type of - read_first_successful_insert_id_in_prev_stmt(). - */ - thd->sys_var_tmp.ulonglong_value= - thd->read_first_successful_insert_id_in_prev_stmt(); - return (uchar*) &thd->sys_var_tmp.ulonglong_value; -} - - -bool sys_var_insert_id::update(THD *thd, set_var *var) -{ - thd->force_one_auto_inc_interval(var->save_result.ulonglong_value); - return 0; -} - - -uchar *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - thd->sys_var_tmp.ulonglong_value= - thd->auto_inc_intervals_forced.minimum(); - return (uchar*) &thd->sys_var_tmp.ulonglong_value; -} - - -bool sys_var_rand_seed1::update(THD *thd, set_var *var) -{ - thd->rand.seed1= (ulong) var->save_result.ulonglong_value; - return 0; -} - -bool sys_var_rand_seed2::update(THD *thd, set_var *var) -{ - thd->rand.seed2= (ulong) var->save_result.ulonglong_value; - return 0; -} - - -bool sys_var_thd_time_zone::check(THD *thd, set_var *var) -{ - char buff[MAX_TIME_ZONE_NAME_LENGTH]; - String str(buff, sizeof(buff), &my_charset_latin1); - String *res= var->value->val_str(&str); - - if (!(var->save_result.time_zone= my_tz_find(thd, res))) - { - my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), res ? res->c_ptr() : "NULL"); - return 1; - } - return 0; -} - - -bool sys_var_thd_time_zone::update(THD *thd, set_var *var) -{ - /* We are using Time_zone object found during check() phase. */ - if (var->type == OPT_GLOBAL) - { - pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.time_zone= var->save_result.time_zone; - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.time_zone= var->save_result.time_zone; - return 0; -} - - -uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - /* - We can use ptr() instead of c_ptr() here because String contaning - time zone name is guaranteed to be zero ended. - */ - if (type == OPT_GLOBAL) - return (uchar *)(global_system_variables.time_zone->get_name()->ptr()); - else - { - /* - This is an ugly fix for replication: we don't replicate properly queries - invoking system variables' values to update tables; but - CONVERT_TZ(,,@@session.time_zone) is so popular that we make it - replicable (i.e. we tell the binlog code to store the session - timezone). If it's the global value which was used we can't replicate - (binlog code stores session value only). - */ - thd->time_zone_used= 1; - return (uchar *)(thd->variables.time_zone->get_name()->ptr()); - } -} - - -void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type) -{ - pthread_mutex_lock(&LOCK_global_system_variables); - if (type == OPT_GLOBAL) - { - if (default_tz_name) - { - String str(default_tz_name, &my_charset_latin1); - /* - We are guaranteed to find this time zone since its existence - is checked during start-up. - */ - global_system_variables.time_zone= my_tz_find(thd, &str); - } - else - global_system_variables.time_zone= my_tz_SYSTEM; - } - else - thd->variables.time_zone= global_system_variables.time_zone; - pthread_mutex_unlock(&LOCK_global_system_variables); -} - - -bool sys_var_max_user_conn::check(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - return sys_var_thd::check(thd, var); - else - { - /* - Per-session values of max_user_connections can't be set directly. - May be we should have a separate error message for this? - */ - my_error(ER_GLOBAL_VARIABLE, MYF(0), name); - return TRUE; - } -} - -bool sys_var_max_user_conn::update(THD *thd, set_var *var) -{ - DBUG_ASSERT(var->type == OPT_GLOBAL); - pthread_mutex_lock(&LOCK_global_system_variables); - max_user_connections= (uint)var->save_result.ulonglong_value; - pthread_mutex_unlock(&LOCK_global_system_variables); - return 0; -} - - -void sys_var_max_user_conn::set_default(THD *thd, enum_var_type type) -{ - DBUG_ASSERT(type == OPT_GLOBAL); - pthread_mutex_lock(&LOCK_global_system_variables); - max_user_connections= (ulong) option_limits->def_value; - pthread_mutex_unlock(&LOCK_global_system_variables); -} - - -uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - if (type != OPT_GLOBAL && - thd->user_connect && thd->user_connect->user_resources.user_conn) - return (uchar*) &(thd->user_connect->user_resources.user_conn); - return (uchar*) &(max_user_connections); -} - - -bool sys_var_thd_ulong_session_readonly::check(THD *thd, set_var *var) -{ - if (var->type != OPT_GLOBAL) - { - my_error(ER_VARIABLE_IS_READONLY, MYF(0), "SESSION", name, "GLOBAL"); - return TRUE; - } - - return sys_var_thd_ulong::check(thd, var); -} - - -static MY_LOCALE *check_locale(THD *thd, const char *name, set_var *var) -{ - MY_LOCALE *locale_match; - - if (var->value->result_type() == INT_RESULT) - { - if (!(locale_match= my_locale_by_number((uint) var->value->val_int()))) - { - char buf[20]; - int10_to_str((int) var->value->val_int(), buf, -10); - my_printf_error(ER_UNKNOWN_LOCALE, ER(ER_UNKNOWN_LOCALE), MYF(0), buf); - return 0; - } - } - else // STRING_RESULT - { - char buff[6]; - String str(buff, sizeof(buff), system_charset_info), *res; - if (!(res=var->value->val_str(&str))) - { - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL"); - return 0; - } - const char *locale_str= res->c_ptr(); - if (!(locale_match= my_locale_by_name(locale_str))) - { - my_printf_error(ER_UNKNOWN_LOCALE, ER(ER_UNKNOWN_LOCALE), - MYF(0), locale_str); - return 0; - } - } - - return var->save_result.locale_value= locale_match; -} - - -bool sys_var_thd_lc::check(THD *thd, set_var *var) -{ - MY_LOCALE *locale_match; - - if (!(locale_match= check_locale(thd, name, var))) - return 1; - return 0; -} - - -bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - global_system_variables.lc_time_names= var->save_result.locale_value; - else - thd->variables.lc_time_names= var->save_result.locale_value; - return 0; -} - - -uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - return type == OPT_GLOBAL ? - (uchar *) global_system_variables.lc_time_names->name : - (uchar *) thd->variables.lc_time_names->name; -} - - -void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.lc_time_names= my_default_lc_time_names; - else - thd->variables.lc_time_names= global_system_variables.lc_time_names; -} - - -bool sys_var_thd_lc_messages::update(THD *thd, set_var *var) -{ - MY_LOCALE *locale= var->save_result.locale_value; - - if (!locale->errmsgs->errmsgs) - { - pthread_mutex_lock(&LOCK_error_messages); - if (!locale->errmsgs->errmsgs && - read_texts(ERRMSG_FILE, locale->errmsgs->language, - &locale->errmsgs->errmsgs, - ER_ERROR_LAST - ER_ERROR_FIRST + 1)) - { - 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); - return 0; - } - pthread_mutex_unlock(&LOCK_error_messages); - } - - if (var->type == OPT_GLOBAL) - global_system_variables.lc_messages= locale; - else - thd->variables.lc_messages= locale; - - return 0; -} - - -uchar *sys_var_thd_lc_messages::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - return type == OPT_GLOBAL ? - (uchar *) global_system_variables.lc_messages->name : - (uchar *) thd->variables.lc_messages->name; -} - - -void sys_var_thd_lc_messages::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.lc_messages= my_default_lc_messages; - else - thd->variables.lc_messages= global_system_variables.lc_messages; -} - - -/* - Handling of microseoncds given as seconds.part_seconds - - NOTES - The argument to long query time is in seconds in decimal - which is converted to ulonglong integer holding microseconds for storage. - This is used for handling long_query_time -*/ - -bool sys_var_microseconds::update(THD *thd, set_var *var) -{ - double num= var->value->val_real(); - longlong microseconds; - if (num > (double) option_limits->max_value) - num= (double) option_limits->max_value; - if (num < (double) option_limits->min_value) - num= (double) option_limits->min_value; - microseconds= (longlong) (num * 1000000.0 + 0.5); - if (var->type == OPT_GLOBAL) - { - pthread_mutex_lock(&LOCK_global_system_variables); - (global_system_variables.*offset)= microseconds; - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.*offset= microseconds; - return 0; -} - - -void sys_var_microseconds::set_default(THD *thd, enum_var_type type) -{ - longlong microseconds= (longlong) (option_limits->def_value * 1000000.0); - if (type == OPT_GLOBAL) - { - pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.*offset= microseconds; - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.*offset= microseconds; -} - - -uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ? - global_system_variables.*offset : - thd->variables.*offset) / 1000000.0; - return (uchar*) &thd->tmp_double_value; -} - - -/* - Functions to update thd->options bits -*/ - -static bool set_option_bit(THD *thd, set_var *var) -{ - sys_var_thd_bit *sys_var= ((sys_var_thd_bit*) var->var); - if ((var->save_result.ulong_value != 0) == sys_var->reverse) - thd->options&= ~sys_var->bit_flag; - else - thd->options|= sys_var->bit_flag; - return 0; -} - -/* - Functions to be only used to update thd->options OPTION_BIN_LOG bit -*/ -static bool set_option_log_bin_bit(THD *thd, set_var *var) -{ - set_option_bit(thd, var); - if (!thd->in_sub_stmt) - thd->sql_log_bin_toplevel= thd->options & OPTION_BIN_LOG; - return 0; -} - -static bool set_option_autocommit(THD *thd, set_var *var) -{ - /* The test is negative as the flag we use is NOT autocommit */ - - ulonglong org_options= thd->options; - - /* - If we are setting AUTOCOMMIT=1 and it was not already 1, then we - need to commit any outstanding transactions. - */ - if (var->save_result.ulong_value != 0 && - (thd->options & OPTION_NOT_AUTOCOMMIT) && - ha_commit(thd)) - return 1; - - if (var->save_result.ulong_value != 0) - thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag; - else - thd->options|= ((sys_var_thd_bit*) var->var)->bit_flag; - - if ((org_options ^ thd->options) & OPTION_NOT_AUTOCOMMIT) - { - if ((org_options & OPTION_NOT_AUTOCOMMIT)) - { - /* We changed to auto_commit mode */ - thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG); - thd->transaction.all.modified_non_trans_table= FALSE; - thd->server_status|= SERVER_STATUS_AUTOCOMMIT; - } - else - { - thd->transaction.all.modified_non_trans_table= FALSE; - thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT; - } - } - return 0; -} - -static int check_log_update(THD *thd, set_var *var) -{ -#ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!(thd->security_ctx->master_access & SUPER_ACL)) - { - my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); - return 1; - } -#endif - return 0; -} - -static bool set_log_update(THD *thd, set_var *var) -{ - /* - The update log is not supported anymore since 5.0. - See sql/mysqld.cc/, comments in function init_server_components() for an - explaination of the different warnings we send below - */ - - if (opt_sql_bin_update) - { - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_UPDATE_LOG_DEPRECATED_TRANSLATED, - ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED)); - } - else - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_UPDATE_LOG_DEPRECATED_IGNORED, - ER(ER_UPDATE_LOG_DEPRECATED_IGNORED)); - set_option_bit(thd, var); - return 0; -} - - -static int check_pseudo_thread_id(THD *thd, set_var *var) -{ - var->save_result.ulonglong_value= var->value->val_int(); -#ifndef NO_EMBEDDED_ACCESS_CHECKS - if (thd->security_ctx->master_access & SUPER_ACL) - return 0; - else - { - my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); - return 1; - } -#else - return 0; -#endif -} - -static uchar *get_warning_count(THD *thd) -{ - thd->sys_var_tmp.long_value= thd->warning_info->warn_count(); - return (uchar*) &thd->sys_var_tmp.long_value; -} - -static uchar *get_error_count(THD *thd) -{ - thd->sys_var_tmp.long_value= thd->warning_info->error_count(); - return (uchar*) &thd->sys_var_tmp.long_value; -} - - -/** - Get the tmpdir that was specified or chosen by default. - - This is necessary because if the user does not specify a temporary - directory via the command line, one is chosen based on the environment - or system defaults. But we can't just always use mysql_tmpdir, because - that is actually a call to my_tmpdir() which cycles among possible - temporary directories. - - @param thd thread handle - - @retval - ptr pointer to NUL-terminated string -*/ -static uchar *get_tmpdir(THD *thd) -{ - if (opt_mysql_tmpdir) - return (uchar *)opt_mysql_tmpdir; - return (uchar*)mysql_tmpdir; -} - -static uchar *get_myisam_mmap_size(THD *thd) -{ - return (uchar *)&myisam_mmap_size; -} - - /**************************************************************************** Main handling of variables: - Initialisation @@ -3320,77 +347,31 @@ static uchar *get_myisam_mmap_size(THD *thd) ****************************************************************************/ /** - Find variable name in option my_getopt structure used for - command line args. - - @param opt option structure array to search in - @param name variable name - - @retval - 0 Error - @retval - ptr pointer to option structure -*/ - -static struct my_option *find_option(struct my_option *opt, const char *name) -{ - uint length=strlen(name); - for (; opt->name; opt++) - { - if (!getopt_compare_strings(opt->name, name, length) && - !opt->name[length]) - { - /* - Only accept the option if one can set values through it. - If not, there is no default value or limits in the option. - */ - return (opt->value) ? opt : 0; - } - } - return 0; -} - - -/** - Return variable name and length for hashing of variables. -*/ - -static uchar *get_sys_var_length(const sys_var *var, size_t *length, - my_bool first) -{ - *length= var->name_length; - return (uchar*) var->name; -} - - -/* Add variables to the dynamic hash of system variables - - SYNOPSIS - mysql_add_sys_var_chain() - first Pointer to first system variable to add - long_opt (optional)command line arguments may be tied for limit checks. - - RETURN VALUES + + @param first Pointer to first system variable to add + + @retval 0 SUCCESS + @retval otherwise FAILURE */ -int mysql_add_sys_var_chain(sys_var *first, struct my_option *long_options) +int mysql_add_sys_var_chain(sys_var *first) { sys_var *var; - + /* A write lock should be held on LOCK_system_variables_hash */ - + for (var= first; var; var= var->next) { - var->name_length= strlen(var->name); /* this fails if there is a conflicting variable name. see HASH_UNIQUE */ if (my_hash_insert(&system_variable_hash, (uchar*) var)) + { + fprintf(stderr, "*** duplicate variable name '%s' ?\n", var->name.str); goto error; - if (long_options) - var->option_limits= find_option(long_options, var->name); + } } return 0; @@ -3399,53 +380,53 @@ error: my_hash_delete(&system_variable_hash, (uchar*) first); return 1; } - - + + /* Remove variables to the dynamic hash of system variables - + SYNOPSIS mysql_del_sys_var_chain() first Pointer to first system variable to remove - + RETURN VALUES 0 SUCCESS otherwise FAILURE */ - + int mysql_del_sys_var_chain(sys_var *first) { int result= 0; - + /* A write lock should be held on LOCK_system_variables_hash */ - + for (sys_var *var= first; var; var= var->next) result|= my_hash_delete(&system_variable_hash, (uchar*) var); return result; } - - + + static int show_cmp(SHOW_VAR *a, SHOW_VAR *b) { return strcmp(a->name, b->name); } - - -/* + + +/** Constructs an array of system variables for display to the user. - - SYNOPSIS - enumerate_sys_vars() - thd current thread - sorted If TRUE, the system variables should be sorted - - RETURN VALUES + + @param thd current thread + @param sorted If TRUE, the system variables should be sorted + @param type OPT_GLOBAL or OPT_SESSION for SHOW GLOBAL|SESSION VARIABLES + + @retval pointer Array of SHOW_VAR elements for display + @retval NULL FAILURE */ -SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted) +SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type) { int count= system_variable_hash.records, i; int size= sizeof(SHOW_VAR) * (count + 1); @@ -3458,7 +439,12 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted) for (i= 0; i < count; i++) { sys_var *var= (sys_var*) my_hash_element(&system_variable_hash, i); - show->name= var->name; + + // don't show session-only variables in SHOW GLOBAL VARIABLES + if (type == OPT_GLOBAL && var->check_type(type)) + continue; + + show->name= var->name.str; show->value= (char*) var; show->type= SHOW_SYS; show++; @@ -3466,79 +452,29 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted) /* sort into order */ if (sorted) - my_qsort(result, count, sizeof(SHOW_VAR), + my_qsort(result, show-result, sizeof(SHOW_VAR), (qsort_cmp) show_cmp); - + /* make last element empty */ bzero(show, sizeof(SHOW_VAR)); } return result; } - -/* - Initialize the system variables - - SYNOPSIS - set_var_init() - - RETURN VALUES - 0 SUCCESS - otherwise FAILURE -*/ - -int set_var_init() -{ - uint count= 0; - DBUG_ENTER("set_var_init"); - - for (sys_var *var=vars.first; var; var= var->next, count++) ; - - if (my_hash_init(&system_variable_hash, system_charset_info, count, 0, - 0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE)) - goto error; - - vars.last->next= NULL; - if (mysql_add_sys_var_chain(vars.first, my_long_options)) - goto error; - - /* - Special cases - Needed because MySQL can't find the limits for a variable it it has - a different name than the command line option. - As these variables are deprecated, this code will disappear soon... - */ - sys_sql_max_join_size.option_limits= sys_max_join_size.option_limits; - - DBUG_RETURN(0); - -error: - fprintf(stderr, "failed to initialize system variables"); - DBUG_RETURN(1); -} - - -void set_var_free() -{ - my_hash_free(&system_variable_hash); -} - - /** Find a user set-table variable. - @param str Name of system variable to find + @param str Name of system variable to find @param length Length of variable. zero means that we should use strlen() on the variable - @param no_error Refuse to emit an error, even if one occurred. @retval - pointer pointer to variable definitions + pointer pointer to variable definitions @retval - 0 Unknown variable (error message is given) + 0 Unknown variable (error message is given) */ -sys_var *intern_find_sys_var(const char *str, uint length, bool no_error) +sys_var *intern_find_sys_var(const char *str, uint length) { sys_var *var; @@ -3547,10 +483,7 @@ sys_var *intern_find_sys_var(const char *str, uint length, bool no_error) A lock on LOCK_system_variable_hash should be held */ var= (sys_var*) my_hash_search(&system_variable_hash, - (uchar*) str, length ? length : strlen(str)); - if (!(var || no_error)) - my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str); - + (uchar*) str, length ? length : strlen(str)); return var; } @@ -3564,13 +497,13 @@ sys_var *intern_find_sys_var(const char *str, uint length, bool no_error) This should ensure that in all normal cases none all or variables are updated. - @param THD Thread id + @param THD Thread id @param var_list List of variables to update @retval - 0 ok + 0 ok @retval - 1 ERROR, message sent (normally no variables was updated) + 1 ERROR, message sent (normally no variables was updated) @retval -1 ERROR, message not sent */ @@ -3599,36 +532,6 @@ err: DBUG_RETURN(error); } - -/** - Say if all variables set by a SET support the ONE_SHOT keyword - (currently, only character set and collation do; later timezones - will). - - @param var_list List of variables to update - - @note - It has a "not_" because it makes faster tests (no need to "!") - - @retval - 0 all variables of the list support ONE_SHOT - @retval - 1 at least one does not support ONE_SHOT -*/ - -bool not_all_support_one_shot(List *var_list) -{ - List_iterator_fast it(*var_list); - set_var_base *var; - while ((var= it++)) - { - if (var->no_support_one_shot()) - return 1; - } - return 0; -} - - /***************************************************************************** Functions to handle SET mysql_internal_variable=const_expr *****************************************************************************/ @@ -3639,42 +542,35 @@ bool not_all_support_one_shot(List *var_list) @param thd Thread handler @return status code - @retval -1 Failure - @retval 0 Success -*/ + @retval -1 Failure + @retval 0 Success + */ int set_var::check(THD *thd) { if (var->is_readonly()) { - my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name, "read only"); + my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name.str, "read only"); return -1; } if (var->check_type(type)) { int err= type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE; - my_error(err, MYF(0), var->name); + my_error(err, MYF(0), var->name.str); return -1; } if ((type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL))) return 1; /* value is a NULL pointer if we are using SET ... = DEFAULT */ if (!value) - { - if (var->check_default(type)) - { - my_error(ER_NO_DEFAULT, MYF(0), var->name); - return -1; - } return 0; - } if ((!value->fixed && value->fix_fields(thd, &value)) || value->check_cols(1)) return -1; if (var->check_update_type(value->result_type())) { - my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), var->name); + my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), var->name.str); return -1; } return var->check(thd, this) ? -1 : 0; @@ -3684,12 +580,12 @@ int set_var::check(THD *thd) /** Check variable, but without assigning value (used by PS). - @param thd thread handler + @param thd thread handler @retval - 0 ok + 0 ok @retval - 1 ERROR, message sent (normally no variables was updated) + 1 ERROR, message sent (normally no variables was updated) @retval -1 ERROR, message not sent */ @@ -3714,7 +610,7 @@ int set_var::light_check(THD *thd) Update variable @param thd thread handler - @returns 0|1 ok or ERROR + @returns 0|1 ok or ERROR @note ERROR can be only due to abnormal operations involving the server's execution evironment such as @@ -3724,13 +620,7 @@ int set_var::light_check(THD *thd) */ int set_var::update(THD *thd) { - if (!value) - var->set_default(thd, type); - else if (var->update(thd, this)) - return -1; // should never happen - if (var->after_update) - (*var->after_update)(thd, type); - return 0; + return value ? var->update(thd, this) : var->set_default(thd, type); } @@ -3745,19 +635,19 @@ int set_var_user::check(THD *thd) 0 can be passed as last argument (reference on item) */ return (user_var_item->fix_fields(thd, (Item**) 0) || - user_var_item->check(0)) ? -1 : 0; + user_var_item->check(0)) ? -1 : 0; } /** Check variable, but without assigning value (used by PS). - @param thd thread handler + @param thd thread handler @retval - 0 ok + 0 ok @retval - 1 ERROR, message sent (normally no variables was updated) + 1 ERROR, message sent (normally no variables was updated) @retval -1 ERROR, message not sent */ @@ -3823,583 +713,36 @@ int set_var_password::update(THD *thd) #ifndef NO_EMBEDDED_ACCESS_CHECKS /* Returns 1 as the function sends error to client */ return change_password(thd, user->host.str, user->user.str, password) ? - 1 : 0; + 1 : 0; #else return 0; #endif } -/**************************************************************************** - Functions to handle table_type -****************************************************************************/ +/***************************************************************************** + Functions to handle SET NAMES and SET CHARACTER SET +*****************************************************************************/ -/* Based upon sys_var::check_enum() */ - -bool sys_var_thd_storage_engine::check(THD *thd, set_var *var) +int set_var_collation_client::check(THD *thd) { - char buff[STRING_BUFFER_USUAL_SIZE]; - const char *value; - String str(buff, sizeof(buff), &my_charset_latin1), *res; - - var->save_result.plugin= NULL; - if (var->value->result_type() == STRING_RESULT) + /* Currently, UCS-2 cannot be used as a client character set */ + if (character_set_client->mbminlen > 1) { - LEX_STRING engine_name; - handlerton *hton; - if (!(res=var->value->val_str(&str)) || - !(engine_name.str= (char *)res->ptr()) || - !(engine_name.length= res->length()) || - !(var->save_result.plugin= ha_resolve_by_name(thd, &engine_name)) || - !(hton= plugin_data(var->save_result.plugin, handlerton *)) || - ha_checktype(thd, ha_legacy_type(hton), 1, 0) != hton) - { - value= res ? res->c_ptr() : "NULL"; - goto err; - } - return 0; - } - value= "unknown"; - -err: - my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), value); - return 1; -} - - -uchar *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - uchar* result; - handlerton *hton; - LEX_STRING *engine_name; - plugin_ref plugin= thd->variables.*offset; - if (type == OPT_GLOBAL) - plugin= my_plugin_lock(thd, &(global_system_variables.*offset)); - hton= plugin_data(plugin, handlerton*); - engine_name= &hton2plugin[hton->slot]->name; - result= (uchar *) thd->strmake(engine_name->str, engine_name->length); - if (type == OPT_GLOBAL) - plugin_unlock(thd, plugin); - return result; -} - - -void sys_var_thd_storage_engine::set_default(THD *thd, enum_var_type type) -{ - plugin_ref old_value, new_value, *value; - if (type == OPT_GLOBAL) - { - value= &(global_system_variables.*offset); - new_value= ha_lock_engine(NULL, myisam_hton); - } - else - { - value= &(thd->variables.*offset); - new_value= my_plugin_lock(NULL, &(global_system_variables.*offset)); - } - DBUG_ASSERT(new_value); - old_value= *value; - *value= new_value; - plugin_unlock(NULL, old_value); -} - - -bool sys_var_thd_storage_engine::update(THD *thd, set_var *var) -{ - plugin_ref *value= &(global_system_variables.*offset), old_value; - if (var->type != OPT_GLOBAL) - value= &(thd->variables.*offset); - old_value= *value; - if (old_value != var->save_result.plugin) - { - *value= my_plugin_lock(NULL, &var->save_result.plugin); - plugin_unlock(NULL, old_value); + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client", + character_set_client->csname); + return 1; } return 0; } -/**************************************************************************** - Functions to handle sql_mode -****************************************************************************/ - -/** - Make string representation of mode. - - @param[in] thd thread handler - @param[in] val sql_mode value - @param[out] len pointer on length of string - - @return - pointer to string with sql_mode representation -*/ - -bool -sys_var_thd_sql_mode:: -symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep) +int set_var_collation_client::update(THD *thd) { - char buff[STRING_BUFFER_USUAL_SIZE*8]; - String tmp(buff, sizeof(buff), &my_charset_latin1); - - tmp.length(0); - - for (uint i= 0; val; val>>= 1, i++) - { - if (val & 1) - { - tmp.append(sql_mode_typelib.type_names[i], - sql_mode_typelib.type_lengths[i]); - tmp.append(','); - } - } - - if (tmp.length()) - tmp.length(tmp.length() - 1); /* trim the trailing comma */ - - rep->str= thd->strmake(tmp.ptr(), tmp.length()); - - rep->length= rep->str ? tmp.length() : 0; - - return rep->length != tmp.length(); -} - - -uchar *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - LEX_STRING sql_mode; - ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : - thd->variables.*offset); - (void) symbolic_mode_representation(thd, val, &sql_mode); - return (uchar *) sql_mode.str; -} - - -void sys_var_thd_sql_mode::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.*offset= 0; - else - thd->variables.*offset= global_system_variables.*offset; -} - - -void fix_sql_mode_var(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.sql_mode= - fix_sql_mode(global_system_variables.sql_mode); - else - { - thd->variables.sql_mode= fix_sql_mode(thd->variables.sql_mode); - /* - Update thd->server_status - */ - if (thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) - thd->server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; - else - thd->server_status&= ~SERVER_STATUS_NO_BACKSLASH_ESCAPES; - } -} - -/** Map database specific bits to function bits. */ - -ulong fix_sql_mode(ulong sql_mode) -{ - /* - Note that we dont set - MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | MODE_NO_FIELD_OPTIONS - to allow one to get full use of MySQL in this mode. - */ - - if (sql_mode & MODE_ANSI) - { - sql_mode|= (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | - MODE_IGNORE_SPACE); - /* - MODE_ONLY_FULL_GROUP_BY removed from ANSI mode because it is currently - overly restrictive (see BUG#8510). - */ - } - if (sql_mode & MODE_ORACLE) - sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | - MODE_IGNORE_SPACE | - MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | - MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER); - if (sql_mode & MODE_MSSQL) - sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | - MODE_IGNORE_SPACE | - MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | - MODE_NO_FIELD_OPTIONS); - if (sql_mode & MODE_POSTGRESQL) - sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | - MODE_IGNORE_SPACE | - MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | - MODE_NO_FIELD_OPTIONS); - if (sql_mode & MODE_DB2) - sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | - MODE_IGNORE_SPACE | - MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | - MODE_NO_FIELD_OPTIONS); - if (sql_mode & MODE_MAXDB) - sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | - MODE_IGNORE_SPACE | - MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | - MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER); - if (sql_mode & MODE_MYSQL40) - sql_mode|= MODE_HIGH_NOT_PRECEDENCE; - if (sql_mode & MODE_MYSQL323) - sql_mode|= MODE_HIGH_NOT_PRECEDENCE; - if (sql_mode & MODE_TRADITIONAL) - sql_mode|= (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES | - MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | - MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER | - MODE_NO_ENGINE_SUBSTITUTION); - return sql_mode; -} - - -bool -sys_var_thd_optimizer_switch:: -symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep) -{ - char buff[STRING_BUFFER_USUAL_SIZE*8]; - String tmp(buff, sizeof(buff), &my_charset_latin1); - int i; - ulonglong bit; - tmp.length(0); - - for (i= 0, bit=1; bit != OPTIMIZER_SWITCH_LAST; i++, bit= bit << 1) - { - tmp.append(optimizer_switch_typelib.type_names[i], - optimizer_switch_typelib.type_lengths[i]); - tmp.append('='); - tmp.append((val & bit)? "on":"off"); - tmp.append(','); - } - - if (tmp.length()) - tmp.length(tmp.length() - 1); /* trim the trailing comma */ - - rep->str= thd->strmake(tmp.ptr(), tmp.length()); - - rep->length= rep->str ? tmp.length() : 0; - - return rep->length != tmp.length(); -} - - -uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - LEX_STRING opts; - ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : - thd->variables.*offset); - (void) symbolic_mode_representation(thd, val, &opts); - return (uchar *) opts.str; -} - - -/* - Check (and actually parse) string representation of @@optimizer_switch. -*/ - -bool sys_var_thd_optimizer_switch::check(THD *thd, set_var *var) -{ - bool not_used; - char buff[STRING_BUFFER_USUAL_SIZE], *error= 0; - uint error_len= 0; - String str(buff, sizeof(buff), system_charset_info), *res; - - if (!(res= var->value->val_str(&str))) - { - strmov(buff, "NULL"); - goto err; - } - - if (res->length() == 0) - { - buff[0]= 0; - goto err; - } - - var->save_result.ulong_value= - (ulong)find_set_from_flags(&optimizer_switch_typelib, - optimizer_switch_typelib.count, - thd->variables.optimizer_switch, - global_system_variables.optimizer_switch, - res->c_ptr_safe(), res->length(), NULL, - &error, &error_len, ¬_used); - if (error_len) - { - ErrConvString err(error, error_len, res->charset()); - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, err.ptr()); - return TRUE; - } - return FALSE; -err: - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buff); - return TRUE; -} - - -void sys_var_thd_optimizer_switch::set_default(THD *thd, enum_var_type type) -{ - if (type == OPT_GLOBAL) - global_system_variables.*offset= OPTIMIZER_SWITCH_DEFAULT; - else - thd->variables.*offset= global_system_variables.*offset; -} - -/**************************************************************************** - Named list handling -****************************************************************************/ - -uchar* find_named(I_List *list, const char *name, uint length, - NAMED_LIST **found) -{ - I_List_iterator it(*list); - NAMED_LIST *element; - while ((element= it++)) - { - if (element->cmp(name, length)) - { - if (found) - *found= element; - return element->data; - } - } + thd->variables.character_set_client= character_set_client; + thd->variables.character_set_results= character_set_results; + thd->variables.collation_connection= collation_connection; + thd->update_charset(); + thd->protocol_text.init(thd); + thd->protocol_binary.init(thd); return 0; } - -void delete_elements(I_List *list, - void (*free_element)(const char *name, uchar*)) -{ - NAMED_LIST *element; - DBUG_ENTER("delete_elements"); - while ((element= list->get())) - { - (*free_element)(element->name, element->data); - delete element; - } - DBUG_VOID_RETURN; -} - - -/* Key cache functions */ - -static KEY_CACHE *create_key_cache(const char *name, uint length) -{ - KEY_CACHE *key_cache; - DBUG_ENTER("create_key_cache"); - DBUG_PRINT("enter",("name: %.*s", length, name)); - - if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE), - MYF(MY_ZEROFILL | MY_WME)))) - { - if (!new NAMED_LIST(&key_caches, name, length, (uchar*) key_cache)) - { - my_free((char*) key_cache, MYF(0)); - key_cache= 0; - } - else - { - /* - Set default values for a key cache - The values in dflt_key_cache_var is set by my_getopt() at startup - - We don't set 'buff_size' as this is used to enable the key cache - */ - key_cache->param_block_size= dflt_key_cache_var.param_block_size; - key_cache->param_division_limit= dflt_key_cache_var.param_division_limit; - key_cache->param_age_threshold= dflt_key_cache_var.param_age_threshold; - } - } - DBUG_RETURN(key_cache); -} - - -KEY_CACHE *get_or_create_key_cache(const char *name, uint length) -{ - LEX_STRING key_cache_name; - KEY_CACHE *key_cache; - - key_cache_name.str= (char *) name; - key_cache_name.length= length; - pthread_mutex_lock(&LOCK_global_system_variables); - if (!(key_cache= get_key_cache(&key_cache_name))) - key_cache= create_key_cache(name, length); - pthread_mutex_unlock(&LOCK_global_system_variables); - return key_cache; -} - - -void free_key_cache(const char *name, KEY_CACHE *key_cache) -{ - ha_end_key_cache(key_cache); - my_free((char*) key_cache, MYF(0)); -} - - -bool process_key_caches(process_key_cache_t func) -{ - I_List_iterator it(key_caches); - NAMED_LIST *element; - - while ((element= it++)) - { - KEY_CACHE *key_cache= (KEY_CACHE *) element->data; - func(element->name, key_cache); - } - return 0; -} - -bool sys_var_opt_readonly::update(THD *thd, set_var *var) -{ - bool result; - - DBUG_ENTER("sys_var_opt_readonly::update"); - - /* Prevent self dead-lock */ - if (thd->locked_tables || thd->active_transaction()) - { - my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0)); - DBUG_RETURN(true); - } - - if (thd->global_read_lock) - { - /* - This connection already holds the global read lock. - This can be the case with: - - FLUSH TABLES WITH READ LOCK - - SET GLOBAL READ_ONLY = 1 - */ - result= sys_var_bool_ptr::update(thd, var); - DBUG_RETURN(result); - } - - /* - Perform a 'FLUSH TABLES WITH READ LOCK'. - This is a 3 step process: - - [1] lock_global_read_lock() - - [2] close_cached_tables() - - [3] make_global_read_lock_block_commit() - [1] prevents new connections from obtaining tables locked for write. - [2] waits until all existing connections close their tables. - [3] prevents transactions from being committed. - */ - - if (lock_global_read_lock(thd)) - DBUG_RETURN(true); - - /* - This call will be blocked by any connection holding a READ or WRITE lock. - Ideally, we want to wait only for pending WRITE locks, but since: - con 1> LOCK TABLE T FOR READ; - con 2> LOCK TABLE T FOR WRITE; (blocked by con 1) - con 3> SET GLOBAL READ ONLY=1; (blocked by con 2) - can cause to wait on a read lock, it's required for the client application - to unlock everything, and acceptable for the server to wait on all locks. - */ - if ((result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE))) - goto end_with_read_lock; - - if ((result= make_global_read_lock_block_commit(thd))) - goto end_with_read_lock; - - /* Change the opt_readonly system variable, safe because the lock is held */ - result= sys_var_bool_ptr::update(thd, var); - -end_with_read_lock: - /* Release the lock */ - unlock_global_read_lock(thd); - DBUG_RETURN(result); -} - - -#ifndef DBUG_OFF -/* even session variable here requires SUPER, because of -#o,file */ -bool sys_var_thd_dbug::check(THD *thd, set_var *var) -{ - return check_global_access(thd, SUPER_ACL); -} - -bool sys_var_thd_dbug::update(THD *thd, set_var *var) -{ - if (var->type == OPT_GLOBAL) - DBUG_SET_INITIAL(var ? var->value->str_value.c_ptr() : ""); - else - DBUG_SET(var ? var->value->str_value.c_ptr() : ""); - - return 0; -} - - -uchar *sys_var_thd_dbug::value_ptr(THD *thd, enum_var_type type, LEX_STRING *b) -{ - char buf[256]; - if (type == OPT_GLOBAL) - DBUG_EXPLAIN_INITIAL(buf, sizeof(buf)); - else - DBUG_EXPLAIN(buf, sizeof(buf)); - return (uchar*) thd->strdup(buf); -} -#endif /* DBUG_OFF */ - - -#ifdef HAVE_EVENT_SCHEDULER -bool sys_var_event_scheduler::check(THD *thd, set_var *var) -{ - return check_enum(thd, var, &Events::var_typelib); -} - -/* - The update method of the global variable event_scheduler. - If event_scheduler is switched from 0 to 1 then the scheduler main - thread is resumed and if from 1 to 0 the scheduler thread is suspended - - SYNOPSIS - sys_var_event_scheduler::update() - thd Thread context (unused) - var The new value - - Returns - FALSE OK - TRUE Error -*/ - -bool -sys_var_event_scheduler::update(THD *thd, set_var *var) -{ - int res; - /* here start the thread if not running. */ - DBUG_ENTER("sys_var_event_scheduler::update"); - DBUG_PRINT("info", ("new_value: %d", (int) var->save_result.ulong_value)); - - enum Events::enum_opt_event_scheduler - new_state= - (enum Events::enum_opt_event_scheduler) var->save_result.ulong_value; - - res= Events::switch_event_scheduler_state(new_state); - - DBUG_RETURN((bool) res); -} - - -uchar *sys_var_event_scheduler::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) -{ - return (uchar *) Events::get_opt_event_scheduler_str(); -} -#endif - -/**************************************************************************** - Used templates -****************************************************************************/ - -#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION -template class List; -template class List_iterator_fast; -template class I_List_iterator; -#endif diff --git a/sql/set_var.h b/sql/set_var.h index 120388415f5..d878e85cec0 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -1,7 +1,6 @@ #ifndef SET_VAR_INCLUDED #define SET_VAR_INCLUDED - -/* Copyright (C) 2002-2006 MySQL AB +/* Copyright 2000-2008 MySQL AB, 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,31 +15,23 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Classes to support the SET command */ +/** + @file + "public" interface to sys_var - server configuration variables. +*/ #ifdef USE_PRAGMA_INTERFACE -#pragma interface /* gcc class implementation */ +#pragma interface /* gcc class implementation */ #endif -/**************************************************************************** - Variables that are changable runtime are declared using the - following classes -****************************************************************************/ +#include class sys_var; class set_var; -class sys_var_pluginvar; /* opaque */ -typedef struct system_variables SV; -typedef struct my_locale_st MY_LOCALE; +class sys_var_pluginvar; +class PolyLock; -extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib, - optimizer_switch_typelib, slave_exec_mode_typelib; - -typedef int (*sys_check_func)(THD *, set_var *); -typedef bool (*sys_update_func)(THD *, set_var *); -typedef void (*sys_after_update_func)(THD *,enum_var_type); -typedef void (*sys_set_default_func)(THD *, enum_var_type); -typedef uchar *(*sys_value_ptr_func)(THD *thd); +extern TYPELIB bool_typelib; struct sys_var_chain { @@ -48,1297 +39,165 @@ struct sys_var_chain sys_var *last; }; +int mysql_add_sys_var_chain(sys_var *chain); +int mysql_del_sys_var_chain(sys_var *chain); + +/** + A class representing one system variable - that is something + that can be accessed as @@global.variable_name or @@session.variable_name, + visible in SHOW xxx VARIABLES and in INFORMATION_SCHEMA.xxx_VARIABLES, + optionally it can be assigned to, optionally it can have a command-line + counterpart with the same name. +*/ class sys_var { public: - - /** - Enumeration type to indicate for a system variable whether it will be written to the binlog or not. - */ - enum Binlog_status_enum - { - /* The variable value is not in the binlog. */ - NOT_IN_BINLOG, - /* The value of the @@session variable is in the binlog. */ - SESSION_VARIABLE_IN_BINLOG - /* - Currently, no @@global variable is ever in the binlog, so we - don't need an enumeration value for that. - */ - }; - sys_var *next; - struct my_option *option_limits; /* Updated by by set_var_init() */ - uint name_length; /* Updated by by set_var_init() */ - const char *name; + LEX_CSTRING name; + enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023, + READONLY=1024, ALLOCATED=2048 }; + /** + Enumeration type to indicate for a system variable whether + it will be written to the binlog or not. + */ + enum binlog_status_enum { VARIABLE_NOT_IN_BINLOG, + SESSION_VARIABLE_IN_BINLOG } binlog_status; - sys_after_update_func after_update; - bool no_support_one_shot; - /* - true if the value is in character_set_filesystem, - false otherwise. - Note that we can't use a pointer to the charset as the system var is - instantiated in global scope and the charset pointers are initialized - later. - */ - bool is_os_charset; - sys_var(const char *name_arg, sys_after_update_func func= NULL, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :name(name_arg), after_update(func), no_support_one_shot(1), - is_os_charset (FALSE), - binlog_status(binlog_status_arg), - m_allow_empty_value(TRUE) - {} +protected: + typedef bool (*on_check_function)(sys_var *self, THD *thd, set_var *var); + typedef bool (*on_update_function)(sys_var *self, THD *thd, enum_var_type type); + + int flags; ///< or'ed flag_enum values + 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 + ptrdiff_t offset; ///< offset to the value from global_system_variables + on_check_function on_check; + on_update_function on_update; + struct { uint version; const char *substitute; } deprecated; + bool is_os_charset; ///< true if the value is in character_set_filesystem + +public: + sys_var(sys_var_chain *chain, const char *name_arg, const char *comment, + int flag_args, ptrdiff_t off, int getopt_id, + 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); + /** + The instance should only be destroyed on shutdown, as it doesn't unlink + itself from the chain. + */ virtual ~sys_var() {} - void chain_sys_var(sys_var_chain *chain_arg) - { - if (chain_arg->last) - chain_arg->last->next= this; - else - chain_arg->first= this; - chain_arg->last= this; - } - virtual bool check(THD *thd, set_var *var); - bool check_enum(THD *thd, set_var *var, const TYPELIB *enum_names); - bool check_set(THD *thd, set_var *var, TYPELIB *enum_names); - bool is_written_to_binlog(enum_var_type type) - { - return (type == OPT_SESSION || type == OPT_DEFAULT) && - (binlog_status == SESSION_VARIABLE_IN_BINLOG); - } - virtual bool update(THD *thd, set_var *var)=0; - virtual void set_default(THD *thd_arg, enum_var_type type) {} - virtual SHOW_TYPE show_type() { return SHOW_UNDEF; } - virtual uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return 0; } - virtual bool check_type(enum_var_type type) - { return type != OPT_GLOBAL; } /* Error if not GLOBAL */ - virtual bool check_update_type(Item_result type) - { return type != INT_RESULT; } /* Assume INT */ - virtual bool check_default(enum_var_type type) - { return option_limits == 0; } - virtual bool is_struct() { return 0; } - virtual bool is_readonly() const { return 0; } - CHARSET_INFO *charset(THD *thd); + /** + downcast for sys_var_pluginvar. Returns this if it's an instance + of sys_var_pluginvar, and 0 otherwise. + */ virtual sys_var_pluginvar *cast_pluginvar() { return 0; } -protected: - void set_allow_empty_value(bool allow_empty_value) - { - m_allow_empty_value= allow_empty_value; - } - -private: - const Binlog_status_enum binlog_status; - - bool m_allow_empty_value; -}; - - -/* - A base class for all variables that require its access to - be guarded with a mutex. -*/ - -class sys_var_global: public sys_var -{ -protected: - pthread_mutex_t *guard; -public: - sys_var_global(const char *name_arg, sys_after_update_func after_update_arg, - pthread_mutex_t *guard_arg) - :sys_var(name_arg, after_update_arg), guard(guard_arg) {} -}; - - -/* - A global-only ulong variable that requires its access to be - protected with a mutex. -*/ - -class sys_var_long_ptr_global: public sys_var_global -{ -public: - ulong *value; - sys_var_long_ptr_global(sys_var_chain *chain, const char *name_arg, - ulong *value_ptr_arg, - pthread_mutex_t *guard_arg, - sys_after_update_func after_update_arg= NULL) - :sys_var_global(name_arg, after_update_arg, guard_arg), - value(value_ptr_arg) - { chain_sys_var(chain); } bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_LONG; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (uchar*) value; } -}; - -/** - Unsigned int system variable class - */ -class sys_var_uint_ptr :public sys_var -{ -public: - sys_var_uint_ptr(sys_var_chain *chain, const char *name_arg, - uint *value_ptr_arg, - sys_after_update_func after_update_arg= NULL) - :sys_var(name_arg, after_update_arg), - value(value_ptr_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_INT; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (uchar*) value; } -private: - uint *value; -}; - -/* - A global ulong variable that is protected by LOCK_global_system_variables -*/ - -class sys_var_long_ptr :public sys_var_long_ptr_global -{ -public: - sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr, - sys_after_update_func after_update_arg= NULL); -}; - - -class sys_var_ulonglong_ptr :public sys_var -{ -public: - ulonglong *value; - sys_var_ulonglong_ptr(sys_var_chain *chain, const char *name_arg, ulonglong *value_ptr_arg) - :sys_var(name_arg),value(value_ptr_arg) - { chain_sys_var(chain); } - sys_var_ulonglong_ptr(sys_var_chain *chain, const char *name_arg, ulonglong *value_ptr_arg, - sys_after_update_func func) - :sys_var(name_arg,func), value(value_ptr_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_LONGLONG; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (uchar*) value; } -}; - - -class sys_var_bool_ptr :public sys_var -{ -public: - my_bool *value; - sys_var_bool_ptr(sys_var_chain *chain, const char *name_arg, my_bool *value_arg) - :sys_var(name_arg),value(value_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var) - { - return check_enum(thd, var, &bool_typelib); - } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_MY_BOOL; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (uchar*) value; } - bool check_update_type(Item_result type) { return 0; } -}; - - -class sys_var_bool_ptr_readonly :public sys_var_bool_ptr -{ -public: - sys_var_bool_ptr_readonly(sys_var_chain *chain, const char *name_arg, - my_bool *value_arg) - :sys_var_bool_ptr(chain, name_arg, value_arg) - {} - bool is_readonly() const { return 1; } -}; - - -class sys_var_str :public sys_var -{ -public: - char *value; // Pointer to allocated string - uint value_length; - sys_check_func check_func; - sys_update_func update_func; - sys_set_default_func set_default_func; - sys_var_str(sys_var_chain *chain, const char *name_arg, - sys_check_func check_func_arg, - sys_update_func update_func_arg, - sys_set_default_func set_default_func_arg, - char *value_arg) - :sys_var(name_arg), value(value_arg), check_func(check_func_arg), - update_func(update_func_arg),set_default_func(set_default_func_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var) - { - return (*update_func)(thd, var); - } - void set_default(THD *thd, enum_var_type type) - { - (*set_default_func)(thd, type); - } - SHOW_TYPE show_type() { return SHOW_CHAR; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (uchar*) value; } - bool check_update_type(Item_result type) - { - return type != STRING_RESULT; /* Only accept strings */ - } - bool check_default(enum_var_type type) { return 0; } -}; - - -class sys_var_const_str :public sys_var -{ -public: - char *value; // Pointer to const value - sys_var_const_str(sys_var_chain *chain, const char *name_arg, - const char *value_arg) - :sys_var(name_arg), value((char*) value_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var) - { - return 1; - } - bool update(THD *thd, set_var *var) - { - return 1; - } - SHOW_TYPE show_type() { return SHOW_CHAR; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { - return (uchar*) value; - } - bool check_update_type(Item_result type) - { - return 1; - } - bool check_default(enum_var_type type) { return 1; } - bool is_readonly() const { return 1; } -}; - - -class sys_var_const_os_str: public sys_var_const_str -{ -public: - sys_var_const_os_str(sys_var_chain *chain, const char *name_arg, - const char *value_arg) - :sys_var_const_str(chain, name_arg, value_arg) - { - is_os_charset= TRUE; - } -}; - - -class sys_var_const_str_ptr :public sys_var -{ -public: - char **value; // Pointer to const value - sys_var_const_str_ptr(sys_var_chain *chain, const char *name_arg, char **value_arg) - :sys_var(name_arg),value(value_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var) - { - return 1; - } - bool update(THD *thd, set_var *var) - { - return 1; - } - SHOW_TYPE show_type() { return SHOW_CHAR; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { - return (uchar*) *value; - } - bool check_update_type(Item_result type) - { - return 1; - } - bool check_default(enum_var_type type) { return 1; } - bool is_readonly() const { return 1; } -}; - - -class sys_var_const_os_str_ptr :public sys_var_const_str_ptr -{ -public: - sys_var_const_os_str_ptr(sys_var_chain *chain, const char *name_arg, - char **value_arg) - :sys_var_const_str_ptr(chain, name_arg, value_arg) - { - is_os_charset= TRUE; - } -}; - - -class sys_var_enum :public sys_var -{ - uint *value; - TYPELIB *enum_names; -public: - sys_var_enum(sys_var_chain *chain, const char *name_arg, uint *value_arg, - TYPELIB *typelib, sys_after_update_func func) - :sys_var(name_arg,func), value(value_arg), enum_names(typelib) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var) - { - return check_enum(thd, var, enum_names); - } - bool update(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check_update_type(Item_result type) { return 0; } -}; - - -class sys_var_enum_const :public sys_var -{ - ulong SV::*offset; - TYPELIB *enum_names; -public: - sys_var_enum_const(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg, - TYPELIB *typelib, sys_after_update_func func) - :sys_var(name_arg,func), offset(offset_arg), enum_names(typelib) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var) { return 1; } - bool update(THD *thd, set_var *var) { return 1; } - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) { return 1; } - bool is_readonly() const { return 1; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -class sys_var_thd :public sys_var -{ -public: - sys_var_thd(const char *name_arg, - sys_after_update_func func= NULL, - Binlog_status_enum binlog_status= NOT_IN_BINLOG) - :sys_var(name_arg, func, binlog_status) - {} - bool check_type(enum_var_type type) { return 0; } - bool check_default(enum_var_type type) - { - return type == OPT_GLOBAL && !option_limits; - } -}; - - -class sys_var_thd_ulong :public sys_var_thd -{ - sys_check_func check_func; -public: - ulong SV::*offset; - sys_var_thd_ulong(sys_var_chain *chain, const char *name_arg, - ulong SV::*offset_arg, - sys_check_func c_func= NULL, - sys_after_update_func au_func= NULL, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var_thd(name_arg, au_func, binlog_status_arg), check_func(c_func), - offset(offset_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); + bool set_default(THD *thd, enum_var_type type); bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_LONG; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - -class sys_var_thd_ha_rows :public sys_var_thd -{ -public: - ha_rows SV::*offset; - sys_var_thd_ha_rows(sys_var_chain *chain, const char *name_arg, - ha_rows SV::*offset_arg) - :sys_var_thd(name_arg), offset(offset_arg) - { chain_sys_var(chain); } - sys_var_thd_ha_rows(sys_var_chain *chain, const char *name_arg, - ha_rows SV::*offset_arg, - sys_after_update_func func) - :sys_var_thd(name_arg,func), offset(offset_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_HA_ROWS; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -class sys_var_thd_ulonglong :public sys_var_thd -{ -public: - ulonglong SV::*offset; - bool only_global; - sys_var_thd_ulonglong(sys_var_chain *chain, const char *name_arg, - ulonglong SV::*offset_arg) - :sys_var_thd(name_arg), offset(offset_arg) - { chain_sys_var(chain); } - sys_var_thd_ulonglong(sys_var_chain *chain, const char *name_arg, - ulonglong SV::*offset_arg, - sys_after_update_func func, bool only_global_arg) - :sys_var_thd(name_arg, func), offset(offset_arg), - only_global(only_global_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_LONGLONG; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check(THD *thd, set_var *var); - bool check_default(enum_var_type type) - { - return type == OPT_GLOBAL && !option_limits; - } + SHOW_TYPE show_type() { return show_val_type; } + int scope() const { return flags & SCOPE_MASK; } + CHARSET_INFO *charset(THD *thd); + bool is_readonly() const { return flags & READONLY; } + /** + the following is only true for keycache variables, + that support the syntax @@keycache_name.variable_name + */ + bool is_struct() { return option.var_type & GET_ASK_ADDR; } + bool is_written_to_binlog(enum_var_type type) + { return type != OPT_GLOBAL && binlog_status == SESSION_VARIABLE_IN_BINLOG; } + virtual bool check_update_type(Item_result type) = 0; bool check_type(enum_var_type type) { - return (only_global && type != OPT_GLOBAL); + switch (scope()) + { + case GLOBAL: return type != OPT_GLOBAL; + case SESSION: return false; // always ok + case ONLY_SESSION: return type == OPT_GLOBAL; + } + return true; // keep gcc happy } -}; + bool register_option(DYNAMIC_ARRAY *array) + { return option.id != -1 && insert_dynamic(array, (uchar*)&option); } - -class sys_var_thd_bool :public sys_var_thd -{ -public: - my_bool SV::*offset; - sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg) - :sys_var_thd(name_arg), offset(offset_arg) - { chain_sys_var(chain); } - sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg, - sys_after_update_func func) - :sys_var_thd(name_arg,func), offset(offset_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_MY_BOOL; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check(THD *thd, set_var *var) - { - return check_enum(thd, var, &bool_typelib); - } - bool check_update_type(Item_result type) { return 0; } -}; - - -class sys_var_thd_enum :public sys_var_thd -{ +private: + virtual bool do_check(THD *thd, set_var *var) = 0; + /** + save the session default value of the variable in var + */ + virtual void session_save_default(THD *thd, set_var *var) = 0; + /** + save the global default value of the variable in var + */ + virtual void global_save_default(THD *thd, set_var *var) = 0; + virtual bool session_update(THD *thd, set_var *var) = 0; + virtual bool global_update(THD *thd, set_var *var) = 0; + void do_deprecated_warning(THD *thd); protected: - ulong SV::*offset; - TYPELIB *enum_names; - sys_check_func check_func; -public: - sys_var_thd_enum(sys_var_chain *chain, const char *name_arg, - ulong SV::*offset_arg, TYPELIB *typelib, - sys_after_update_func func= NULL, - sys_check_func check= NULL) - :sys_var_thd(name_arg, func), offset(offset_arg), - enum_names(typelib), check_func(check) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var) - { - /* - check_enum fails if the character representation supplied was wrong - or that the integer value was wrong or missing. - */ - if (check_enum(thd, var, enum_names)) - return TRUE; - else if ((check_func && (*check_func)(thd, var))) - return TRUE; - else - return FALSE; - } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_CHAR; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check_update_type(Item_result type) { return 0; } -}; - - -class sys_var_thd_optimizer_switch :public sys_var_thd_enum -{ -public: - sys_var_thd_optimizer_switch(sys_var_chain *chain, const char *name_arg, - ulong SV::*offset_arg) - :sys_var_thd_enum(chain, name_arg, offset_arg, &optimizer_switch_typelib) - {} - bool check(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode, - LEX_STRING *rep); -}; - -extern void fix_sql_mode_var(THD *thd, enum_var_type type); - -class sys_var_thd_sql_mode :public sys_var_thd_enum -{ -public: - sys_var_thd_sql_mode(sys_var_chain *chain, const char *name_arg, - ulong SV::*offset_arg) - :sys_var_thd_enum(chain, name_arg, offset_arg, &sql_mode_typelib, - fix_sql_mode_var) - {} - bool check(THD *thd, set_var *var) - { - return check_set(thd, var, enum_names); - } - void set_default(THD *thd, enum_var_type type); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode, - LEX_STRING *rep); -}; - - -class sys_var_thd_storage_engine :public sys_var_thd -{ -protected: - plugin_ref SV::*offset; -public: - sys_var_thd_storage_engine(sys_var_chain *chain, const char *name_arg, - plugin_ref SV::*offset_arg) - :sys_var_thd(name_arg), offset(offset_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) - { - return type != STRING_RESULT; /* Only accept strings */ - } - void set_default(THD *thd, enum_var_type type); - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - -class sys_var_thd_bit :public sys_var_thd -{ - sys_check_func check_func; - sys_update_func update_func; -public: - ulonglong bit_flag; - bool reverse; - sys_var_thd_bit(sys_var_chain *chain, const char *name_arg, - sys_check_func c_func, sys_update_func u_func, - ulonglong bit, bool reverse_arg=0, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var_thd(name_arg, NULL, binlog_status_arg), check_func(c_func), - update_func(u_func), bit_flag(bit), reverse(reverse_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - bool check_update_type(Item_result type) { return 0; } - bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } - SHOW_TYPE show_type() { return SHOW_MY_BOOL; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - -#ifndef DBUG_OFF -class sys_var_thd_dbug :public sys_var_thd -{ -public: - sys_var_thd_dbug(sys_var_chain *chain, const char *name_arg) - :sys_var_thd(name_arg) - { chain_sys_var(chain); } - bool check_update_type(Item_result type) { return type != STRING_RESULT; } - bool check(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type) { DBUG_POP(); } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b); -}; -#endif /* DBUG_OFF */ - -#if defined(ENABLED_DEBUG_SYNC) -/* Debug Sync Facility. Implemented in debug_sync.cc. */ -class sys_var_debug_sync :public sys_var_thd -{ -public: - sys_var_debug_sync(sys_var_chain *chain, const char *name_arg) - :sys_var_thd(name_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) { return type != STRING_RESULT; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; -#endif /* defined(ENABLED_DEBUG_SYNC) */ - -/* some variables that require special handling */ - -class sys_var_timestamp :public sys_var -{ -public: - sys_var_timestamp(sys_var_chain *chain, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var(name_arg, NULL, binlog_status_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } - bool check_default(enum_var_type type) { return 0; } - SHOW_TYPE show_type() { return SHOW_LONG; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -class sys_var_last_insert_id :public sys_var -{ -public: - sys_var_last_insert_id(sys_var_chain *chain, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var(name_arg, NULL, binlog_status_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } - SHOW_TYPE show_type() { return SHOW_LONGLONG; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -class sys_var_insert_id :public sys_var -{ -public: - sys_var_insert_id(sys_var_chain *chain, const char *name_arg) - :sys_var(name_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } - SHOW_TYPE show_type() { return SHOW_LONGLONG; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -class sys_var_rand_seed1 :public sys_var -{ -public: - sys_var_rand_seed1(sys_var_chain *chain, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var(name_arg, NULL, binlog_status_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } -}; - -class sys_var_rand_seed2 :public sys_var -{ -public: - sys_var_rand_seed2(sys_var_chain *chain, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var(name_arg, NULL, binlog_status_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var); - bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } -}; - - -class sys_var_collation :public sys_var_thd -{ -public: - sys_var_collation(const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var_thd(name_arg, NULL, binlog_status_arg) - { - no_support_one_shot= 0; - } - bool check(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) - { - return ((type != STRING_RESULT) && (type != INT_RESULT)); - } - bool check_default(enum_var_type type) { return 0; } - virtual void set_default(THD *thd, enum_var_type type)= 0; -}; - -class sys_var_character_set :public sys_var_thd -{ -public: - bool nullable; - sys_var_character_set(const char *name_arg, bool is_nullable= 0, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var_thd(name_arg, NULL, binlog_status_arg), nullable(is_nullable) - { - /* - In fact only almost all variables derived from sys_var_character_set - support ONE_SHOT; character_set_results doesn't. But that's good enough. - */ - no_support_one_shot= 0; - } - bool check(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) - { - return ((type != STRING_RESULT) && (type != INT_RESULT)); - } - bool check_default(enum_var_type type) { return 0; } - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - virtual void set_default(THD *thd, enum_var_type type)= 0; - virtual CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type)= 0; -}; - -class sys_var_character_set_sv :public sys_var_character_set -{ - CHARSET_INFO *SV::*offset; - CHARSET_INFO **global_default; -public: - sys_var_character_set_sv(sys_var_chain *chain, const char *name_arg, - CHARSET_INFO *SV::*offset_arg, - CHARSET_INFO **global_default_arg, - bool is_nullable= 0, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - : sys_var_character_set(name_arg, is_nullable, binlog_status_arg), - offset(offset_arg), global_default(global_default_arg) - { chain_sys_var(chain); } - void set_default(THD *thd, enum_var_type type); - CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type); -}; - - -class sys_var_character_set_client: public sys_var_character_set_sv -{ -public: - sys_var_character_set_client(sys_var_chain *chain, const char *name_arg, - CHARSET_INFO *SV::*offset_arg, - CHARSET_INFO **global_default_arg, - Binlog_status_enum binlog_status_arg) - : sys_var_character_set_sv(chain, name_arg, offset_arg, global_default_arg, - 0, binlog_status_arg) - { } - bool check(THD *thd, set_var *var); -}; - - -class sys_var_character_set_database :public sys_var_character_set -{ -public: - sys_var_character_set_database(sys_var_chain *chain, const char *name_arg, - Binlog_status_enum binlog_status_arg= - NOT_IN_BINLOG) - : sys_var_character_set(name_arg, 0, binlog_status_arg) - { chain_sys_var(chain); } - void set_default(THD *thd, enum_var_type type); - CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type); -}; - -class sys_var_collation_sv :public sys_var_collation -{ - CHARSET_INFO *SV::*offset; - CHARSET_INFO **global_default; -public: - sys_var_collation_sv(sys_var_chain *chain, const char *name_arg, - CHARSET_INFO *SV::*offset_arg, - CHARSET_INFO **global_default_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var_collation(name_arg, binlog_status_arg), - offset(offset_arg), global_default(global_default_arg) - { - chain_sys_var(chain); - } - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -class sys_var_key_cache_param :public sys_var -{ -protected: - size_t offset; -public: - sys_var_key_cache_param(sys_var_chain *chain, const char *name_arg, - size_t offset_arg) - :sys_var(name_arg), offset(offset_arg) - { chain_sys_var(chain); } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check_default(enum_var_type type) { return 1; } - bool is_struct() { return 1; } -}; - - -class sys_var_key_buffer_size :public sys_var_key_cache_param -{ -public: - sys_var_key_buffer_size(sys_var_chain *chain, const char *name_arg) - :sys_var_key_cache_param(chain, name_arg, - offsetof(KEY_CACHE, param_buff_size)) - {} - bool update(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_LONGLONG; } -}; - - -class sys_var_key_cache_long :public sys_var_key_cache_param -{ -public: - sys_var_key_cache_long(sys_var_chain *chain, const char *name_arg, size_t offset_arg) - :sys_var_key_cache_param(chain, name_arg, offset_arg) - {} - bool update(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_LONG; } -}; - - -class sys_var_thd_date_time_format :public sys_var_thd -{ - DATE_TIME_FORMAT *SV::*offset; - timestamp_type date_time_type; -public: - sys_var_thd_date_time_format(sys_var_chain *chain, const char *name_arg, - DATE_TIME_FORMAT *SV::*offset_arg, - timestamp_type date_time_type_arg) - :sys_var_thd(name_arg), offset(offset_arg), - date_time_type(date_time_type_arg) - { chain_sys_var(chain); } - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) - { - return type != STRING_RESULT; /* Only accept strings */ - } - bool check_default(enum_var_type type) { return 0; } - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - void update2(THD *thd, enum_var_type type, DATE_TIME_FORMAT *new_value); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - void set_default(THD *thd, enum_var_type type); -}; - - -class sys_var_log_state :public sys_var_bool_ptr -{ - uint log_type; -public: - sys_var_log_state(sys_var_chain *chain, const char *name_arg, my_bool *value_arg, - uint log_type_arg) - :sys_var_bool_ptr(chain, name_arg, value_arg), log_type(log_type_arg) {} - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); -}; - - -class sys_var_set :public sys_var -{ -protected: - ulong *value; - TYPELIB *enum_names; -public: - sys_var_set(sys_var_chain *chain, const char *name_arg, ulong *value_arg, - TYPELIB *typelib, sys_after_update_func func) - :sys_var(name_arg, func), value(value_arg), enum_names(typelib) - { chain_sys_var(chain); } - virtual bool check(THD *thd, set_var *var) - { - return check_set(thd, var, enum_names); - } - virtual void set_default(THD *thd, enum_var_type type) - { - *value= 0; - } - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check_update_type(Item_result type) { return 0; } - SHOW_TYPE show_type() { return SHOW_CHAR; } -}; - -class sys_var_set_slave_mode :public sys_var_set -{ -public: - sys_var_set_slave_mode(sys_var_chain *chain, const char *name_arg, - ulong *value_arg, - TYPELIB *typelib, sys_after_update_func func) : - sys_var_set(chain, name_arg, value_arg, typelib, func) {} - void set_default(THD *thd, enum_var_type type); - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); -}; - -class sys_var_log_output :public sys_var -{ - ulong *value; - TYPELIB *enum_names; -public: - sys_var_log_output(sys_var_chain *chain, const char *name_arg, ulong *value_arg, - TYPELIB *typelib, sys_after_update_func func) - :sys_var(name_arg,func), value(value_arg), enum_names(typelib) - { - chain_sys_var(chain); - set_allow_empty_value(FALSE); - } - virtual bool check(THD *thd, set_var *var) - { - return check_set(thd, var, enum_names); - } - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check_update_type(Item_result type) { return 0; } - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_CHAR; } -}; - - -/* Variable that you can only read from */ - -class sys_var_readonly: public sys_var -{ -public: - enum_var_type var_type; - SHOW_TYPE show_type_value; - sys_value_ptr_func value_ptr_func; - sys_var_readonly(sys_var_chain *chain, const char *name_arg, enum_var_type type, - SHOW_TYPE show_type_arg, - sys_value_ptr_func value_ptr_func_arg) - :sys_var(name_arg), var_type(type), - show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var) { return 1; } - bool check_default(enum_var_type type) { return 1; } - bool check_type(enum_var_type type) { return type != var_type; } - bool check_update_type(Item_result type) { return 1; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { - return (*value_ptr_func)(thd); - } - SHOW_TYPE show_type() { return show_type_value; } - bool is_readonly() const { return 1; } -}; - - -class sys_var_readonly_os: public sys_var_readonly -{ -public: - sys_var_readonly_os(sys_var_chain *chain, const char *name_arg, enum_var_type type, - SHOW_TYPE show_type_arg, - sys_value_ptr_func value_ptr_func_arg) - :sys_var_readonly(chain, name_arg, type, show_type_arg, value_ptr_func_arg) - { - is_os_charset= TRUE; - } -}; - - -/** - Global-only, read-only variable. E.g. command line option. -*/ - -class sys_var_const: public sys_var -{ -public: - enum_var_type var_type; - SHOW_TYPE show_type_value; - uchar *ptr; - sys_var_const(sys_var_chain *chain, const char *name_arg, enum_var_type type, - SHOW_TYPE show_type_arg, uchar *ptr_arg) - :sys_var(name_arg), var_type(type), - show_type_value(show_type_arg), ptr(ptr_arg) - { chain_sys_var(chain); } - bool update(THD *thd, set_var *var) { return 1; } - bool check_default(enum_var_type type) { return 1; } - bool check_type(enum_var_type type) { return type != var_type; } - bool check_update_type(Item_result type) { return 1; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { - return ptr; - } - SHOW_TYPE show_type() { return show_type_value; } - bool is_readonly() const { return 1; } -}; - - -class sys_var_const_os: public sys_var_const -{ -public: - enum_var_type var_type; - SHOW_TYPE show_type_value; - uchar *ptr; - sys_var_const_os(sys_var_chain *chain, const char *name_arg, - enum_var_type type, - SHOW_TYPE show_type_arg, uchar *ptr_arg) - :sys_var_const(chain, name_arg, type, show_type_arg, ptr_arg) - { - is_os_charset= TRUE; - } -}; - - -class sys_var_have_option: public sys_var -{ -protected: - virtual SHOW_COMP_OPTION get_option() = 0; -public: - sys_var_have_option(sys_var_chain *chain, const char *variable_name): - sys_var(variable_name) - { chain_sys_var(chain); } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { - return (uchar*) show_comp_option_name[get_option()]; - } - bool update(THD *thd, set_var *var) { return 1; } - bool check_default(enum_var_type type) { return 1; } - bool check_type(enum_var_type type) { return type != OPT_GLOBAL; } - bool check_update_type(Item_result type) { return 1; } - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool is_readonly() const { return 1; } -}; - - -class sys_var_have_variable: public sys_var_have_option -{ - SHOW_COMP_OPTION *have_variable; - -public: - sys_var_have_variable(sys_var_chain *chain, const char *variable_name, - SHOW_COMP_OPTION *have_variable_arg): - sys_var_have_option(chain, variable_name), - have_variable(have_variable_arg) - { } - SHOW_COMP_OPTION get_option() { return *have_variable; } -}; - - -class sys_var_have_plugin: public sys_var_have_option -{ - const char *plugin_name_str; - const uint plugin_name_len; - const int plugin_type; - -public: - sys_var_have_plugin(sys_var_chain *chain, const char *variable_name, - const char *plugin_name_str_arg, uint plugin_name_len_arg, - int plugin_type_arg): - sys_var_have_option(chain, variable_name), - plugin_name_str(plugin_name_str_arg), plugin_name_len(plugin_name_len_arg), - plugin_type(plugin_type_arg) - { } - /* the following method is declared in sql_plugin.cc */ - SHOW_COMP_OPTION get_option(); -}; - - -class sys_var_thd_time_zone :public sys_var_thd -{ -public: - sys_var_thd_time_zone(sys_var_chain *chain, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - :sys_var_thd(name_arg, NULL, binlog_status_arg) - { - no_support_one_shot= 0; - chain_sys_var(chain); - } - bool check(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) - { - return type != STRING_RESULT; /* Only accept strings */ - } - bool check_default(enum_var_type type) { return 0; } - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - virtual void set_default(THD *thd, enum_var_type type); -}; - - -class sys_var_max_user_conn : public sys_var_thd -{ -public: - sys_var_max_user_conn(sys_var_chain *chain, const char *name_arg): - sys_var_thd(name_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - bool check_default(enum_var_type type) - { - return type != OPT_GLOBAL || !option_limits; - } - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_INT; } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -/** - * @brief This is a specialization of sys_var_thd_ulong that implements a - read-only session variable. The class overrides check() and check_default() - to achieve the read-only property for the session part of the variable. - */ -class sys_var_thd_ulong_session_readonly : public sys_var_thd_ulong -{ -public: - sys_var_thd_ulong_session_readonly(sys_var_chain *chain_arg, - const char *name_arg, ulong SV::*offset_arg, - sys_check_func c_func= NULL, - sys_after_update_func au_func= NULL, - Binlog_status_enum bl_status_arg= NOT_IN_BINLOG): - sys_var_thd_ulong(chain_arg, name_arg, offset_arg, c_func, au_func, bl_status_arg) - { } - bool check(THD *thd, set_var *var); - bool check_default(enum_var_type type) - { - return type != OPT_GLOBAL || !option_limits; - } -}; - - -class sys_var_microseconds :public sys_var_thd -{ - ulonglong SV::*offset; -public: - sys_var_microseconds(sys_var_chain *chain, const char *name_arg, - ulonglong SV::*offset_arg): - sys_var_thd(name_arg), offset(offset_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var) {return 0;} - bool update(THD *thd, set_var *var); - void set_default(THD *thd, enum_var_type type); - SHOW_TYPE show_type() { return SHOW_DOUBLE; } - bool check_update_type(Item_result type) - { - return (type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT); - } - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); -}; - - -/** - Handler for setting the system variable --read-only. -*/ - -class sys_var_opt_readonly :public sys_var_bool_ptr -{ -public: - sys_var_opt_readonly(sys_var_chain *chain, const char *name_arg, - my_bool *value_arg) : - sys_var_bool_ptr(chain, name_arg, value_arg) {}; - ~sys_var_opt_readonly() {}; - bool update(THD *thd, set_var *var); -}; - - - -class sys_var_thd_lc: public sys_var_thd -{ -public: - sys_var_thd_lc(sys_var_chain *chain, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - : sys_var_thd(name_arg, NULL, binlog_status_arg) - { -#if MYSQL_VERSION_ID < 50000 - no_support_one_shot= 0; -#endif - chain_sys_var(chain); - } - bool check(THD *thd, set_var *var); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check_update_type(Item_result type) - { - return ((type != STRING_RESULT) && (type != INT_RESULT)); - } - bool check_default(enum_var_type type) { return 0; } -}; - - -class sys_var_thd_lc_time_names :public sys_var_thd_lc -{ -public: - sys_var_thd_lc_time_names(sys_var_chain *chain_arg, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - : sys_var_thd_lc(chain_arg, name_arg, binlog_status_arg) - {} - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - void set_default(THD *thd, enum_var_type type); -}; - - -class sys_var_thd_lc_messages :public sys_var_thd_lc -{ -public: - sys_var_thd_lc_messages(sys_var_chain *chain_arg, const char *name_arg, - Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) - : sys_var_thd_lc(chain_arg, name_arg, binlog_status_arg) - {} - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - void set_default(THD *thd, enum_var_type type); -}; - - -#ifdef HAVE_EVENT_SCHEDULER -class sys_var_event_scheduler :public sys_var_long_ptr -{ - /* We need a derived class only to have a warn_deprecated() */ -public: - sys_var_event_scheduler(sys_var_chain *chain, const char *name_arg) : - sys_var_long_ptr(chain, name_arg, NULL, NULL) {}; - bool update(THD *thd, set_var *var); - uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - SHOW_TYPE show_type() { return SHOW_CHAR; } - bool check(THD *thd, set_var *var); - bool check_update_type(Item_result type) - { - return type != STRING_RESULT && type != INT_RESULT; - } -}; -#endif - -extern void fix_binlog_format_after_update(THD *thd, enum_var_type type); - -class sys_var_thd_binlog_format :public sys_var_thd_enum -{ -public: - sys_var_thd_binlog_format(sys_var_chain *chain, const char *name_arg, - ulong SV::*offset_arg) - :sys_var_thd_enum(chain, name_arg, offset_arg, - &binlog_format_typelib, - fix_binlog_format_after_update) - {}; - bool check(THD *thd, set_var *var); - bool is_readonly() const; + /** + A pointer to a value of the variable for SHOW. + It must be of show_val_type type (bool for SHOW_BOOL, int for SHOW_INT, + longlong for SHOW_LONGLONG, etc). + */ + virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base); + virtual uchar *global_value_ptr(THD *thd, LEX_STRING *base); + + /** + A pointer to a storage area of the variable, to the raw data. + Typically it's the same as session_value_ptr(), but it's different, + for example, for ENUM, that is printed as a string, but stored as a number. + */ + uchar *session_var_ptr(THD *thd) + { return ((uchar*)&(thd->variables)) + offset; } + + uchar *global_var_ptr() + { return ((uchar*)&global_system_variables) + offset; } }; /**************************************************************************** Classes for parsing of the SET command ****************************************************************************/ +/** + A base class for everything that can be set with SET command. + It's similar to Items, an instance of this is created by the parser + for every assigmnent in SET (or elsewhere, e.g. in SELECT). +*/ class set_var_base :public Sql_alloc { public: set_var_base() {} virtual ~set_var_base() {} - virtual int check(THD *thd)=0; /* To check privileges etc. */ - virtual int update(THD *thd)=0; /* To set the value */ - /* light check for PS */ - virtual int light_check(THD *thd) { return check(thd); } - virtual bool no_support_one_shot() { return 1; } + virtual int check(THD *thd)=0; /* To check privileges etc. */ + virtual int update(THD *thd)=0; /* To set the value */ + virtual int light_check(THD *thd) { return check(thd); } /* for PS */ }; -/* MySQL internal variables, like query_cache_size */ - +/** + set_var_base descendant for assignments to the system variables. +*/ class set_var :public set_var_base { public: - sys_var *var; - Item *value; + sys_var *var; ///< system variable to be updated + Item *value; ///< the expression that provides the new value of the variable enum_var_type type; - union + union ///< temp storage to hold a value between sys_var::check and ::update { - CHARSET_INFO *charset; - ulong ulong_value; - ulonglong ulonglong_value; - plugin_ref plugin; - DATE_TIME_FORMAT *date_time_format; - Time_zone *time_zone; - MY_LOCALE *locale_value; + ulonglong ulonglong_value; ///< for all integer, set, enum sysvars + double double_value; ///< for Sys_var_double + plugin_ref plugin; ///< for Sys_var_plugin + Time_zone *time_zone; ///< for Sys_var_tz + LEX_STRING string_value; ///< for Sys_var_charptr and others + void *ptr; ///< for Sys_var_struct } save_result; - LEX_STRING base; /* for structs */ + LEX_STRING base; /**< for structured variables, like keycache_name.variable_name */ set_var(enum_var_type type_arg, sys_var *var_arg, const LEX_STRING *base_name_arg, Item *value_arg) @@ -1351,10 +210,10 @@ public: if (value_arg && value_arg->type() == Item::FIELD_ITEM) { Item_field *item= (Item_field*) value_arg; - if (!(value=new Item_string(item->field_name, + if (!(value=new Item_string(item->field_name, (uint) strlen(item->field_name), - system_charset_info))) - value=value_arg; /* Give error message later */ + system_charset_info))) // names are utf8 + value=value_arg; /* Give error message later */ } else value=value_arg; @@ -1362,12 +221,10 @@ public: int check(THD *thd); int update(THD *thd); int light_check(THD *thd); - bool no_support_one_shot() { return var->no_support_one_shot; } }; /* User variables like @my_own_variable */ - class set_var_user: public set_var_base { Item_func_set_user_var *user_var_item; @@ -1404,8 +261,8 @@ class set_var_collation_client: public set_var_base CHARSET_INFO *collation_connection; public: set_var_collation_client(CHARSET_INFO *client_coll_arg, - CHARSET_INFO *connection_coll_arg, - CHARSET_INFO *result_coll_arg) + CHARSET_INFO *connection_coll_arg, + CHARSET_INFO *result_coll_arg) :character_set_client(client_coll_arg), character_set_results(result_coll_arg), collation_connection(connection_coll_arg) @@ -1414,86 +271,26 @@ public: int update(THD *thd); }; - -extern "C" -{ - typedef int (*process_key_cache_t) (const char *, KEY_CACHE *); -} - -/* Named lists (used for keycaches) */ - -class NAMED_LIST :public ilink -{ - const char *name; - uint name_length; -public: - uchar* data; - - NAMED_LIST(I_List *links, const char *name_arg, - uint name_length_arg, uchar* data_arg) - :name_length(name_length_arg), data(data_arg) - { - name= my_strndup(name_arg, name_length, MYF(MY_WME)); - links->push_back(this); - } - inline bool cmp(const char *name_cmp, uint length) - { - return length == name_length && !memcmp(name, name_cmp, length); - } - ~NAMED_LIST() - { - my_free((uchar*) name, MYF(0)); - } - friend bool process_key_caches(process_key_cache_t func); - friend void delete_elements(I_List *list, - void (*free_element)(const char*, uchar*)); -}; - -/* updated in sql_acl.cc */ - -extern sys_var_thd_bool sys_old_alter_table; -extern sys_var_thd_bool sys_old_passwords; -extern LEX_STRING default_key_cache_base; - -/* For sql_yacc */ -struct sys_var_with_base -{ - sys_var *var; - LEX_STRING base_name; -}; - /* Prototypes for helper functions */ -int set_var_init(); -void set_var_free(); -SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted); -int mysql_add_sys_var_chain(sys_var *chain, struct my_option *long_options); -int mysql_del_sys_var_chain(sys_var *chain); +SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type); + sys_var *find_sys_var(THD *thd, const char *str, uint length=0); int sql_set_variables(THD *thd, List *var_list); -bool not_all_support_one_shot(List *var_list); -void fix_delay_key_write(THD *thd, enum_var_type type); -void fix_slave_exec_mode(enum_var_type type); -ulong fix_sql_mode(ulong sql_mode); -extern sys_var_const_str sys_charset_system; -extern sys_var_str sys_init_connect; -extern sys_var_str sys_init_slave; -extern sys_var_thd_time_zone sys_time_zone; -extern sys_var_thd_bit sys_autocommit; + +bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type); + +ulong expand_sql_mode(ulonglong sql_mode); +bool sql_mode_string_representation(THD *thd, ulong sql_mode, LEX_STRING *ls); + +extern sys_var *Sys_autocommit_ptr; + CHARSET_INFO *get_old_charset_by_name(const char *old_name); -uchar* find_named(I_List *list, const char *name, uint length, - NAMED_LIST **found); -extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path; +int sys_var_init(DYNAMIC_ARRAY *long_options); +void sys_var_end(void); -/* key_cache functions */ -KEY_CACHE *get_key_cache(LEX_STRING *cache_name); -KEY_CACHE *get_or_create_key_cache(const char *name, uint length); -void free_key_cache(const char *name, KEY_CACHE *key_cache); -bool process_key_caches(process_key_cache_t func); -void delete_elements(I_List *list, - void (*free_element)(const char*, uchar*)); +#endif -#endif /* SET_VAR_INCLUDED */ diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 03d7ff30f7e..09812583745 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6108,7 +6108,7 @@ ER_TRG_CANT_OPEN_TABLE ER_CANT_CREATE_SROUTINE eng "Cannot create stored routine `%-.64s`. Check warnings" -ER_SLAVE_AMBIGOUS_EXEC_MODE +ER_NEVER_USED eng "Ambiguous slave modes combination. %s" ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT @@ -6260,3 +6260,9 @@ ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD eng "Field '%-.192s' is of a not allowed type for this type of partitioning" ER_PARTITION_FIELDS_TOO_LONG eng "The total length of the partitioning fields is too large" +ER_PATH_LENGTH + eng "The path specified for %.64s is too long." +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." + diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index ab81c122497..84cd6247493 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6109,7 +6109,7 @@ ER_TRG_CANT_OPEN_TABLE ER_CANT_CREATE_SROUTINE eng "Cannot create stored routine `%-.64s`. Check warnings" -ER_SLAVE_AMBIGOUS_EXEC_MODE +ER_NEVER_USED eng "Ambiguous slave modes combination. %s" ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT @@ -6260,3 +6260,9 @@ ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD eng "Field '%-.192s' is of a not allowed type for this type of partitioning" ER_PARTITION_FIELDS_TOO_LONG eng "The total length of the partitioning fields is too large" +ER_PATH_LENGTH + eng "The path specified for %.64s is too long." +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." + diff --git a/sql/slave.cc b/sql/slave.cc index 1cfd54a7dc0..4dea78596ba 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -362,6 +362,9 @@ static void print_slave_skip_errors(void) DBUG_ASSERT(sizeof(slave_skip_error_names) > MIN_ROOM); DBUG_ASSERT(MAX_SLAVE_ERROR <= 999999); // 6 digits + /* Make @@slave_skip_errors show the nice human-readable value. */ + opt_slave_skip_errors= slave_skip_error_names; + if (!use_slave_mask || bitmap_is_clear_all(&slave_error_mask)) { /* purecov: begin tested */ @@ -1871,12 +1874,12 @@ void set_slave_thread_options(THD* thd) when max_join_size is 4G, OPTION_BIG_SELECTS is automatically set, but only for client threads. */ - ulonglong options= thd->options | OPTION_BIG_SELECTS; + ulonglong options= thd->variables.option_bits | OPTION_BIG_SELECTS; if (opt_log_slave_updates) options|= OPTION_BIN_LOG; else options&= ~OPTION_BIN_LOG; - thd->options= options; + thd->variables.option_bits= options; thd->variables.completion_type= 0; DBUG_VOID_RETURN; } @@ -2187,8 +2190,8 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli) ev->get_type_str(), ev->get_type_code(), ev->server_id)); DBUG_PRINT("info", ("thd->options: %s%s; rli->last_event_start_time: %lu", - FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT), - FLAGSTR(thd->options, OPTION_BEGIN), + FLAGSTR(thd->variables.option_bits, OPTION_NOT_AUTOCOMMIT), + FLAGSTR(thd->variables.option_bits, OPTION_BEGIN), rli->last_event_start_time)); /* @@ -2224,7 +2227,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) - --rli->slave_skip_counter; + sql_slave_skip_counter= --rli->slave_skip_counter; pthread_mutex_unlock(&rli->data_lock); if (reason == Log_event::EVENT_SKIP_NOT) exec_res= ev->apply_event(rli); @@ -2244,7 +2247,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli) "skipped because event skip counter was non-zero" }; DBUG_PRINT("info", ("OPTION_BEGIN: %d; IN_STMT: %d", - thd->options & OPTION_BEGIN ? 1 : 0, + test(thd->variables.option_bits & OPTION_BEGIN), rli->get_flag(Relay_log_info::IN_STMT))); DBUG_PRINT("skip_event", ("%s event was %s", ev->get_type_str(), explain[reason])); @@ -3133,9 +3136,9 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME, } /* execute init_slave variable */ - if (sys_init_slave.value_length) + if (opt_init_slave.length) { - execute_init_command(thd, &sys_init_slave, &LOCK_sys_init_slave); + execute_init_command(thd, &opt_init_slave, &LOCK_sys_init_slave); if (thd->is_slave_error) { rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(), diff --git a/sql/slave.h b/sql/slave.h index 8fb44007032..69290ecac0a 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -115,6 +115,7 @@ extern char *master_info_file, *relay_log_info_file; extern char *opt_relay_logname, *opt_relaylog_index_name; extern my_bool opt_skip_slave_start, opt_reckless_slave; extern my_bool opt_log_slave_updates; +extern char *opt_slave_skip_errors; extern ulonglong relay_log_space_limit; /* diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 3f7d812384c..6e69b2e39a4 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -24,6 +24,7 @@ #include "sp_pcontext.h" #include "sp_rcontext.h" #include "sp_cache.h" +#include "set_var.h" /* Sufficient max length of printed destinations and frame offsets (all uints). @@ -1707,7 +1708,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->variables.option_bits & OPTION_BIN_LOG) && !thd->current_stmt_binlog_row_based; /* Remember the original arguments for unrolled replication of functions @@ -1770,8 +1771,8 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, q= global_query_id; pthread_mutex_unlock(&LOCK_thread_count); mysql_bin_log.start_union_events(thd, q + 1); - binlog_save_options= thd->options; - thd->options&= ~OPTION_BIN_LOG; + binlog_save_options= thd->variables.option_bits; + thd->variables.option_bits&= ~OPTION_BIN_LOG; } /* @@ -1791,7 +1792,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, if (need_binlog_call) { mysql_bin_log.stop_union_events(thd); - thd->options= binlog_save_options; + thd->variables.option_bits= binlog_save_options; if (thd->binlog_evt_union.unioned_events) { int errcode = query_error_code(thd, thd->killed == THD::NOT_KILLED); @@ -1984,12 +1985,12 @@ sp_head::execute_procedure(THD *thd, List *args) save_enable_slow_log= true; thd->enable_slow_log= FALSE; } - if (!(m_flags & LOG_GENERAL_LOG) && !(thd->options & OPTION_LOG_OFF)) + if (!(m_flags & LOG_GENERAL_LOG) && !(thd->variables.option_bits & OPTION_LOG_OFF)) { DBUG_PRINT("info", ("Disabling general log for the execution")); save_log_general= true; /* disable this bit */ - thd->options |= OPTION_LOG_OFF; + thd->variables.option_bits |= OPTION_LOG_OFF; } thd->spcont= nctx; @@ -2003,7 +2004,7 @@ sp_head::execute_procedure(THD *thd, List *args) err_status= execute(thd); if (save_log_general) - thd->options &= ~OPTION_LOG_OFF; + thd->variables.option_bits &= ~OPTION_LOG_OFF; if (save_enable_slow_log) thd->enable_slow_log= true; /* @@ -2441,8 +2442,7 @@ sp_head::show_create_routine(THD *thd, int type) if (check_show_routine_access(thd, this, &full_access)) DBUG_RETURN(TRUE); - sys_var_thd_sql_mode::symbolic_mode_representation( - thd, m_sql_mode, &sql_mode); + sql_mode_string_representation(thd, m_sql_mode, &sql_mode); /* Send header. */ @@ -2881,7 +2881,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp) (the order of query cache and subst_spvars calls is irrelevant because queries with SP vars can't be cached) */ - if (unlikely((thd->options & OPTION_LOG_OFF)==0)) + if (unlikely((thd->variables.option_bits & OPTION_LOG_OFF)==0)) general_log_write(thd, COM_QUERY, thd->query(), thd->query_length()); if (query_cache_send_result_to_client(thd, diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 05e8cee9151..4cbae0bbb5a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -31,6 +31,8 @@ #include "sp_head.h" #include "sp.h" +bool mysql_user_table_is_in_short_password_format= false; + static const TABLE_FIELD_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = { { @@ -218,25 +220,6 @@ set_user_salt(ACL_USER *acl_user, const char *password, uint password_len) acl_user->salt_len= 0; } -/* - This after_update function is used when user.password is less than - SCRAMBLE_LENGTH bytes. -*/ - -static void restrict_update_of_old_passwords_var(THD *thd, - enum_var_type var_type) -{ - if (var_type == OPT_GLOBAL) - { - pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.old_passwords= 1; - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - thd->variables.old_passwords= 1; -} - - /* Initialize structures responsible for user/db-level privilege checking and load privilege information for them from tables in the 'mysql' database. @@ -398,7 +381,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) "but server started with --secure-auth option."); goto end; } - sys_old_passwords.after_update= restrict_update_of_old_passwords_var; + mysql_user_table_is_in_short_password_format= true; if (global_system_variables.old_passwords) pthread_mutex_unlock(&LOCK_global_system_variables); else @@ -413,7 +396,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) } else { - sys_old_passwords.after_update= 0; + mysql_user_table_is_in_short_password_format= false; pthread_mutex_unlock(&LOCK_global_system_variables); } diff --git a/sql/sql_acl.h b/sql/sql_acl.h index 25a4766e58c..59409299f73 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -169,6 +169,7 @@ enum mysql_db_table_field }; extern const TABLE_FIELD_DEF mysql_db_table_def; +extern bool mysql_user_table_is_in_short_password_format; /* Classes */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9a778e75a11..348f4305b02 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1365,7 +1365,7 @@ void close_thread_tables(THD *thd) good idea to turn off OPTION_TABLE_LOCK flag. */ DBUG_ASSERT(thd->lex->requires_prelocking()); - thd->options&= ~(OPTION_TABLE_LOCK); + thd->variables.option_bits&= ~(OPTION_TABLE_LOCK); } DBUG_VOID_RETURN; @@ -1445,7 +1445,7 @@ void close_temporary_tables(THD *thd) TABLE *table; TABLE *next= NULL; TABLE *prev_table; - /* Assume thd->options has OPTION_QUOTE_SHOW_CREATE */ + /* Assume thd->variables.option_bits has OPTION_QUOTE_SHOW_CREATE */ bool was_quote_show= TRUE; if (!thd->temporary_tables) @@ -1513,9 +1513,9 @@ void close_temporary_tables(THD *thd) /* We always quote db,table names though it is slight overkill */ if (found_user_tables && - !(was_quote_show= test(thd->options & OPTION_QUOTE_SHOW_CREATE))) + !(was_quote_show= test(thd->variables.option_bits & OPTION_QUOTE_SHOW_CREATE))) { - thd->options |= OPTION_QUOTE_SHOW_CREATE; + thd->variables.option_bits |= OPTION_QUOTE_SHOW_CREATE; } /* scan sorted tmps to generate sequence of DROP */ @@ -1572,7 +1572,7 @@ void close_temporary_tables(THD *thd) } } if (!was_quote_show) - thd->options&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */ + thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */ thd->temporary_tables=0; } @@ -4456,7 +4456,7 @@ bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last, thr_lock_type read_lock_type_for_table(THD *thd, TABLE *table) { - bool log_on= mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG); + 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_PERFORMANCE)) @@ -5151,7 +5151,7 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables) This check here is needed to prevent some spurious error to be raised in some cases (See BUG#42829). */ - if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG) && + if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG) && (thd->variables.binlog_format != BINLOG_FORMAT_STMT || binlog_filter->db_ok(thd->db))) { @@ -5193,7 +5193,7 @@ 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", + DBUG_PRINT("info", ("thd->variables.binlog_format: %u", thd->variables.binlog_format)); DBUG_PRINT("info", ("multi_engine: %s", multi_engine ? "TRUE" : "FALSE")); @@ -5334,7 +5334,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) if (thd->lex->requires_prelocking()) { thd->in_lock_tables=1; - thd->options|= OPTION_TABLE_LOCK; + thd->variables.option_bits|= OPTION_TABLE_LOCK; /* A query that modifies autoinc column in sub-statement can make the master and slave inconsistent. @@ -5355,7 +5355,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) { if (thd->lex->requires_prelocking()) { - thd->options&= ~(OPTION_TABLE_LOCK); + thd->variables.option_bits&= ~(OPTION_TABLE_LOCK); thd->in_lock_tables=0; } DBUG_RETURN(-1); @@ -5398,7 +5398,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) { mysql_unlock_tables(thd, thd->locked_tables); thd->locked_tables= 0; - thd->options&= ~(OPTION_TABLE_LOCK); + thd->variables.option_bits&= ~(OPTION_TABLE_LOCK); DBUG_RETURN(-1); } } diff --git a/sql/sql_builtin.cc.in b/sql/sql_builtin.cc.in index 3becdbaccfe..f8767949fe3 100644 --- a/sql/sql_builtin.cc.in +++ b/sql/sql_builtin.cc.in @@ -18,10 +18,16 @@ typedef struct st_mysql_plugin builtin_plugin[]; extern builtin_plugin - builtin_binlog_plugin@mysql_plugin_defs@; + @mysql_mandatory_plugins@ @mysql_optional_plugins@ builtin_binlog_plugin; -struct st_mysql_plugin *mysqld_builtins[]= +struct st_mysql_plugin *mysql_optional_plugins[]= { - builtin_binlog_plugin@mysql_plugin_defs@,(struct st_mysql_plugin *)0 + @mysql_optional_plugins@ 0 }; +struct st_mysql_plugin *mysql_mandatory_plugins[]= +{ + builtin_binlog_plugin, @mysql_mandatory_plugins@ 0 +}; + + diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 40316299366..07d36b1551a 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -407,13 +407,6 @@ static void debug_wait_for_kill(const char *info) #define DUMP(C) #endif -const char *query_cache_type_names[]= { "OFF", "ON", "DEMAND",NullS }; -TYPELIB query_cache_type_typelib= -{ - array_elements(query_cache_type_names)-1,"", query_cache_type_names, NULL -}; - - /** Serialize access to the query cache. If the lock cannot be granted the thread hangs in a conditional wait which @@ -1074,12 +1067,12 @@ Query_cache::Query_cache(ulong query_cache_limit_arg, :query_cache_size(0), query_cache_limit(query_cache_limit_arg), queries_in_cache(0), hits(0), inserts(0), refused(0), - total_blocks(0), lowmem_prunes(0), + total_blocks(0), lowmem_prunes(0), m_query_cache_is_disabled(FALSE), min_allocation_unit(ALIGN_SIZE(min_allocation_unit_arg)), min_result_data_size(ALIGN_SIZE(min_result_data_size_arg)), def_query_hash_size(ALIGN_SIZE(def_query_hash_size_arg)), def_table_hash_size(ALIGN_SIZE(def_table_hash_size_arg)), - initialized(0), m_query_cache_is_disabled(FALSE) + initialized(0) { ulong min_needed= (ALIGN_SIZE(sizeof(Query_cache_block)) + ALIGN_SIZE(sizeof(Query_cache_block_table)) + @@ -1548,7 +1541,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d", } DBUG_PRINT("qcache", ("Query have result 0x%lx", (ulong) query)); - if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && + if ((thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && (query->tables_type() & HA_CACHE_TBL_TRANSACT)) { DBUG_PRINT("qcache", @@ -1706,7 +1699,7 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used, DBUG_VOID_RETURN; using_transactions= using_transactions && - (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); for (; tables_used; tables_used= tables_used->next_local) { DBUG_ASSERT(!using_transactions || tables_used->table!=0); @@ -1791,7 +1784,7 @@ void Query_cache::invalidate(THD *thd, TABLE *table, DBUG_VOID_RETURN; using_transactions= using_transactions && - (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); if (using_transactions && (table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT)) thd->add_changed_table(table); @@ -1810,7 +1803,7 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length, DBUG_VOID_RETURN; using_transactions= using_transactions && - (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); if (using_transactions) // used for innodb => has_transactions() is TRUE thd->add_changed_table(key, key_length); else @@ -2159,7 +2152,7 @@ ulong Query_cache::init_cache() (void) my_hash_init(&queries, &my_charset_bin, def_query_hash_size, 0, 0, query_cache_query_get_key, 0, 0); -#ifndef FN_NO_CASE_SENCE +#ifndef FN_NO_CASE_SENSE /* If lower_case_table_names!=0 then db and table names are already converted to lower case and we can use binary collation for their @@ -3580,7 +3573,7 @@ Query_cache::is_cacheable(THD *thd, size_t query_len, const char *query, tables_type))) DBUG_RETURN(0); - if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && + if ((thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && ((*tables_type)&HA_CACHE_TBL_TRANSACT)) { DBUG_PRINT("qcache", ("not in autocommin mode")); diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 695d6fb4db3..33e535b2580 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -503,5 +503,4 @@ protected: }; extern Query_cache query_cache; -extern TYPELIB query_cache_type_typelib; #endif diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 019c22d9dd2..53a96f8b9d9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -296,7 +296,7 @@ void **thd_ha_data(const THD *thd, const struct handlerton *hton) extern "C" long long thd_test_options(const THD *thd, long long test_options) { - return thd->options & test_options; + return thd->variables.option_bits & test_options; } extern "C" @@ -684,7 +684,7 @@ void THD::raise_note(uint sql_errno) { DBUG_ENTER("THD::raise_note"); DBUG_PRINT("enter", ("code: %d", sql_errno)); - if (!(this->options & OPTION_SQL_NOTES)) + if (!(variables.option_bits & OPTION_SQL_NOTES)) DBUG_VOID_RETURN; const char* msg= ER(sql_errno); (void) raise_condition(sql_errno, @@ -700,7 +700,7 @@ void THD::raise_note_printf(uint sql_errno, ...) char ebuff[MYSQL_ERRMSG_SIZE]; DBUG_ENTER("THD::raise_note_printf"); DBUG_PRINT("enter",("code: %u", sql_errno)); - if (!(this->options & OPTION_SQL_NOTES)) + if (!(variables.option_bits & OPTION_SQL_NOTES)) DBUG_VOID_RETURN; const char* format= ER(sql_errno); va_start(args, sql_errno); @@ -721,7 +721,7 @@ MYSQL_ERROR* THD::raise_condition(uint sql_errno, MYSQL_ERROR *cond= NULL; DBUG_ENTER("THD::raise_condition"); - if (!(this->options & OPTION_SQL_NOTES) && + if (!(variables.option_bits & OPTION_SQL_NOTES) && (level == MYSQL_ERROR::WARN_LEVEL_NOTE)) DBUG_RETURN(NULL); @@ -887,12 +887,6 @@ void THD::init(void) { pthread_mutex_lock(&LOCK_global_system_variables); plugin_thdvar_init(this); - variables.time_format= date_time_format_copy((THD*) 0, - variables.time_format); - variables.date_format= date_time_format_copy((THD*) 0, - variables.date_format); - variables.datetime_format= date_time_format_copy((THD*) 0, - variables.datetime_format); /* variables= global_system_variables above has reset variables.pseudo_thread_id to 0. We need to correct it here to @@ -903,12 +897,6 @@ void THD::init(void) server_status= SERVER_STATUS_AUTOCOMMIT; if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; - options= thd_startup_options; - - if (variables.max_join_size == HA_POS_ERROR) - options |= OPTION_BIG_SELECTS; - else - options &= ~OPTION_BIG_SELECTS; transaction.all.modified_non_trans_table= transaction.stmt.modified_non_trans_table= FALSE; open_options=ha_open_options; @@ -919,7 +907,7 @@ void THD::init(void) update_charset(); reset_current_stmt_binlog_row_based(); bzero((char *) &status_var, sizeof(status_var)); - sql_log_bin_toplevel= options & OPTION_BIN_LOG; + sql_log_bin_toplevel= variables.option_bits & OPTION_BIN_LOG; #if defined(ENABLED_DEBUG_SYNC) /* Initialize the Debug Sync Facility. See debug_sync.cc. */ @@ -1012,10 +1000,6 @@ void THD::cleanup(void) delete_dynamic(&user_var_events); my_hash_free(&user_vars); close_temporary_tables(this); - my_free((char*) variables.time_format, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) variables.date_format, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) variables.datetime_format, MYF(MY_ALLOW_ZERO_PTR)); - sp_cache_clear(&sp_proc_cache); sp_cache_clear(&sp_func_cache); @@ -1384,15 +1368,21 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs) void THD::update_charset() { uint32 not_used; - charset_is_system_charset= !String::needs_conversion(0,charset(), - system_charset_info, - ¬_used); + charset_is_system_charset= + !String::needs_conversion(0, + variables.character_set_client, + system_charset_info, + ¬_used); charset_is_collation_connection= - !String::needs_conversion(0,charset(),variables.collation_connection, + !String::needs_conversion(0, + variables.character_set_client, + variables.collation_connection, ¬_used); charset_is_character_set_filesystem= - !String::needs_conversion(0, charset(), - variables.character_set_filesystem, ¬_used); + !String::needs_conversion(0, + variables.character_set_client, + variables.character_set_filesystem, + ¬_used); } @@ -1415,8 +1405,8 @@ void THD::add_changed_table(TABLE *table) { DBUG_ENTER("THD::add_changed_table(table)"); - DBUG_ASSERT((options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && - table->file->has_transactions()); + DBUG_ASSERT(variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + DBUG_ASSERT(table->file->has_transactions()); add_changed_table(table->s->table_cache_key.str, (long) table->s->table_cache_key.length); DBUG_VOID_RETURN; @@ -3100,7 +3090,7 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd) extern "C" int thd_binlog_format(const MYSQL_THD thd) { - if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG)) + if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG)) return (int) thd->variables.binlog_format; else return BINLOG_FORMAT_UNSPEC; @@ -3161,7 +3151,7 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup, } #endif - backup->options= options; + backup->option_bits= variables.option_bits; backup->in_sub_stmt= in_sub_stmt; backup->enable_slow_log= enable_slow_log; backup->limit_found_rows= limit_found_rows; @@ -3178,10 +3168,10 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup, if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) && !current_stmt_binlog_row_based) { - options&= ~OPTION_BIN_LOG; + variables.option_bits&= ~OPTION_BIN_LOG; } - if ((backup->options & OPTION_BIN_LOG) && is_update_query(lex->sql_command)&& + if ((backup->option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command)&& !current_stmt_binlog_row_based) mysql_bin_log.start_union_events(this, this->query_id); @@ -3225,7 +3215,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) (void)ha_release_savepoint(this, sv); } transaction.savepoints= backup->savepoints; - options= backup->options; + variables.option_bits= backup->option_bits; in_sub_stmt= backup->in_sub_stmt; enable_slow_log= backup->enable_slow_log; first_successful_insert_id_in_prev_stmt= @@ -3243,7 +3233,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) if (!in_sub_stmt) is_fatal_sub_stmt_error= FALSE; - if ((options & OPTION_BIN_LOG) && is_update_query(lex->sql_command) && + if ((variables.option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command) && !current_stmt_binlog_row_based) mysql_bin_log.stop_union_events(this); diff --git a/sql/sql_class.h b/sql/sql_class.h index d3e3f2a48b6..03f06e5aa26 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -309,7 +309,7 @@ class Time_zone; #define THD_CHECK_SENTRY(thd) DBUG_ASSERT(thd->dbug_sentry == THD_SENTRY_MAGIC) -struct system_variables +typedef struct system_variables { /* How dynamically allocated system variables are handled: @@ -326,10 +326,12 @@ struct system_variables uint dynamic_variables_size; /* how many bytes are in use */ ulonglong myisam_max_extra_sort_file_size; - ulonglong myisam_max_sort_file_size; ulonglong max_heap_table_size; ulonglong tmp_table_size; ulonglong long_query_time; + ulonglong optimizer_switch; + ulonglong sql_mode; ///< which non-standard SQL behaviour should be enabled + ulonglong option_bits; ///< OPTION_xxx constants, e.g. OPTION_PROFILING ha_rows select_limit; ha_rows max_join_size; ulong auto_increment_increment, auto_increment_offset; @@ -343,9 +345,6 @@ struct system_variables ulong max_insert_delayed_threads; ulong min_examined_row_limit; ulong multi_range_count; - ulong myisam_repair_threads; - ulong myisam_sort_buff_size; - ulong myisam_stats_method; ulong net_buffer_length; ulong net_interactive_timeout; ulong net_read_timeout; @@ -354,23 +353,13 @@ struct system_variables ulong net_write_timeout; ulong optimizer_prune_level; ulong optimizer_search_depth; - /* A bitmap for switching optimizations on/off */ - ulong optimizer_switch; ulong preload_buff_size; ulong profiling_history_size; - ulong query_cache_type; ulong read_buff_size; ulong read_rnd_buff_size; ulong div_precincrement; ulong sortbuff_size; - ulong thread_handling; - ulong tx_isolation; - ulong completion_type; - /* Determines which non-standard SQL behaviour should be enabled */ - ulong sql_mode; ulong max_sp_recursion_depth; - /* check of key presence in updatable view */ - ulong updatable_views_with_limit; ulong default_week_format; ulong max_seeks_for_key; ulong range_alloc_block_size; @@ -380,11 +369,14 @@ struct system_variables ulong trans_prealloc_size; ulong log_warnings; ulong group_concat_max_len; - ulong ndb_autoincrement_prefetch_sz; - ulong ndb_index_stat_cache_entries; - ulong ndb_index_stat_update_freq; - ulong binlog_format; // binlog format for this thd (see enum_binlog_format) - /* + + uint binlog_format; ///< binlog format for this thd (see enum_binlog_format) + uint completion_type; + uint query_cache_type; + uint tx_isolation; + uint updatable_views_with_limit; + uint max_user_connections; + /** In slave thread we need to know in behalf of which thread the query is being run to replicate temp tables properly */ @@ -392,22 +384,13 @@ struct system_variables my_bool low_priority_updates; my_bool new_mode; - /* - compatibility option: - - index usage hints (USE INDEX without a FOR clause) behave as in 5.0 - */ - my_bool old_mode; my_bool query_cache_wlock_invalidate; my_bool engine_condition_pushdown; my_bool keep_files_on_create; - my_bool ndb_force_send; - my_bool ndb_use_copying_alter_table; - my_bool ndb_use_exact_count; - my_bool ndb_use_transactions; - my_bool ndb_index_stat_enable; my_bool old_alter_table; my_bool old_passwords; + my_bool big_tables; plugin_ref table_plugin; @@ -428,12 +411,10 @@ struct system_variables Time_zone *time_zone; - /* DATE, DATETIME and MYSQL_TIME formats */ - DATE_TIME_FORMAT *date_format; - DATE_TIME_FORMAT *datetime_format; - DATE_TIME_FORMAT *time_format; my_bool sysdate_is_now; -}; + + double long_query_time_double; +} SV; /* per thread status variables */ @@ -1015,7 +996,7 @@ public: class Sub_statement_state { public: - ulonglong options; + ulonglong option_bits; ulonglong first_successful_insert_id_in_prev_stmt; ulonglong first_successful_insert_id_in_cur_stmt, insert_id_for_cur_row; Discrete_interval auto_inc_interval_for_cur_row; @@ -1307,7 +1288,6 @@ public: */ const char *where; - double tmp_double_value; /* Used in set_var.cc */ ulong client_capabilities; /* What the client supports */ ulong max_client_packet_length; @@ -1618,7 +1598,6 @@ public: } ulonglong limit_found_rows; - ulonglong options; /* Bitmap of states */ longlong row_count_func; /* For the ROW_COUNT() function */ ha_rows cuted_fields; @@ -2371,10 +2350,10 @@ my_eof(THD *thd) } #define tmp_disable_binlog(A) \ - {ulonglong tmp_disable_binlog__save_options= (A)->options; \ - (A)->options&= ~OPTION_BIN_LOG + {ulonglong tmp_disable_binlog__save_options= (A)->variables.option_bits; \ + (A)->variables.option_bits&= ~OPTION_BIN_LOG -#define reenable_binlog(A) (A)->options= tmp_disable_binlog__save_options;} +#define reenable_binlog(A) (A)->variables.option_bits= tmp_disable_binlog__save_options;} /* diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 8ecafce6f93..a966d4a6bd4 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -121,8 +121,9 @@ int check_for_max_user_connections(THD *thd, USER_CONN *uc) DBUG_ENTER("check_for_max_user_connections"); (void) pthread_mutex_lock(&LOCK_user_conn); - if (max_user_connections && !uc->user_resources.user_conn && - max_user_connections < (uint) uc->connections) + if (global_system_variables.max_user_connections && + !uc->user_resources.user_conn && + global_system_variables.max_user_connections < (uint) uc->connections) { my_error(ER_TOO_MANY_USER_CONNECTIONS, MYF(0), uc->user); error=1; @@ -443,7 +444,7 @@ check_user(THD *thd, enum enum_server_command command, /* Don't allow user to connect if he has done too many queries */ if ((ur.questions || ur.updates || ur.conn_per_hour || ur.user_conn || - max_user_connections) && + global_system_variables.max_user_connections) && get_or_create_user_conn(thd, (opt_old_style_user_limits ? thd->main_security_ctx.user : thd->main_security_ctx.priv_user), @@ -457,7 +458,7 @@ check_user(THD *thd, enum enum_server_command command, if (thd->user_connect && (thd->user_connect->user_resources.conn_per_hour || thd->user_connect->user_resources.user_conn || - max_user_connections) && + global_system_variables.max_user_connections) && check_for_max_user_connections(thd, thd->user_connect)) { /* The error is set in check_for_max_user_connections(). */ @@ -1052,8 +1053,6 @@ static void prepare_new_connection_state(THD* thd) netware_reg_user(sctx->ip, sctx->user, "MySQL"); #endif - if (thd->variables.max_join_size == HA_POS_ERROR) - thd->options |= OPTION_BIG_SELECTS; if (thd->client_capabilities & CLIENT_COMPRESS) thd->net.compress=1; // Use compression @@ -1068,9 +1067,9 @@ static void prepare_new_connection_state(THD* thd) thd->set_time(); thd->init_for_queries(); - if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL)) + if (opt_init_connect.length && !(sctx->master_access & SUPER_ACL)) { - execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect); + execute_init_command(thd, &opt_init_connect, &LOCK_sys_init_connect); if (thd->is_error()) { thd->killed= THD::KILL_CONNECTION; diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index 533b47e61da..66c4460c1cd 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -721,7 +721,7 @@ bool Select_materialize::send_result_set_metadata(List &list, uint flags) { DBUG_ASSERT(table == 0); if (create_result_table(unit->thd, unit->get_unit_column_types(), - FALSE, thd->options | TMP_TABLE_ALL_COLUMNS, "")) + FALSE, thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS, "")) return TRUE; materialized_cursor= new (&table->mem_root) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index ab898950a1d..086aacb495e 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -92,7 +92,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, } const_cond= (!conds || conds->const_item()); - safe_update=test(thd->options & OPTION_SAFE_UPDATES); + safe_update=test(thd->variables.option_bits & OPTION_SAFE_UPDATES); if (safe_update && const_cond) { my_message(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE, @@ -631,7 +631,7 @@ multi_delete::initialize_tables(JOIN *join) Unique **tempfiles_ptr; DBUG_ENTER("initialize_tables"); - if ((thd->options & OPTION_SAFE_UPDATES) && error_if_full_join(join)) + if ((thd->variables.option_bits & OPTION_SAFE_UPDATES) && error_if_full_join(join)) DBUG_RETURN(1); table_map tables_to_delete_from=0; diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 9b747759ece..24088872471 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -154,7 +154,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) if ((res= check_duplicate_names(unit->types, 0))) goto exit; - create_options= (first_select->options | thd->options | + create_options= (first_select->options | thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS); /* Temp table is created so that it hounours if UNION without ALL is to be @@ -289,7 +289,7 @@ bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) (ORDER *) first_select->order_list.first, (ORDER *) first_select->group_list.first, first_select->having, (ORDER*) NULL, - (first_select->options | thd->options | + (first_select->options | thd->variables.option_bits | SELECT_NO_UNLOCK), derived_result, unit, first_select); } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 147e03ddf55..c774cb4f3ad 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -455,7 +455,7 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type, return; } - bool log_on= (thd->options & OPTION_BIN_LOG || + bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG || ! (thd->security_ctx->master_access & SUPER_ACL)); if (global_system_variables.binlog_format == BINLOG_FORMAT_STMT && log_on && mysql_bin_log.is_open() && is_multi_insert) @@ -607,7 +607,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, By default, both logs are enabled (this won't cause problems if the server runs without --log-update or --log-bin). */ - bool log_on= ((thd->options & OPTION_BIN_LOG) || + bool log_on= ((thd->variables.option_bits & OPTION_BIN_LOG) || (!(thd->security_ctx->master_access & SUPER_ACL))); #endif thr_lock_type lock_type; @@ -976,7 +976,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, if (error) goto abort; - if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) || + if (values_list.elements == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) || !thd->cuted_fields)) { thd->row_count_func= info.copied + info.deleted + diff --git a/sql/sql_lex.h b/sql/sql_lex.h index e80d9dfcb3f..27f099ef9ef 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -33,15 +33,23 @@ class sp_pcontext; class st_alter_tablespace; class partition_info; class Event_parse_data; +class set_var_base; +class sys_var; + +/** + used by the parser to store internal variable name +*/ +struct sys_var_with_base +{ + sys_var *var; + LEX_STRING base_name; +}; #ifdef MYSQL_SERVER /* The following hack is needed because mysql_yacc.cc does not define YYSTYPE before including this file */ - -#include "set_var.h" - #ifdef MYSQL_YACC #define LEX_YYSTYPE void * #else diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0774e373908..63a8c17e145 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -30,6 +30,7 @@ #include "sql_trigger.h" #include "sql_prepare.h" #include "probes_mysql.h" +#include "set_var.h" /** @defgroup Runtime_Environment Runtime Environment @@ -134,7 +135,7 @@ static bool xa_trans_rollback(THD *thd) bool status= test(ha_rollback(thd)); - thd->options&= ~(ulong) OPTION_BEGIN; + thd->variables.option_bits&= ~(ulong) OPTION_BEGIN; thd->transaction.all.modified_non_trans_table= FALSE; thd->server_status&= ~SERVER_STATUS_IN_TRANS; xid_cache_delete(&thd->transaction.xid_state); @@ -169,18 +170,18 @@ bool end_active_trans(THD *thd) xa_state_names[thd->transaction.xid_state.xa_state]); DBUG_RETURN(1); } - if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN | + if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN | OPTION_TABLE_LOCK)) { - DBUG_PRINT("info",("options: 0x%llx", thd->options)); + DBUG_PRINT("info",("options: 0x%llx", thd->variables.option_bits)); /* Safety if one did "drop table" on locked tables */ if (!thd->locked_tables) - thd->options&= ~OPTION_TABLE_LOCK; + thd->variables.option_bits&= ~OPTION_TABLE_LOCK; thd->server_status&= ~SERVER_STATUS_IN_TRANS; if (ha_commit(thd)) error=1; } - thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); + thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); thd->transaction.all.modified_non_trans_table= FALSE; DBUG_RETURN(error); } @@ -204,7 +205,7 @@ bool begin_trans(THD *thd) error= -1; else { - thd->options|= OPTION_BEGIN; + thd->variables.option_bits|= OPTION_BEGIN; thd->server_status|= SERVER_STATUS_IN_TRANS; } return error; @@ -374,25 +375,34 @@ bool is_log_table_write_query(enum enum_sql_command command) return (sql_command_flags[command] & CF_WRITE_LOGS_COMMAND) != 0; } -void execute_init_command(THD *thd, sys_var_str *init_command_var, - rw_lock_t *var_mutex) +void execute_init_command(THD *thd, LEX_STRING *init_command, + rw_lock_t *var_lock) { Vio* save_vio; ulong save_client_capabilities; + rw_rdlock(var_lock); + if (!init_command->length) + { + rw_unlock(var_lock); + return; + } + + /* + copy the value under a lock, and release the lock. + init_command has to be executed without a lock held, + as it may try to change itself + */ + size_t len= init_command->length; + char *buf= thd->strmake(init_command->str, len); + rw_unlock(var_lock); + #if defined(ENABLED_PROFILING) thd->profiling.start_new_query(); - thd->profiling.set_query_source(init_command_var->value, - init_command_var->value_length); + thd->profiling.set_query_source(buf, len); #endif thd_proc_info(thd, "Execution of init_command"); - /* - We need to lock init_command_var because - during execution of init_command_var query - values of init_command_var can't be changed - */ - rw_rdlock(var_mutex); save_client_capabilities= thd->client_capabilities; thd->client_capabilities|= CLIENT_MULTI_QUERIES; /* @@ -401,10 +411,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var, */ save_vio= thd->net.vio; thd->net.vio= 0; - dispatch_command(COM_QUERY, thd, - init_command_var->value, - init_command_var->value_length); - rw_unlock(var_mutex); + dispatch_command(COM_QUERY, thd, buf, len); thd->client_capabilities= save_client_capabilities; thd->net.vio= save_vio; @@ -427,9 +434,6 @@ static void handle_bootstrap_impl(THD *thd) thd->thread_stack= (char*) &thd; #endif /* EMBEDDED_LIBRARY */ - if (thd->variables.max_join_size == HA_POS_ERROR) - thd->options |= OPTION_BIG_SELECTS; - thd_proc_info(thd, 0); thd->version=refresh_version; thd->security_ctx->priv_user= @@ -657,7 +661,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion) */ thd->server_status&= ~SERVER_STATUS_IN_TRANS; res= ha_commit(thd); - thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); + thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); thd->transaction.all.modified_non_trans_table= FALSE; break; case COMMIT_RELEASE: @@ -675,7 +679,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion) thd->server_status&= ~SERVER_STATUS_IN_TRANS; if (ha_rollback(thd)) res= -1; - thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); + thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); thd->transaction.all.modified_non_trans_table= FALSE; if (!res && (completion == ROLLBACK_AND_CHAIN)) res= begin_trans(thd); @@ -728,7 +732,7 @@ bool do_command(THD *thd) This thread will do a blocking read from the client which will be interrupted when the next command is received from the client, the connection is closed or "net_wait_timeout" - number of seconds has passed + number of seconds has passed. */ my_net_set_read_timeout(net, thd->variables.net_wait_timeout); @@ -1847,8 +1851,6 @@ bool sp_process_definer(THD *thd) TODO: this is workaround. right way will be move invalidating in the unlock procedure. - TODO: use check_change_password() - - JOIN is not supported yet. TODO - - SUSPEND and FOR MIGRATE are not supported yet. TODO @retval FALSE OK @@ -2541,7 +2543,7 @@ case SQLCOM_PREPARE: { /* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */ if (create_info.options & HA_LEX_CREATE_TMP_TABLE) - thd->options|= OPTION_KEEP_LOG; + thd->variables.option_bits|= OPTION_KEEP_LOG; /* regular create */ if (create_info.options & HA_LEX_CREATE_TABLE_LIKE) res= mysql_create_like_table(thd, create_table, select_tables, @@ -3262,7 +3264,7 @@ end_with_restore_list: select_lex->where, 0, (ORDER *)NULL, (ORDER *)NULL, (Item *)NULL, (ORDER *)NULL, - select_lex->options | thd->options | + select_lex->options | thd->variables.option_bits | SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK | OPTION_SETUP_TABLES_DONE, del_result, unit, select_lex); @@ -3303,7 +3305,7 @@ end_with_restore_list: lex->drop_if_exists= 1; /* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */ - thd->options|= OPTION_KEEP_LOG; + thd->variables.option_bits|= OPTION_KEEP_LOG; } /* DDL and binlog write order protected by LOCK_open */ res= mysql_rm_table(thd, first_table, lex->drop_if_exists, @@ -3392,11 +3394,6 @@ end_with_restore_list: if ((check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE) || open_and_lock_tables(thd, all_tables))) goto error; - if (lex->one_shot_set && not_all_support_one_shot(lex_var_list)) - { - my_error(ER_RESERVED_SYNTAX, MYF(0), "SET ONE_SHOT"); - goto error; - } if (!(res= sql_set_variables(thd, lex_var_list))) { /* @@ -3429,10 +3426,10 @@ end_with_restore_list: false, mysqldump will not work. */ unlock_locked_tables(thd); - if (thd->options & OPTION_TABLE_LOCK) + if (thd->variables.option_bits & OPTION_TABLE_LOCK) { end_active_trans(thd); - thd->options&= ~(OPTION_TABLE_LOCK); + thd->variables.option_bits&= ~OPTION_TABLE_LOCK; } if (thd->global_read_lock) unlock_global_read_lock(thd); @@ -3450,7 +3447,7 @@ end_with_restore_list: !(need_start_waiting= !wait_if_global_read_lock(thd, 0, 1))) goto error; thd->in_lock_tables=1; - thd->options|= OPTION_TABLE_LOCK; + thd->variables.option_bits |= OPTION_TABLE_LOCK; if (!(res= simple_open_n_lock_tables(thd, all_tables))) { @@ -3471,7 +3468,6 @@ end_with_restore_list: */ ha_autocommit_or_rollback(thd, 1); end_active_trans(thd); - thd->options&= ~(OPTION_TABLE_LOCK); } thd->in_lock_tables=0; break; @@ -4037,7 +4033,7 @@ end_with_restore_list: res= TRUE; // cannot happen else { - if (((thd->options & OPTION_KEEP_LOG) || + if (((thd->variables.option_bits & OPTION_KEEP_LOG) || thd->transaction.all.modified_non_trans_table) && !thd->slave_thread) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, @@ -4052,7 +4048,7 @@ end_with_restore_list: break; } case SQLCOM_SAVEPOINT: - if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) || + if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) || thd->in_sub_stmt) || !opt_using_transactions) my_ok(thd); else @@ -4609,7 +4605,7 @@ create_sp_error: break; } if (thd->lex->xa_opt != XA_NONE) - { // JOIN is not supported yet. TODO + { /// @todo JOIN is not supported yet. my_error(ER_XAER_INVAL, MYF(0)); break; } @@ -4635,14 +4631,14 @@ create_sp_error: thd->transaction.xid_state.xid.set(thd->lex->xid); xid_cache_insert(&thd->transaction.xid_state); thd->transaction.all.modified_non_trans_table= FALSE; - thd->options= ((thd->options & ~(OPTION_KEEP_LOG)) | OPTION_BEGIN); + thd->variables.option_bits= ((thd->variables.option_bits & ~(OPTION_KEEP_LOG)) | OPTION_BEGIN); thd->server_status|= SERVER_STATUS_IN_TRANS; my_ok(thd); break; case SQLCOM_XA_END: /* fake it */ if (thd->lex->xa_opt != XA_NONE) - { // SUSPEND and FOR MIGRATE are not supported yet. TODO + { /// @todo SUSPEND and FOR MIGRATE are not supported yet. my_error(ER_XAER_INVAL, MYF(0)); break; } @@ -4741,7 +4737,7 @@ create_sp_error: xa_state_names[thd->transaction.xid_state.xa_state]); break; } - thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); + thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); thd->transaction.all.modified_non_trans_table= FALSE; thd->server_status&= ~SERVER_STATUS_IN_TRANS; xid_cache_delete(&thd->transaction.xid_state); @@ -5470,7 +5466,7 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name, 0, no_errors, 0)) return TRUE; - return check_grant_routine(thd, want_access, tables, is_proc, no_errors); + return check_grant_routine(thd, want_access, tables, is_proc, no_errors); } @@ -5694,9 +5690,9 @@ void mysql_reset_thd_for_next_command(THD *thd) OPTION_STATUS_NO_TRANS_UPDATE | OPTION_KEEP_LOG to not get warnings in ha_rollback_trans() about some tables couldn't be rolled back. */ - if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) + if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { - thd->options&= ~OPTION_KEEP_LOG; + thd->variables.option_bits&= ~OPTION_KEEP_LOG; thd->transaction.all.modified_non_trans_table= FALSE; } DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx); @@ -7305,7 +7301,7 @@ bool multi_delete_precheck(THD *thd, TABLE_LIST *tables) } thd->lex->query_tables_own_last= save_query_tables_own_last; - if ((thd->options & OPTION_SAFE_UPDATES) && !select_lex->where) + if ((thd->variables.option_bits & OPTION_SAFE_UPDATES) && !select_lex->where) { my_message(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE, ER(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE), MYF(0)); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index b6112e51565..a5ae5d24796 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1977,11 +1977,11 @@ static int add_part_field_list(File fptr, List field_list) const char *field_str= part_it++; String field_string("", 0, system_charset_info); THD *thd= current_thd; - ulonglong save_options= thd->options; - thd->options= 0; + ulonglong save_options= thd->variables.option_bits; + thd->variables.option_bits= 0; append_identifier(thd, &field_string, field_str, strlen(field_str)); - thd->options= save_options; + thd->variables.option_bits= save_options; err+= add_string_object(fptr, &field_string); if (i != (num_fields-1)) err+= add_comma(fptr); @@ -1996,12 +1996,12 @@ static int add_name_string(File fptr, const char *name) int err; String name_string("", 0, system_charset_info); THD *thd= current_thd; - ulonglong save_options= thd->options; + ulonglong save_options= thd->variables.option_bits; - thd->options= 0; + thd->variables.option_bits= 0; append_identifier(thd, &name_string, name, strlen(name)); - thd->options= save_options; + thd->variables.option_bits= save_options; err= add_string_object(fptr, &name_string); return err; } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 4d60caf2931..953f0b3c680 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -13,13 +13,14 @@ 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 "sys_vars_shared.h" #include #include #define REPORT_TO_LOG 1 #define REPORT_TO_USER 2 -extern struct st_mysql_plugin *mysqld_builtins[]; +extern struct st_mysql_plugin *mysql_optional_plugins[]; +extern struct st_mysql_plugin *mysql_mandatory_plugins[]; /** @note The order of the enumeration is critical. @@ -164,6 +165,8 @@ struct st_mysql_sys_var MYSQL_PLUGIN_VAR_HEADER; }; +static SHOW_TYPE pluginvar_show_type(st_mysql_sys_var *plugin_var); + /* sys_var class for access to all plugin variables visible to the user @@ -173,28 +176,44 @@ class sys_var_pluginvar: public sys_var public: struct st_plugin_int *plugin; struct st_mysql_sys_var *plugin_var; + /** + variable name from whatever is hard-coded in the plugin source + and doesn't have pluginname- prefix is replaced by an allocated name + with a plugin prefix. When plugin is uninstalled we need to restore the + pointer to point to the hard-coded value, because plugin may be + installed/uninstalled many times without reloading the shared object. + */ + const char *orig_pluginvar_name; static void *operator new(size_t size, MEM_ROOT *mem_root) - { return (void*) alloc_root(mem_root, (uint) size); } + { return (void*) alloc_root(mem_root, size); } static void operator delete(void *ptr_arg,size_t size) { TRASH(ptr_arg, size); } - sys_var_pluginvar(const char *name_arg, + sys_var_pluginvar(sys_var_chain *chain, const char *name_arg, struct st_mysql_sys_var *plugin_var_arg) - :sys_var(name_arg), plugin_var(plugin_var_arg) {} + :sys_var(chain, name_arg, plugin_var_arg->comment, + (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), + plugin_var(plugin_var_arg), orig_pluginvar_name(plugin_var_arg->name) + { plugin_var->name= name_arg; } sys_var_pluginvar *cast_pluginvar() { return this; } - bool is_readonly() const { return plugin_var->flags & PLUGIN_VAR_READONLY; } - bool check_type(enum_var_type type) - { return !(plugin_var->flags & PLUGIN_VAR_THDLOCAL) && type != OPT_GLOBAL; } bool check_update_type(Item_result type); SHOW_TYPE show_type(); uchar* real_value_ptr(THD *thd, enum_var_type type); TYPELIB* plugin_var_typelib(void); - uchar* value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - bool check(THD *thd, set_var *var); - bool check_default(enum_var_type type) { return is_readonly(); } - void set_default(THD *thd, enum_var_type type); - bool update(THD *thd, set_var *var); + uchar* do_value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar* session_value_ptr(THD *thd, LEX_STRING *base) + { return do_value_ptr(thd, OPT_SESSION, base); } + uchar* global_value_ptr(THD *thd, LEX_STRING *base) + { return do_value_ptr(thd, OPT_GLOBAL, base); } + bool do_check(THD *thd, set_var *var); + virtual void session_save_default(THD *thd, set_var *var) {} + virtual void global_save_default(THD *thd, set_var *var) {} + bool session_update(THD *thd, set_var *var); + bool global_update(THD *thd, set_var *var); }; @@ -209,8 +228,9 @@ static bool register_builtin(struct st_mysql_plugin *, struct st_plugin_int *, static void unlock_variables(THD *thd, struct system_variables *vars); static void cleanup_variables(THD *thd, struct system_variables *vars); static void plugin_vars_free_values(sys_var *vars); -static void plugin_opt_set_limits(struct my_option *options, - const struct st_mysql_sys_var *opt); +static void restore_pluginvar_names(sys_var *first); +static void plugin_opt_set_limits(struct my_option *, + const struct st_mysql_sys_var *); #define my_intern_plugin_lock(A,B) intern_plugin_lock(A,B CALLER_INFO) #define my_intern_plugin_lock_ci(A,B) intern_plugin_lock(A,B ORIG_CALLER_INFO) static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin @@ -218,12 +238,6 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin static void intern_plugin_unlock(LEX *lex, plugin_ref plugin); static void reap_plugins(void); - -/* declared in set_var.cc */ -extern sys_var *intern_find_sys_var(const char *str, uint length, bool no_error); -extern bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd, - const char *name, longlong val); - #ifdef EMBEDDED_LIBRARY /* declared in sql_base.cc */ extern bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists); @@ -289,6 +303,11 @@ static int item_val_int(struct st_mysql_value *value, long long *buf) return 0; } +static int item_is_unsigned(struct st_mysql_value *value) +{ + Item *item= ((st_item_value_holder*)value)->item; + return item->unsigned_flag; +} static int item_val_real(struct st_mysql_value *value, double *buf) { @@ -617,10 +636,10 @@ bool plugin_is_ready(const LEX_STRING *name, int type) } -SHOW_COMP_OPTION sys_var_have_plugin::get_option() +SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type) { - LEX_STRING plugin_name= { (char *) plugin_name_str, plugin_name_len }; - return plugin_status(&plugin_name, plugin_type); + LEX_STRING plugin_name= { (char *) name, len }; + return plugin_status(&plugin_name, type); } @@ -776,6 +795,7 @@ static bool plugin_add(MEM_ROOT *tmp_root, tmp_plugin_ptr->state= PLUGIN_IS_FREED; } mysql_del_sys_var_chain(tmp.system_vars); + restore_pluginvar_names(tmp.system_vars); goto err; /* plugin was disabled */ @@ -802,12 +822,12 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) if (plugin->plugin->status_vars) { #ifdef FIX_LATER - /* - We have a problem right now where we can not prepend without - breaking backwards compatibility. We will fix this shortly so - that engines have "use names" and we wil use those for - CREATE TABLE, and use the plugin name then for adding automatic - variable names. + /** + @todo + unfortunately, status variables were introduced without a + pluginname_ namespace, that is pluginname_ was not added automatically + to status variable names. It should be fixed together with the next + incompatible API change. */ SHOW_VAR array[2]= { {plugin->plugin->name, (char*)plugin->plugin->status_vars, SHOW_ARRAY}, @@ -847,21 +867,21 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) plugin->name.str, plugin->ref_count); } - static void plugin_del(struct st_plugin_int *plugin) { DBUG_ENTER("plugin_del(plugin)"); safe_mutex_assert_owner(&LOCK_plugin); /* Free allocated strings before deleting the plugin. */ + rw_wrlock(&LOCK_system_variables_hash); + mysql_del_sys_var_chain(plugin->system_vars); + rw_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); if (plugin->plugin_dl) plugin_dl_del(&plugin->plugin_dl->dl); plugin->state= PLUGIN_IS_FREED; plugin_array_version++; - rw_wrlock(&LOCK_system_variables_hash); - mysql_del_sys_var_chain(plugin->system_vars); - rw_unlock(&LOCK_system_variables_hash); free_root(&plugin->mem_root, MYF(0)); DBUG_VOID_RETURN; } @@ -1002,6 +1022,7 @@ void plugin_unlock_list(THD *thd, plugin_ref *list, uint count) static int plugin_initialize(struct st_plugin_int *plugin) { + int ret= 1; DBUG_ENTER("plugin_initialize"); safe_mutex_assert_owner(&LOCK_plugin); @@ -1063,9 +1084,15 @@ static int plugin_initialize(struct st_plugin_int *plugin) } } - DBUG_RETURN(0); + ret= 0; + err: - DBUG_RETURN(1); + /* maintain the obsolete @@have_innodb variable */ + if (!my_strcasecmp(&my_charset_latin1, plugin->name.str, "InnoDB")) + have_innodb= plugin->state & PLUGIN_IS_READY ? SHOW_OPTION_YES + : SHOW_OPTION_DISABLED; + + DBUG_RETURN(ret); } @@ -1120,7 +1147,8 @@ int plugin_init(int *argc, char **argv, int flags) struct st_mysql_plugin *plugin; struct st_plugin_int tmp, *plugin_ptr, **reap; MEM_ROOT tmp_root; - bool reaped_mandatory_plugin= FALSE; + bool reaped_mandatory_plugin= false; + bool mandatory= true; DBUG_ENTER("plugin_init"); if (initialized) @@ -1156,8 +1184,15 @@ int plugin_init(int *argc, char **argv, int flags) /* First we register builtin plugins */ - for (builtins= mysqld_builtins; *builtins; builtins++) + for (builtins= mysql_mandatory_plugins; *builtins || mandatory; builtins++) { + if (!*builtins) + { + builtins= mysql_optional_plugins; + mandatory= false; + if (!*builtins) + break; + } for (plugin= *builtins; plugin->info; plugin++) { if (opt_ignore_builtin_innodb && @@ -1169,6 +1204,7 @@ int plugin_init(int *argc, char **argv, int flags) tmp.name.str= (char *)plugin->name; tmp.name.length= strlen(plugin->name); tmp.state= 0; + tmp.is_mandatory= mandatory; free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE)); if (test_plugin_options(&tmp_root, &tmp, argc, argv)) tmp.state= PLUGIN_IS_DISABLED; @@ -1183,7 +1219,7 @@ int plugin_init(int *argc, char **argv, int flags) my_strcasecmp(&my_charset_latin1, plugin->name, "CSV")) continue; - if (plugin_ptr->state == PLUGIN_IS_UNINITIALIZED && + if (plugin_ptr->state != PLUGIN_IS_UNINITIALIZED || plugin_initialize(plugin_ptr)) goto err_unlock; @@ -1292,7 +1328,6 @@ static bool register_builtin(struct st_mysql_plugin *plugin, DBUG_RETURN(0); } - #ifdef NOT_USED_YET /* Register a plugin at run time. (note, this doesn't initialize a plugin) @@ -1325,7 +1360,10 @@ bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin) goto end; tmp.state= PLUGIN_IS_UNINITIALIZED; if ((result= register_builtin(plugin, &tmp, &ptr))) + { mysql_del_sys_var_chain(tmp.system_vars); + restore_pluginvar_names(tmp.system_vars); + } end: rw_unlock(&LOCK_system_variables_hash); @@ -1900,7 +1938,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { char buff[STRING_BUFFER_USUAL_SIZE]; - const char *strvalue= "NULL", *str; + const char *str; int result, length; long long tmp; @@ -1909,28 +1947,19 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, length= sizeof(buff); if (!(str= value->val_str(value, buff, &length)) || (result= find_type(&bool_typelib, str, length, 1)-1) < 0) - { - if (str) - strvalue= str; goto err; - } } else { if (value->val_int(value, &tmp) < 0) goto err; if (tmp > 1) - { - llstr(tmp, buff); - strvalue= buff; goto err; - } result= (int) tmp; } *(my_bool *) save= -result; return 0; err: - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue); return 1; } @@ -1938,60 +1967,87 @@ err: static int check_func_int(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - my_bool fixed; - long long tmp; + my_bool fixed1, fixed2; + long long orig, val; struct my_option options; - value->val_int(value, &tmp); + value->val_int(value, &orig); + val= orig; plugin_opt_set_limits(&options, var); if (var->flags & PLUGIN_VAR_UNSIGNED) - *(uint *)save= (uint) getopt_ull_limit_value((ulonglong) tmp, &options, - &fixed); + { + if ((fixed1= (!value->is_unsigned(value) && val < 0))) + val=0; + *(uint *)save= (uint) getopt_ull_limit_value((ulonglong) val, &options, + &fixed2); + } else - *(int *)save= (int) getopt_ll_limit_value(tmp, &options, &fixed); + { + if ((fixed1= (value->is_unsigned(value) && val < 0))) + val=LONGLONG_MAX; + *(int *)save= (int) getopt_ll_limit_value(val, &options, &fixed2); + } - return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED, - var->name, (longlong) tmp); + return throw_bounds_warning(thd, var->name, fixed1 || fixed2, + value->is_unsigned(value), (longlong) orig); } static int check_func_long(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - my_bool fixed; - long long tmp; + my_bool fixed1, fixed2; + long long orig, val; struct my_option options; - value->val_int(value, &tmp); + value->val_int(value, &orig); + val= orig; plugin_opt_set_limits(&options, var); if (var->flags & PLUGIN_VAR_UNSIGNED) - *(ulong *)save= (ulong) getopt_ull_limit_value((ulonglong) tmp, &options, - &fixed); + { + if ((fixed1= (!value->is_unsigned(value) && val < 0))) + val=0; + *(ulong *)save= (ulong) getopt_ull_limit_value((ulonglong) val, &options, + &fixed2); + } else - *(long *)save= (long) getopt_ll_limit_value(tmp, &options, &fixed); + { + if ((fixed1= (value->is_unsigned(value) && val < 0))) + val=LONGLONG_MAX; + *(long *)save= (long) getopt_ll_limit_value(val, &options, &fixed2); + } - return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED, - var->name, (longlong) tmp); + return throw_bounds_warning(thd, var->name, fixed1 || fixed2, + value->is_unsigned(value), (longlong) orig); } static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - my_bool fixed; - long long tmp; + my_bool fixed1, fixed2; + long long orig, val; struct my_option options; - value->val_int(value, &tmp); + value->val_int(value, &orig); + val= orig; plugin_opt_set_limits(&options, var); if (var->flags & PLUGIN_VAR_UNSIGNED) - *(ulonglong *)save= getopt_ull_limit_value((ulonglong) tmp, &options, - &fixed); + { + if ((fixed1= (!value->is_unsigned(value) && val < 0))) + val=0; + *(ulonglong *)save= getopt_ull_limit_value((ulonglong) val, &options, + &fixed2); + } else - *(longlong *)save= getopt_ll_limit_value(tmp, &options, &fixed); + { + if ((fixed1= (value->is_unsigned(value) && val < 0))) + val=LONGLONG_MAX; + *(longlong *)save= getopt_ll_limit_value(val, &options, &fixed2); + } - return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED, - var->name, (longlong) tmp); + return throw_bounds_warning(thd, var->name, fixed1 || fixed2, + value->is_unsigned(value), (longlong) orig); } static int check_func_str(THD *thd, struct st_mysql_sys_var *var, @@ -2013,7 +2069,7 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { char buff[STRING_BUFFER_USUAL_SIZE]; - const char *strvalue= "NULL", *str; + const char *str; TYPELIB *typelib; long long tmp; long result; @@ -2029,28 +2085,20 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var, length= sizeof(buff); if (!(str= value->val_str(value, buff, &length))) goto err; - if ((result= (long)find_type(typelib, str, length, 1)-1) < 0) - { - strvalue= str; + if ((result= (long)find_type(typelib, str, length, 0) - 1) < 0) goto err; - } } else { if (value->val_int(value, &tmp)) goto err; - if (tmp >= typelib->count) - { - llstr(tmp, buff); - strvalue= buff; + if (tmp < 0 || tmp >= typelib->count) goto err; - } result= (long) tmp; } *(long*)save= result; return 0; err: - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue); return 1; } @@ -2059,7 +2107,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { char buff[STRING_BUFFER_USUAL_SIZE], *error= 0; - const char *strvalue= "NULL", *str; + const char *str; TYPELIB *typelib; ulonglong result; uint error_len= 0; // init as only set on error @@ -2079,11 +2127,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var, result= find_set(typelib, str, length, NULL, &error, &error_len, ¬_used); if (error_len) - { - strmake(buff, error, min(sizeof(buff), error_len)); - strvalue= buff; goto err; - } } else { @@ -2091,16 +2135,11 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var, goto err; if (unlikely((result >= (ULL(1) << typelib->count)) && (typelib->count < sizeof(long)*8))) - { - llstr(result, buff); - strvalue= buff; goto err; - } } *(ulonglong*)save= result; return 0; err: - my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue); return 1; } @@ -2160,7 +2199,7 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length) pthread_mutex_lock(&LOCK_plugin); rw_rdlock(&LOCK_system_variables_hash); - if ((var= intern_find_sys_var(str, length, false)) && + if ((var= intern_find_sys_var(str, length)) && (pi= var->cast_pluginvar())) { rw_unlock(&LOCK_system_variables_hash); @@ -2183,7 +2222,7 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length) If the variable exists but the plugin it is associated with is not ready then the intern_plugin_lock did not raise an error, so we do it here. */ - if (pi && !var) + if (!var) my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str); DBUG_RETURN(var); } @@ -2333,6 +2372,15 @@ static st_bookmark *register_var(const char *plugin, const char *name, return result; } +static void restore_pluginvar_names(sys_var *first) +{ + for (sys_var *var= first; var; var= var->next) + { + sys_var_pluginvar *pv= var->cast_pluginvar(); + pv->plugin_var->name= pv->orig_pluginvar_name; + } +} + /* returns a pointer to the memory which holds the thd-local variable or @@ -2386,7 +2434,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) st_bookmark *v= (st_bookmark*) my_hash_element(&bookmark_hash,idx); if (v->version <= thd->variables.dynamic_variables_version || - !(var= intern_find_sys_var(v->key + 1, v->name_len, true)) || + !(var= intern_find_sys_var(v->key + 1, v->name_len)) || !(pi= var->cast_pluginvar()) || v->key[0] != (pi->plugin_var->flags & PLUGIN_VAR_TYPEMASK)) continue; @@ -2479,7 +2527,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars) { v= (st_bookmark*) my_hash_element(&bookmark_hash, idx); if (v->version > vars->dynamic_variables_version || - !(var= intern_find_sys_var(v->key + 1, v->name_len, true)) || + !(var= intern_find_sys_var(v->key + 1, v->name_len)) || !(pivar= var->cast_pluginvar()) || v->key[0] != (pivar->plugin_var->flags & PLUGIN_VAR_TYPEMASK)) continue; @@ -2558,7 +2606,7 @@ static void plugin_vars_free_values(sys_var *vars) /* Free the string from global_system_variables. */ char **valptr= (char**) piv->real_value_ptr(NULL, OPT_GLOBAL); DBUG_PRINT("plugin", ("freeing value for: '%s' addr: 0x%lx", - var->name, (long) valptr)); + var->name.str, (long) valptr)); my_free(*valptr, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); *valptr= NULL; } @@ -2566,25 +2614,7 @@ static void plugin_vars_free_values(sys_var *vars) DBUG_VOID_RETURN; } - -bool sys_var_pluginvar::check_update_type(Item_result type) -{ - if (is_readonly()) - return 1; - switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) { - case PLUGIN_VAR_INT: - case PLUGIN_VAR_LONG: - case PLUGIN_VAR_LONGLONG: - return type != INT_RESULT; - case PLUGIN_VAR_STR: - return type != STRING_RESULT; - default: - return 0; - } -} - - -SHOW_TYPE sys_var_pluginvar::show_type() +static SHOW_TYPE pluginvar_show_type(st_mysql_sys_var *plugin_var) { switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) { case PLUGIN_VAR_BOOL: @@ -2607,6 +2637,25 @@ SHOW_TYPE sys_var_pluginvar::show_type() } +bool sys_var_pluginvar::check_update_type(Item_result type) +{ + switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) { + case PLUGIN_VAR_INT: + case PLUGIN_VAR_LONG: + case PLUGIN_VAR_LONGLONG: + return type != INT_RESULT; + case PLUGIN_VAR_STR: + return type != STRING_RESULT; + case PLUGIN_VAR_ENUM: + case PLUGIN_VAR_BOOL: + case PLUGIN_VAR_SET: + return type != STRING_RESULT && type != INT_RESULT; + default: + return true; + } +} + + uchar* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type) { DBUG_ASSERT(thd || (type == OPT_GLOBAL)); @@ -2639,8 +2688,8 @@ TYPELIB* sys_var_pluginvar::plugin_var_typelib(void) } -uchar* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) +uchar* sys_var_pluginvar::do_value_ptr(THD *thd, enum_var_type type, + LEX_STRING *base) { uchar* result; @@ -2649,139 +2698,104 @@ uchar* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type, if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_ENUM) result= (uchar*) get_type(plugin_var_typelib(), *(ulong*)result); else if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_SET) - { - char buffer[STRING_BUFFER_USUAL_SIZE]; - String str(buffer, sizeof(buffer), system_charset_info); - TYPELIB *typelib= plugin_var_typelib(); - ulonglong mask= 1, value= *(ulonglong*) result; - uint i; - - str.length(0); - for (i= 0; i < typelib->count; i++, mask<<=1) - { - if (!(value & mask)) - continue; - str.append(typelib->type_names[i], typelib->type_lengths - ? typelib->type_lengths[i] - : strlen(typelib->type_names[i])); - str.append(','); - } - - result= (uchar*) ""; - if (str.length()) - result= (uchar*) thd->strmake(str.ptr(), str.length()-1); - } + result= (uchar*) set_to_string(thd, 0, *(ulonglong*) result, + plugin_var_typelib()->type_names); return result; } - -bool sys_var_pluginvar::check(THD *thd, set_var *var) +bool sys_var_pluginvar::do_check(THD *thd, set_var *var) { st_item_value_holder value; - DBUG_ASSERT(is_readonly() || plugin_var->check); + DBUG_ASSERT(!is_readonly()); + DBUG_ASSERT(plugin_var->check); value.value_type= item_value_type; value.val_str= item_val_str; value.val_int= item_val_int; value.val_real= item_val_real; + value.is_unsigned= item_is_unsigned; value.item= var->value; - return is_readonly() || - plugin_var->check(thd, plugin_var, &var->save_result, &value); + return plugin_var->check(thd, plugin_var, &var->save_result, &value); } - -void sys_var_pluginvar::set_default(THD *thd, enum_var_type type) +bool sys_var_pluginvar::session_update(THD *thd, set_var *var) { - const void *src; - void *tgt; - - DBUG_ASSERT(is_readonly() || plugin_var->update); - - if (is_readonly()) - return; + DBUG_ASSERT(!is_readonly()); + DBUG_ASSERT(plugin_var->flags & PLUGIN_VAR_THDLOCAL); + DBUG_ASSERT(thd == current_thd); pthread_mutex_lock(&LOCK_global_system_variables); - tgt= real_value_ptr(thd, type); - src= ((void **) (plugin_var + 1) + 1); + 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); + plugin_var->update(thd, plugin_var, tgt, src); - if (plugin_var->flags & PLUGIN_VAR_THDLOCAL) - { - if (type != OPT_GLOBAL) - src= real_value_ptr(thd, OPT_GLOBAL); - else - switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) { - case PLUGIN_VAR_INT: - src= &((thdvar_uint_t*) plugin_var)->def_val; - break; - case PLUGIN_VAR_LONG: - src= &((thdvar_ulong_t*) plugin_var)->def_val; - break; - case PLUGIN_VAR_LONGLONG: - src= &((thdvar_ulonglong_t*) plugin_var)->def_val; - break; - case PLUGIN_VAR_ENUM: - src= &((thdvar_enum_t*) plugin_var)->def_val; - break; - case PLUGIN_VAR_SET: - src= &((thdvar_set_t*) plugin_var)->def_val; - break; - case PLUGIN_VAR_BOOL: - src= &((thdvar_bool_t*) plugin_var)->def_val; - break; - case PLUGIN_VAR_STR: - src= &((thdvar_str_t*) plugin_var)->def_val; - break; - default: - DBUG_ASSERT(0); - } - } - - /* thd must equal current_thd if PLUGIN_VAR_THDLOCAL flag is set */ - DBUG_ASSERT(!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || - thd == current_thd); - - if (!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || type == OPT_GLOBAL) - { - plugin_var->update(thd, plugin_var, tgt, src); - pthread_mutex_unlock(&LOCK_global_system_variables); - } - else - { - pthread_mutex_unlock(&LOCK_global_system_variables); - plugin_var->update(thd, plugin_var, tgt, src); - } + return false; } - -bool sys_var_pluginvar::update(THD *thd, set_var *var) +bool sys_var_pluginvar::global_update(THD *thd, set_var *var) { - void *tgt; + DBUG_ASSERT(!is_readonly()); + safe_mutex_assert_owner(&LOCK_global_system_variables); - DBUG_ASSERT(is_readonly() || plugin_var->update); + void *tgt= real_value_ptr(thd, var->type); + const void *src= &var->save_result; - /* thd must equal current_thd if PLUGIN_VAR_THDLOCAL flag is set */ - DBUG_ASSERT(!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || - thd == current_thd); - - if (is_readonly()) - return 1; - - pthread_mutex_lock(&LOCK_global_system_variables); - tgt= real_value_ptr(thd, var->type); - - if (!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || var->type == OPT_GLOBAL) + if (!var->value) { - /* variable we are updating has global scope, so we unlock after updating */ - plugin_var->update(thd, plugin_var, tgt, &var->save_result); - pthread_mutex_unlock(&LOCK_global_system_variables); + switch (plugin_var->flags & (PLUGIN_VAR_TYPEMASK | PLUGIN_VAR_THDLOCAL)) { + case PLUGIN_VAR_INT: + src= &((sysvar_uint_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_LONG: + src= &((sysvar_ulong_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_LONGLONG: + src= &((sysvar_ulonglong_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_ENUM: + src= &((sysvar_enum_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_SET: + src= &((sysvar_set_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_BOOL: + src= &((sysvar_bool_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_STR: + src= &((sysvar_str_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL: + src= &((thdvar_uint_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL: + src= &((thdvar_ulong_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL: + src= &((thdvar_ulonglong_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL: + src= &((thdvar_enum_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL: + src= &((thdvar_set_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL: + src= &((thdvar_bool_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL: + src= &((thdvar_str_t*) plugin_var)->def_val; + break; + default: + DBUG_ASSERT(0); + } } - else - { - pthread_mutex_unlock(&LOCK_global_system_variables); - plugin_var->update(thd, plugin_var, tgt, &var->save_result); - } - return 0; + + plugin_var->update(thd, plugin_var, tgt, src); + + return false; } @@ -2944,40 +2958,48 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, DBUG_ENTER("construct_options"); - options[0].name= plugin_name_ptr= (char*) alloc_root(mem_root, - plugin_name_len + 1); + plugin_name_ptr= (char*) alloc_root(mem_root, plugin_name_len + 1); strcpy(plugin_name_ptr, plugin_name); my_casedn_str(&my_charset_latin1, plugin_name_ptr); convert_underscore_to_dash(plugin_name_ptr, plugin_name_len); - /* support --skip-plugin-foo syntax */ - options[1].name= plugin_name_with_prefix_ptr= (char*) alloc_root(mem_root, - plugin_name_len + - plugin_dash.length + 1); - strxmov(plugin_name_with_prefix_ptr, plugin_dash.str, options[0].name, NullS); + plugin_name_with_prefix_ptr= (char*) alloc_root(mem_root, + plugin_name_len + + plugin_dash.length + 1); + strxmov(plugin_name_with_prefix_ptr, plugin_dash.str, plugin_name_ptr, NullS); - options[0].id= options[1].id= 256; /* must be >255. dup id ok */ - options[0].var_type= options[1].var_type= GET_ENUM; - options[0].arg_type= options[1].arg_type= OPT_ARG; - options[0].def_value= options[1].def_value= 1; /* ON */ - options[0].typelib= options[1].typelib= &global_plugin_typelib; + if (!tmp->is_mandatory) + { + /* support --skip-plugin-foo syntax */ + options[0].name= plugin_name_ptr; + options[1].name= plugin_name_with_prefix_ptr; + options[0].id= options[1].id= 0; + options[0].var_type= options[1].var_type= GET_ENUM; + options[0].arg_type= options[1].arg_type= OPT_ARG; + options[0].def_value= options[1].def_value= 1; /* ON */ + options[0].typelib= options[1].typelib= &global_plugin_typelib; - strxnmov(comment, max_comment_len, "Enable or disable ", plugin_name, - " plugin. Possible values are ON, OFF, FORCE (don't start " - "if the plugin fails to load).", NullS); - options[0].comment= comment; + strxnmov(comment, max_comment_len, "Enable or disable ", plugin_name, + " plugin. Possible values are ON, OFF, FORCE (don't start " + "if the plugin fails to load).", NullS); + options[0].comment= comment; + /* + Allocate temporary space for the value of the tristate. + This option will have a limited lifetime and is not used beyond + server initialization. + GET_ENUM value is an unsigned integer. + */ + options[0].value= options[1].value= + (uchar **)alloc_root(mem_root, sizeof(uint)); + *((uint*) options[0].value)= (uint) options[0].def_value; - /* - Allocate temporary space for the value of the tristate. - This option will have a limited lifetime and is not used beyond - server initialization. - GET_ENUM value is an integer. - */ - options[0].value= options[1].value= (uchar **)alloc_root(mem_root, - sizeof(int)); - *((uint*) options[0].value)= *((uint*) options[1].value)= - (uint) options[0].def_value; + options+= 2; + } - options+= 2; + if (!my_strcasecmp(&my_charset_latin1, plugin_name_ptr, "NDBCLUSTER")) + { + plugin_name_ptr= const_cast("ndb"); // Use legacy "ndb" prefix + plugin_name_len= 3; + } /* Two passes as the 2nd pass will take pointer addresses for use @@ -3125,7 +3147,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, options->name= optname; options->comment= opt->comment; options->app_type= opt; - options->id= (options-1)->id + 1; + options->id= 0; plugin_opt_set_limits(options, opt); @@ -3166,13 +3188,20 @@ static my_option *construct_help_options(MEM_ROOT *mem_root, bzero(opts, sizeof(my_option) * count); + /** + some plugin variables (those that don't have PLUGIN_VAR_NOSYSVAR flag) + have their names prefixed with the plugin name. Restore the names here + to get the correct (not double-prefixed) help text. + We won't need @@sysvars anymore and don't care about their proper names. + */ + restore_pluginvar_names(p->system_vars); + if (construct_options(mem_root, p, opts)) DBUG_RETURN(NULL); DBUG_RETURN(opts); } - /** Create and register system variables supplied from the plugin and assigns initial values from corresponding command line arguments. @@ -3197,18 +3226,17 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, int *argc, char **argv) { struct sys_var_chain chain= { NULL, NULL }; - my_bool can_disable; bool disable_plugin; - enum_plugin_load_policy plugin_load_policy= PLUGIN_ON; + enum_plugin_load_policy plugin_load_policy= tmp->is_mandatory ? PLUGIN_FORCE : PLUGIN_ON; MEM_ROOT *mem_root= alloc_root_inited(&tmp->mem_root) ? &tmp->mem_root : &plugin_mem_root; st_mysql_sys_var **opt; my_option *opts= NULL; + LEX_STRING plugin_name; char *varname; int error; - st_mysql_sys_var *o; - sys_var *v; + sys_var *v __attribute__((unused)); struct st_bookmark *var; uint len, count= EXTRA_OPTIONS; DBUG_ENTER("test_plugin_options"); @@ -3244,7 +3272,8 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, We adjust the default value to account for the hardcoded exceptions we have set for the federated and ndbcluster storage engines. */ - opts[0].def_value= opts[1].def_value= (int)plugin_load_policy; + 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); (*argc)++; /* add back one for the program name */ @@ -3259,24 +3288,12 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, Set plugin loading policy from option value. First element in the option list is always the option value. */ - plugin_load_policy= (enum_plugin_load_policy)*(uint*)opts[0].value; + if (!tmp->is_mandatory) + plugin_load_policy= (enum_plugin_load_policy)*(uint*)opts[0].value; } disable_plugin= (plugin_load_policy == PLUGIN_OFF); - /* - The 'MyISAM' and 'Memory' storage engines currently can't be disabled. - */ - can_disable= - my_strcasecmp(&my_charset_latin1, tmp->name.str, "MyISAM") && - my_strcasecmp(&my_charset_latin1, tmp->name.str, "MEMORY"); - - tmp->is_mandatory= (plugin_load_policy == PLUGIN_FORCE) || !can_disable; - - if (disable_plugin && !can_disable) - { - sql_print_warning("Plugin '%s' cannot be disabled", tmp->name.str); - disable_plugin= FALSE; - } + tmp->is_mandatory= (plugin_load_policy == PLUGIN_FORCE); /* If the plugin is disabled it should not be initialized. @@ -3291,34 +3308,37 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, DBUG_RETURN(1); } + if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "NDBCLUSTER")) + { + plugin_name.str= const_cast("ndb"); // Use legacy "ndb" prefix + plugin_name.length= 3; + } + else + plugin_name= tmp->name; + error= 1; for (opt= tmp->plugin->system_vars; opt && *opt; opt++) { + st_mysql_sys_var *o; if (((o= *opt)->flags & PLUGIN_VAR_NOSYSVAR)) continue; - if ((var= find_bookmark(tmp->name.str, o->name, o->flags))) - v= new (mem_root) sys_var_pluginvar(var->key + 1, o); + if ((var= find_bookmark(plugin_name.str, o->name, o->flags))) + v= new (mem_root) sys_var_pluginvar(&chain, var->key + 1, o); else { - len= tmp->name.length + strlen(o->name) + 2; + len= plugin_name.length + strlen(o->name) + 2; varname= (char*) alloc_root(mem_root, len); - strxmov(varname, tmp->name.str, "-", o->name, NullS); + strxmov(varname, plugin_name.str, "-", o->name, NullS); my_casedn_str(&my_charset_latin1, varname); convert_dash_to_underscore(varname, len-1); - v= new (mem_root) sys_var_pluginvar(varname, o); + v= new (mem_root) sys_var_pluginvar(&chain, varname, o); } DBUG_ASSERT(v); /* check that an object was actually constructed */ - /* - Add to the chain of variables. - Done like this for easier debugging so that the - pointer to v is not lost on optimized builds. - */ - v->chain_sys_var(&chain); } /* end for */ if (chain.first) { chain.last->next = NULL; - if (mysql_add_sys_var_chain(chain.first, NULL)) + if (mysql_add_sys_var_chain(chain.first)) { sql_print_error("Plugin '%s' has conflicting system variables", tmp->name.str); @@ -3339,49 +3359,26 @@ err: Help Verbose text with Plugin System Variables ****************************************************************************/ -static int option_cmp(my_option *a, my_option *b) -{ - return my_strcasecmp(&my_charset_latin1, a->name, b->name); -} - -void my_print_help_inc_plugins(my_option *main_options, uint size) +void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root) { - DYNAMIC_ARRAY all_options; struct st_plugin_int *p; - MEM_ROOT mem_root; my_option *opt; - init_alloc_root(&mem_root, 4096, 4096); - my_init_dynamic_array(&all_options, sizeof(my_option), size, size/4); + if (!initialized) + return; - if (initialized) - for (uint idx= 0; idx < plugin_array.elements; idx++) - { - p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **); + for (uint idx= 0; idx < plugin_array.elements; idx++) + { + p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **); - if (!p->plugin->system_vars || - !(opt= construct_help_options(&mem_root, p))) - continue; + if (!(opt= construct_help_options(mem_root, p))) + continue; - /* Only options with a non-NULL comment are displayed in help text */ - for (;opt->id; opt++) - if (opt->comment) - insert_dynamic(&all_options, (uchar*) opt); - } - - for (;main_options->id; main_options++) - insert_dynamic(&all_options, (uchar*) main_options); - - sort_dynamic(&all_options, (qsort_cmp) option_cmp); - - /* main_options now points to the empty option terminator */ - insert_dynamic(&all_options, (uchar*) main_options); - - my_print_help((my_option*) all_options.buffer); - my_print_variables((my_option*) all_options.buffer); - - delete_dynamic(&all_options); - free_root(&mem_root, MYF(0)); + /* Only options with a non-NULL comment are displayed in help text */ + for (;opt->name; opt++) + if (opt->comment) + insert_dynamic(options, (uchar*) opt); + } } diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 23ce85c994b..bec880b21d2 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -17,6 +17,9 @@ #define _sql_plugin_h class sys_var; +enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED}; + +#include #ifdef DBUG_OFF #define plugin_ref_to_int(A) A @@ -37,6 +40,7 @@ class sys_var; typedef enum enum_mysql_show_type SHOW_TYPE; typedef struct st_mysql_show_var SHOW_VAR; +typedef struct st_mysql_lex_string LEX_STRING; #define MYSQL_ANY_PLUGIN -1 @@ -112,7 +116,7 @@ extern const LEX_STRING plugin_type_names[]; extern int plugin_init(int *argc, char **argv, int init_flags); extern void plugin_shutdown(void); -extern void my_print_help_inc_plugins(struct my_option *options, uint size); +void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root); extern bool plugin_is_ready(const LEX_STRING *name, int type); #define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C CALLER_INFO) #define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO) @@ -129,6 +133,7 @@ extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name); extern bool plugin_register_builtin(struct st_mysql_plugin *plugin); extern void plugin_thdvar_init(THD *thd); extern void plugin_thdvar_cleanup(THD *thd); +extern SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type); typedef my_bool (plugin_foreach_func)(THD *thd, plugin_ref plugin, diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index d624c22f43a..f19f12ddc13 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -84,6 +84,7 @@ When one supplies long data for a placeholder: */ #include "mysql_priv.h" +#include "set_var.h" #include "sql_prepare.h" #include "sql_select.h" // for JOIN #include "sql_cursor.h" diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index 69e5bc3cbb4..84ee0768b25 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -341,7 +341,7 @@ void PROFILING::start_new_query(const char *initial_state) finish_current_query(); } - enabled= (((thd)->options & OPTION_PROFILING) != 0); + enabled= ((thd->variables.option_bits & OPTION_PROFILING) != 0); if (! enabled) DBUG_VOID_RETURN; @@ -379,7 +379,7 @@ void PROFILING::finish_current_query() status_change("ending", NULL, NULL, 0); if ((enabled) && /* ON at start? */ - ((thd->options & OPTION_PROFILING) != 0) && /* and ON at end? */ + ((thd->variables.option_bits & OPTION_PROFILING) != 0) && /* and ON at end? */ (current->query_source != NULL) && (! current->entries.is_empty())) { diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index aa06b1cfb0e..517fbb97b73 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -29,6 +29,14 @@ my_bool opt_sporadic_binlog_dump_fail = 0; static int binlog_dump_count = 0; #endif +/** + a copy of active_mi->rli->slave_skip_counter, for showing in SHOW VARIABLES, + INFORMATION_SCHEMA.GLOBAL_VARIABLES and @@sql_slave_skip_counter without + taking all the mutexes needed to access active_mi->rli->slave_skip_counter + properly. +*/ +uint sql_slave_skip_counter; + /* fake_rotate_event() builds a fake (=which does not exist physically in any binlog) Rotate event, which contains the name of the binlog we are going to @@ -1985,147 +1993,4 @@ int log_loaded_block(IO_CACHE* file) DBUG_RETURN(0); } -/* - Replication System Variables -*/ - -class sys_var_slave_skip_counter :public sys_var -{ -public: - sys_var_slave_skip_counter(sys_var_chain *chain, const char *name_arg) - :sys_var(name_arg) - { chain_sys_var(chain); } - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - bool check_type(enum_var_type type) { return type != OPT_GLOBAL; } - /* - We can't retrieve the value of this, so we don't have to define - type() or value_ptr() - */ -}; - -class sys_var_sync_binlog_period :public sys_var_long_ptr -{ -public: - sys_var_sync_binlog_period(sys_var_chain *chain, const char *name_arg, - ulong *value_ptr) - :sys_var_long_ptr(chain, name_arg,value_ptr) {} - bool update(THD *thd, set_var *var); -}; - -static void fix_slave_net_timeout(THD *thd, enum_var_type type) -{ - DBUG_ENTER("fix_slave_net_timeout"); -#ifdef HAVE_REPLICATION - pthread_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))); - if (active_mi && slave_net_timeout < active_mi->heartbeat_period) - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, - "The currect value for master_heartbeat_period" - " 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); -#endif - DBUG_VOID_RETURN; -} - -static sys_var_chain vars = { NULL, NULL }; - -static sys_var_const sys_log_slave_updates(&vars, "log_slave_updates", - OPT_GLOBAL, SHOW_MY_BOOL, - (uchar*) &opt_log_slave_updates); -static sys_var_const sys_relay_log(&vars, "relay_log", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) &opt_relay_logname); -static sys_var_const sys_relay_log_index(&vars, "relay_log_index", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) &opt_relaylog_index_name); -static sys_var_const sys_relay_log_info_file(&vars, "relay_log_info_file", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) &relay_log_info_file); -static sys_var_bool_ptr sys_relay_log_purge(&vars, "relay_log_purge", - &relay_log_purge); -static sys_var_bool_ptr sys_relay_log_recovery(&vars, "relay_log_recovery", - &relay_log_recovery); -static sys_var_uint_ptr sys_sync_binlog_period(&vars, "sync_binlog", - &sync_binlog_period); -static sys_var_uint_ptr sys_sync_relaylog_period(&vars, "sync_relay_log", - &sync_relaylog_period); -static sys_var_uint_ptr sys_sync_relayloginfo_period(&vars, "sync_relay_log_info", - &sync_relayloginfo_period); -static sys_var_uint_ptr sys_sync_masterinfo_period(&vars, "sync_master_info", - &sync_masterinfo_period); -static sys_var_const sys_relay_log_space_limit(&vars, - "relay_log_space_limit", - OPT_GLOBAL, SHOW_LONGLONG, - (uchar*) - &relay_log_space_limit); -static sys_var_const sys_slave_load_tmpdir(&vars, "slave_load_tmpdir", - OPT_GLOBAL, SHOW_CHAR_PTR, - (uchar*) &slave_load_tmpdir); -static sys_var_long_ptr sys_slave_net_timeout(&vars, "slave_net_timeout", - &slave_net_timeout, - fix_slave_net_timeout); -static sys_var_const sys_slave_skip_errors(&vars, "slave_skip_errors", - OPT_GLOBAL, SHOW_CHAR, - (uchar*) slave_skip_error_names); -static sys_var_long_ptr sys_slave_trans_retries(&vars, "slave_transaction_retries", - &slave_trans_retries); -static sys_var_slave_skip_counter sys_slave_skip_counter(&vars, "sql_slave_skip_counter"); - - -bool sys_var_slave_skip_counter::check(THD *thd, set_var *var) -{ - int result= 0; - pthread_mutex_lock(&LOCK_active_mi); - pthread_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=1; - } - pthread_mutex_unlock(&active_mi->rli.run_lock); - pthread_mutex_unlock(&LOCK_active_mi); - var->save_result.ulong_value= (ulong) var->value->val_int(); - return result; -} - - -bool sys_var_slave_skip_counter::update(THD *thd, set_var *var) -{ - pthread_mutex_lock(&LOCK_active_mi); - pthread_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 - SQL_SLAVE_SKIP_COUNTER request, we do the check anyway - */ - if (!active_mi->rli.slave_running) - { - pthread_mutex_lock(&active_mi->rli.data_lock); - active_mi->rli.slave_skip_counter= var->save_result.ulong_value; - pthread_mutex_unlock(&active_mi->rli.data_lock); - } - pthread_mutex_unlock(&active_mi->rli.run_lock); - pthread_mutex_unlock(&LOCK_active_mi); - return 0; -} - - -int init_replication_sys_vars() -{ - if (mysql_add_sys_var_chain(vars.first, my_long_options)) - { - /* should not happen */ - fprintf(stderr, "failed to initialize replication system variables"); - unireg_abort(1); - } - return 0; -} - - #endif /* HAVE_REPLICATION */ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5f52ef9f856..5f1c5ac2a34 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -120,8 +120,7 @@ static COND *optimize_cond(JOIN *join, COND *conds, Item::cond_result *cond_value); static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item); static bool open_tmp_table(TABLE *table); -static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, - ulonglong options); +static bool create_myisam_tmp_table(TABLE *,TMP_TABLE_PARAM *, ulonglong, my_bool); static int do_select(JOIN *join,List *fields,TABLE *tmp_table, Procedure *proc); @@ -267,7 +266,7 @@ bool handle_select(THD *thd, LEX *lex, select_result *result, (ORDER*) select_lex->group_list.first, select_lex->having, (ORDER*) lex->proc_list.first, - select_lex->options | thd->options | + select_lex->options | thd->variables.option_bits | setup_tables_done_option, result, unit, select_lex); } @@ -1017,7 +1016,7 @@ JOIN::optimize() error= 0; DBUG_RETURN(0); } - if (!(thd->options & OPTION_BIG_SELECTS) && + if (!(thd->variables.option_bits & OPTION_BIG_SELECTS) && best_read > (double) thd->variables.max_join_size && !(select_options & SELECT_DESCRIBE)) { /* purecov: inspected */ @@ -1505,15 +1504,10 @@ JOIN::optimize() if (!(exec_tmp_table1= create_tmp_table(thd, &tmp_table_param, all_fields, - tmp_group, - group_list ? 0 : select_distinct, + tmp_group, group_list ? 0 : select_distinct, group_list && simple_group, - select_options, - tmp_rows_limit, - (char *) ""))) - { + select_options, tmp_rows_limit, ""))) DBUG_RETURN(1); - } /* We don't have to store rows in temp table that doesn't match HAVING if: @@ -1987,8 +1981,7 @@ JOIN::exec() curr_join->select_distinct && !curr_join->group_list, 1, curr_join->select_options, - HA_POS_ERROR, - (char *) ""))) + HA_POS_ERROR, ""))) DBUG_VOID_RETURN; curr_join->exec_tmp_table2= exec_tmp_table2; } @@ -2834,8 +2827,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds, !table->fulltext_searched && !table->pos_in_table_list->embedding) { - if ((table->key_info[key].flags & (HA_NOSAME | HA_END_SPACE_KEY)) - == HA_NOSAME) + if (table->key_info[key].flags & HA_NOSAME) { if (const_ref == eq_part) { // Found everything for ref. @@ -5815,8 +5807,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse, DBUG_RETURN(0); if (j->type == JT_CONST) j->table->const_table= 1; - else if (((keyinfo->flags & (HA_NOSAME | HA_NULL_PART_KEY | - HA_END_SPACE_KEY)) != HA_NOSAME) || + else if (((keyinfo->flags & (HA_NOSAME | HA_NULL_PART_KEY)) != HA_NOSAME) || keyparts != keyinfo->key_parts || null_ref_key) { /* Must read with repeat */ @@ -9373,7 +9364,7 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) { Field *field=((Item_field*) args[0])->field; if (field->flags & AUTO_INCREMENT_FLAG && !field->table->maybe_null && - (thd->options & OPTION_AUTO_IS_NULL) && + (thd->variables.option_bits & OPTION_AUTO_IS_NULL) && (thd->first_successful_insert_id_in_prev_stmt > 0 && thd->substitute_null_with_insert_id)) { @@ -9923,7 +9914,7 @@ TABLE * create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, ORDER *group, bool distinct, bool save_sum_fields, ulonglong select_options, ha_rows rows_limit, - char *table_alias) + const char *table_alias) { MEM_ROOT *mem_root_save, own_root; TABLE *table; @@ -10238,9 +10229,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, /* If result table is small; use a heap */ /* future: storage engine selection can be made dynamic? */ - if (blob_count || using_unique_constraint || - (select_options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) == - OPTION_BIG_TABLES || (select_options & TMP_TABLE_FORCE_MYISAM)) + if (blob_count || using_unique_constraint + || (thd->variables.big_tables && !(select_options & SELECT_SMALL_RESULT)) + || (select_options & TMP_TABLE_FORCE_MYISAM)) { share->db_plugin= ha_lock_engine(0, myisam_hton); table->file= get_new_handler(share, &table->mem_root, @@ -10567,7 +10558,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, share->db_record_offset= 1; if (share->db_type() == myisam_hton) { - if (create_myisam_tmp_table(table,param,select_options)) + if (create_myisam_tmp_table(table, param, select_options, + thd->variables.big_tables)) goto err; } if (open_tmp_table(table)) @@ -10731,7 +10723,7 @@ static bool open_tmp_table(TABLE *table) static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, - ulonglong options) + ulonglong options, my_bool big_tables) { int error; MI_KEYDEF keydef; @@ -10818,8 +10810,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, MI_CREATE_INFO create_info; bzero((char*) &create_info,sizeof(create_info)); - if ((options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) == - OPTION_BIG_TABLES) + if (big_tables && !(options & SELECT_SMALL_RESULT)) create_info.data_file_length= ~(ulonglong) 0; if ((error=mi_create(share->table_name.str, share->keys, &keydef, @@ -10920,7 +10911,8 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, thd_proc_info(thd, "converting HEAP to MyISAM"); if (create_myisam_tmp_table(&new_table, param, - thd->lex->select_lex.options | thd->options)) + thd->lex->select_lex.options | thd->variables.option_bits, + thd->variables.big_tables)) goto err2; if (open_tmp_table(&new_table)) goto err1; @@ -16786,7 +16778,7 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result) (ORDER*) first->group_list.first, first->having, (ORDER*) thd->lex->proc_list.first, - first->options | thd->options | SELECT_DESCRIBE, + first->options | thd->variables.option_bits | SELECT_DESCRIBE, result, unit, first); } DBUG_RETURN(res || thd->is_error()); diff --git a/sql/sql_select.h b/sql/sql_select.h index bdca4b196bc..3a664546397 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -578,7 +578,7 @@ bool store_val_in_field(Field *field, Item *val, enum_check_fields check_flag); TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, ORDER *group, bool distinct, bool save_sum_fields, ulonglong select_options, ha_rows rows_limit, - char* alias); + const char* alias); void free_tmp_table(THD *thd, TABLE *entry); void count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param, List &fields, bool reset_with_sum_func); @@ -644,7 +644,7 @@ public: enum store_key_result result; THD *thd= to_field->table->in_use; enum_check_fields saved_count_cuted_fields= thd->count_cuted_fields; - ulong sql_mode= thd->variables.sql_mode; + ulonglong sql_mode= thd->variables.sql_mode; thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE); thd->count_cuted_fields= CHECK_FIELD_IGNORE; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index cb77f2b2a1d..92366b4bc1a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -22,6 +22,7 @@ #include "repl_failsafe.h" #include "sp.h" #include "sp_head.h" +#include "set_var.h" #include "sql_trigger.h" #include "authors.h" #include "contributors.h" @@ -960,7 +961,7 @@ int get_quote_char_for_identifier(THD *thd, const char *name, uint length) if (length && !is_keyword(name,length) && !require_quotes(name, length) && - !(thd->options & OPTION_QUOTE_SHOW_CREATE)) + !(thd->variables.option_bits & OPTION_QUOTE_SHOW_CREATE)) return EOF; if (thd->variables.sql_mode & MODE_ANSI_QUOTES) return '"'; @@ -2214,6 +2215,15 @@ static bool show_status_array(THD *thd, const char *wild, end= strend(pos); break; } + case SHOW_LEX_STRING: + { + LEX_STRING *ls=(LEX_STRING*)value; + if (!(pos= ls->str)) + end= pos= ""; + else + end= pos + ls->length; + break; + } case SHOW_KEY_CACHE_LONG: value= (char*) dflt_key_cache + (ulong)value; end= int10_to_str(*(long*) value, buff, 10); @@ -4589,8 +4599,7 @@ static bool store_trigger(THD *thd, TABLE *table, LEX_STRING *db_name, table->field[14]->store(STRING_WITH_LEN("OLD"), cs); table->field[15]->store(STRING_WITH_LEN("NEW"), cs); - sys_var_thd_sql_mode::symbolic_mode_representation(thd, sql_mode, - &sql_mode_rep); + sql_mode_string_representation(thd, sql_mode, &sql_mode_rep); table->field[17]->store(sql_mode_rep.str, sql_mode_rep.length, cs); table->field[18]->store(definer_buffer->str, definer_buffer->length, cs); table->field[19]->store(client_cs_name->str, client_cs_name->length, cs); @@ -5321,8 +5330,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) /* SQL_MODE */ { LEX_STRING sql_mode; - sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode, - &sql_mode); + sql_mode_string_representation(thd, et.sql_mode, &sql_mode); sch_table->field[ISE_SQL_MODE]-> store(sql_mode.str, sql_mode.length, scs); } @@ -5486,7 +5494,7 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond) option_type= OPT_GLOBAL; rw_rdlock(&LOCK_system_variables_hash); - res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars), + 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); DBUG_RETURN(res); @@ -5811,7 +5819,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) SELECT_LEX *select_lex= thd->lex->current_select; if (!(table= create_tmp_table(thd, tmp_table_param, field_list, (ORDER*) 0, 0, 0, - (select_lex->options | thd->options | + (select_lex->options | thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS), HA_POS_ERROR, table_list->alias))) DBUG_RETURN(0); @@ -7057,9 +7065,7 @@ static bool show_create_trigger_impl(THD *thd, &trg_connection_cl_name, &trg_db_cl_name); - sys_var_thd_sql_mode::symbolic_mode_representation(thd, - trg_sql_mode, - &trg_sql_mode_str); + sql_mode_string_representation(thd, trg_sql_mode, &trg_sql_mode_str); /* Resolve trigger client character set. */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c4904feffa6..633c405ea25 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -22,6 +22,7 @@ #include "sp_head.h" #include "sql_trigger.h" #include "sql_show.h" +#include "keycaches.h" #ifdef __WIN__ #include @@ -2214,10 +2215,10 @@ static int sort_keys(KEY *a, KEY *b) { if (!(b_flags & HA_NOSAME)) return -1; - if ((a_flags ^ b_flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) + if ((a_flags ^ b_flags) & HA_NULL_PART_KEY) { /* Sort NOT NULL keys before other keys */ - return (a_flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1; + return (a_flags & HA_NULL_PART_KEY) ? 1 : -1; } if (a->name == primary_key_name) return -1; @@ -5056,45 +5057,6 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables, } -/* - Reassign all tables assigned to a key cache to another key cache - - SYNOPSIS - reassign_keycache_tables() - thd Thread object - src_cache Reference to the key cache to clean up - dest_cache New key cache - - NOTES - This is called when one sets a key cache size to zero, in which - case we have to move the tables associated to this key cache to - the "default" one. - - One has to ensure that one never calls this function while - some other thread is changing the key cache. This is assured by - the caller setting src_cache->in_init before calling this function. - - We don't delete the old key cache as there may still be pointers pointing - to it for a while after this function returns. - - RETURN VALUES - 0 ok -*/ - -int reassign_keycache_tables(THD *thd, KEY_CACHE *src_cache, - KEY_CACHE *dst_cache) -{ - DBUG_ENTER("reassign_keycache_tables"); - - DBUG_ASSERT(src_cache != dst_cache); - DBUG_ASSERT(src_cache->in_init); - src_cache->param_buff_size= 0; // Free key cache - ha_resize_key_cache(src_cache); - ha_change_key_cache(src_cache, dst_cache); - DBUG_RETURN(0); -} - - /* Preload specified indexes for a table into key cache diff --git a/sql/sql_test.cc b/sql/sql_test.cc index ac1dae3197d..8dc4b4ffeb6 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -19,6 +19,7 @@ #include "mysql_priv.h" #include "sql_select.h" +#include "keycaches.h" #include #include #if defined(HAVE_MALLINFO) && defined(HAVE_MALLOC_H) @@ -442,8 +443,10 @@ writes: %10s\n\ r_requests: %10s\n\ reads: %10s\n\n", name, - (ulong) key_cache->param_buff_size, key_cache->param_block_size, - key_cache->param_division_limit, key_cache->param_age_threshold, + (ulong) key_cache->param_buff_size, + (ulong)key_cache->param_block_size, + (ulong)key_cache->param_division_limit, + (ulong)key_cache->param_age_threshold, key_cache->blocks_used,key_cache->global_blocks_changed, llstr(key_cache->global_cache_w_requests,llbuff1), llstr(key_cache->global_cache_write,llbuff2), diff --git a/sql/sql_union.cc b/sql/sql_union.cc index cbf94ad7181..5bdff4dc9bf 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -121,7 +121,7 @@ select_union::create_result_table(THD *thd_arg, List *column_types, if (! (table= create_tmp_table(thd_arg, &tmp_table_param, *column_types, (ORDER*) 0, is_union_distinct, 1, - options, HA_POS_ERROR, (char*) alias))) + options, HA_POS_ERROR, alias))) return TRUE; table->file->extra(HA_EXTRA_WRITE_CACHE); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); @@ -232,7 +232,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, bool can_skip_order_by; sl->options|= SELECT_NO_UNLOCK; JOIN *join= new JOIN(thd_arg, sl->item_list, - sl->options | thd_arg->options | additional_options, + sl->options | thd_arg->variables.option_bits | additional_options, tmp_result); /* setup_tables_done_option should be set only for very first SELECT, @@ -335,7 +335,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, } } - create_options= (first_sl->options | thd_arg->options | + create_options= (first_sl->options | thd_arg->variables.option_bits | TMP_TABLE_ALL_COLUMNS); /* Force the temporary table to be a MyISAM table if we're going to use @@ -376,7 +376,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, init_prepare_fake_select_lex(thd); /* Should be done only once (the only item_list per statement) */ DBUG_ASSERT(fake_select_lex->join == 0); - if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options, + if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->variables.option_bits, result))) { fake_select_lex->table_list.empty(); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index cc92d224cd9..b197434d798 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -185,7 +185,7 @@ int mysql_update(THD *thd, ha_rows *found_return, ha_rows *updated_return) { bool using_limit= limit != HA_POS_ERROR; - bool safe_update= test(thd->options & OPTION_SAFE_UPDATES); + bool safe_update= test(thd->variables.option_bits & OPTION_SAFE_UPDATES); bool used_key_is_modified, transactional_table, will_batch; bool can_compare_record; int res; @@ -1493,7 +1493,7 @@ multi_update::initialize_tables(JOIN *join) TABLE_LIST *table_ref; DBUG_ENTER("initialize_tables"); - if ((thd->options & OPTION_SAFE_UPDATES) && error_if_full_join(join)) + if ((thd->variables.option_bits & OPTION_SAFE_UPDATES) && error_if_full_join(join)) DBUG_RETURN(1); main_table=join->join_tab->table; table_to_update= 0; @@ -1617,13 +1617,14 @@ loop_end: tmp_param->field_count=temp_fields.elements; tmp_param->group_parts=1; tmp_param->group_length= table->file->ref_length; - if (!(tmp_tables[cnt]=create_tmp_table(thd, - tmp_param, - temp_fields, - (ORDER*) &group, 0, 0, - TMP_TABLE_ALL_COLUMNS, - HA_POS_ERROR, - (char *) ""))) + /* small table, ignore SQL_BIG_TABLES */ + my_bool save_big_tables= thd->variables.big_tables; + thd->variables.big_tables= FALSE; + tmp_tables[cnt]=create_tmp_table(thd, tmp_param, temp_fields, + (ORDER*) &group, 0, 0, + TMP_TABLE_ALL_COLUMNS, HA_POS_ERROR, ""); + thd->variables.big_tables= save_big_tables; + if (!tmp_tables[cnt]) DBUG_RETURN(1); tmp_tables[cnt]->file->extra(HA_EXTRA_WRITE_CACHE); } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 8305303f351..cb60c3b34e4 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -29,15 +29,6 @@ const LEX_STRING view_type= { C_STRING_WITH_LEN("VIEW") }; static int mysql_register_view(THD *thd, TABLE_LIST *view, enum_view_create_mode mode); -const char *updatable_views_with_limit_names[]= { "NO", "YES", NullS }; -TYPELIB updatable_views_with_limit_typelib= -{ - array_elements(updatable_views_with_limit_names)-1, "", - updatable_views_with_limit_names, - 0 -}; - - /* Make a unique name for an anonymous view column SYNOPSIS diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 0d3610ccee1..296316896c9 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -47,6 +47,8 @@ #include "event_parse_data.h" #include #include +#include "keycaches.h" +#include "set_var.h" /* this is to get the bison compilation windows warnings out */ #ifdef _MSC_VER @@ -426,7 +428,7 @@ set_system_variable(THD *thd, struct sys_var_with_base *tmp, LEX *lex= thd->lex; /* No AUTOCOMMIT from a stored function or trigger. */ - if (lex->spcont && tmp->var == &sys_autocommit) + if (lex->spcont && tmp->var == Sys_autocommit_ptr) lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; if (! (var= new set_var(var_type, tmp->var, &tmp->base_name, val))) @@ -4719,7 +4721,6 @@ part_value_item: part_value_item_list {} ')' { - LEX *lex= Lex; partition_info *part_info= Lex->part_info; part_info->print_debug(") part_value_item", NULL); if (part_info->num_columns == 0) @@ -4750,7 +4751,6 @@ part_value_expr_item: MAX_VALUE_SYM { partition_info *part_info= Lex->part_info; - part_column_list_val *col_val; if (part_info->part_type == LIST_PARTITION) { my_parse_error(ER(ER_MAXVALUE_IN_VALUES_IN)); @@ -7019,7 +7019,7 @@ cache_keys_spec: { Lex->select_lex.alloc_index_hints(YYTHD); Select->set_index_hint_type(INDEX_HINT_USE, - global_system_variables.old_mode ? + old_mode ? INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL); } @@ -9372,8 +9372,7 @@ opt_outer: index_hint_clause: /* empty */ { - $$= global_system_variables.old_mode ? - INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL; + $$= old_mode ? INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL; } | FOR_SYM JOIN_SYM { $$= INDEX_HINT_MASK_JOIN; } | FOR_SYM ORDER_SYM BY { $$= INDEX_HINT_MASK_ORDER; } diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 56fa4a380ea..d7ab102b225 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -45,6 +45,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, const char *end= str + strip->cset->lengthsp(strip, str, length); ulonglong found= 0; *err_pos= 0; // No error yet + *err_len= 0; if (str != end) { const char *start= str; @@ -71,7 +72,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, var_len= (uint) (pos - start); uint find= cs ? find_type2(lib, start, var_len, cs) : find_type(lib, start, var_len, (bool) 0); - if (!find) + if (!find && *err_len == 0) // report the first error with length > 0 { *err_pos= (char*) start; *err_len= var_len; @@ -87,209 +88,6 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, return found; } - -static const char *on_off_default_names[]= -{ - "off","on","default", NullS -}; - -static const unsigned int on_off_default_names_len[]= -{ - sizeof("off") - 1, - sizeof("on") - 1, - sizeof("default") - 1 -}; - -static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1, - "", on_off_default_names, - (unsigned int *)on_off_default_names_len}; - - -/* - Parse a TYPELIB name from the buffer - - SYNOPSIS - parse_name() - lib Set of names to scan for. - strpos INOUT Start of the buffer (updated to point to the next - character after the name) - end End of the buffer - cs Charset used in the buffer - - DESCRIPTION - Parse a TYPELIB name from the buffer. The buffer is assumed to contain - one of the names specified in the TYPELIB, followed by comma, '=', or - end of the buffer. - - RETURN - 0 No matching name - >0 Offset+1 in typelib for matched name -*/ - -static uint parse_name(TYPELIB *lib, const char **strpos, const char *end, - CHARSET_INFO *cs) -{ - const char *pos= *strpos; - const char *start= pos; - - /* Find the length */ - if (cs && cs->mbminlen > 1) - { - int mblen= 0; - for ( ; pos < end; pos+= mblen) - { - my_wc_t wc; - if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) pos, - (const uchar *) end)) < 1) - mblen= 1; // Not to hang on a wrong multibyte sequence - if (wc == (my_wc_t) '=' || wc == (my_wc_t) ',') - break; - } - } - else - for (; pos != end && *pos != '=' && *pos !=',' ; pos++) ; - - uint var_len= (uint) (pos - start); - /* Determine which flag it is */ - uint find= cs ? find_type2(lib, start, var_len, cs) : - find_type(lib, start, var_len, (bool) 0); - *strpos= pos; - return find; -} - - -/* Read next character from the buffer in a charset-aware way */ - -static my_wc_t get_next_char(const char **pos, const char *end, CHARSET_INFO *cs) -{ - my_wc_t wc; - if (*pos == end) - return (my_wc_t)-1; - - if (cs && cs->mbminlen > 1) - { - int mblen; - if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) *pos, - (const uchar *) end)) < 1) - mblen= 1; // Not to hang on a wrong multibyte sequence - *pos += mblen; - return wc; - } - else - return *((*pos)++); -} - - -/* - Parse and apply a set of flag assingments - - SYNOPSIS - find_set_from_flags() - lib Flag names - default_name Number of "default" in the typelib - cur_set Current set of flags (start from this state) - default_set Default set of flags (use this for assign-default - keyword and flag=default assignments) - str String to be parsed - length Length of the string - cs String charset - err_pos OUT If error, set to point to start of wrong set string - NULL on success - err_len OUT If error, set to the length of wrong set string - set_warning OUT TRUE <=> Some string in set couldn't be used - - DESCRIPTION - Parse a set of flag assignments, that is, parse a string in form: - - param_name1=value1,param_name2=value2,... - - where the names are specified in the TYPELIB, and each value can be - either 'on','off', or 'default'. Setting the same name twice is not - allowed. - - Besides param=val assignments, we support the "default" keyword (keyword - #default_name in the typelib). It can be used one time, if specified it - causes us to build the new set over the default_set rather than cur_set - value. - - RETURN - Parsed set value if (*errpos == NULL) - Otherwise undefined -*/ - -ulonglong find_set_from_flags(TYPELIB *lib, uint default_name, - ulonglong cur_set, ulonglong default_set, - const char *str, uint length, CHARSET_INFO *cs, - char **err_pos, uint *err_len, bool *set_warning) -{ - CHARSET_INFO *strip= cs ? cs : &my_charset_latin1; - const char *end= str + strip->cset->lengthsp(strip, str, length); - ulonglong flags_to_set= 0, flags_to_clear= 0; - bool set_defaults= 0; - *err_pos= 0; // No error yet - if (str != end) - { - const char *start= str; - for (;;) - { - const char *pos= start; - uint flag_no, value; - - if (!(flag_no= parse_name(lib, &pos, end, cs))) - goto err; - - if (flag_no == default_name) - { - /* Using 'default' twice isn't allowed. */ - if (set_defaults) - goto err; - set_defaults= TRUE; - } - else - { - ulonglong bit= ((longlong) 1 << (flag_no - 1)); - /* parse the '=on|off|default' */ - if ((flags_to_clear | flags_to_set) & bit || - get_next_char(&pos, end, cs) != '=' || - !(value= parse_name(&on_off_default_typelib, &pos, end, cs))) - { - goto err; - } - - if (value == 1) // this is '=off' - flags_to_clear|= bit; - else if (value == 2) // this is '=on' - flags_to_set|= bit; - else // this is '=default' - { - if (default_set & bit) - flags_to_set|= bit; - else - flags_to_clear|= bit; - } - } - if (pos >= end) - break; - - if (get_next_char(&pos, end, cs) != ',') - goto err; - - start=pos; - continue; - err: - *err_pos= (char*)start; - *err_len= end - start; - *set_warning= TRUE; - break; - } - } - ulonglong res= set_defaults? default_set : cur_set; - res|= flags_to_set; - res&= ~flags_to_clear; - return res; -} - - /* Function to find a string in a TYPELIB (Same format as mysys/typelib.c) @@ -543,3 +341,60 @@ int find_string_in_array(LEX_STRING * const haystack, LEX_STRING * const needle, } return -1; } + + +char *set_to_string(THD *thd, LEX_STRING *result, ulonglong set, + const char *lib[]) +{ + char buff[STRING_BUFFER_USUAL_SIZE*8]; + String tmp(buff, sizeof(buff), &my_charset_latin1); + LEX_STRING unused; + + if (!result) + result= &unused; + + tmp.length(0); + + for (uint i= 0; set; i++, set >>= 1) + if (set & 1) { + tmp.append(lib[i]); + tmp.append(','); + } + + if (tmp.length()) + { + result->str= thd->strmake(tmp.ptr(), tmp.length()-1); + result->length= tmp.length()-1; + } + else + { + result->str= const_cast(""); + result->length= 0; + } + return result->str; +} + +char *flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set, + const char *lib[]) +{ + char buff[STRING_BUFFER_USUAL_SIZE*8]; + String tmp(buff, sizeof(buff), &my_charset_latin1); + LEX_STRING unused; + + if (!result) result= &unused; + + tmp.length(0); + + // note that the last element is always "default", and it's ignored below + for (uint i= 0; lib[i+1]; i++, set >>= 1) + { + tmp.append(lib[i]); + tmp.append(set & 1 ? "=on," : "=off,"); + } + + result->str= thd->strmake(tmp.ptr(), tmp.length()-1); + result->length= tmp.length()-1; + + return result->str; +} + diff --git a/sql/structs.h b/sql/structs.h index 33b7148c4b3..041a6809804 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -142,8 +142,6 @@ typedef struct st_known_date_time_format { const char *time_format; } KNOWN_DATE_TIME_FORMAT; -enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED}; - extern const char *show_comp_option_name[]; typedef int *(*update_var)(THD *, struct st_mysql_show_var *); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc new file mode 100644 index 00000000000..3c4683d23f9 --- /dev/null +++ b/sql/sys_vars.cc @@ -0,0 +1,2738 @@ +/* Copyright (C) 2002-2006 MySQL AB, 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 */ + +/* + How to add new variables: + + 1. copy one of the existing variables, and edit the declaration. + 2. if you need special behavior on assignment or additional checks + use ON_CHECK and ON_UPDATE callbacks. + 3. *Don't* add new Sys_var classes or uncle Occam will come + with his razor to haunt you at nights + + Note - all storage engine variables (for example myisam_whatever) + should go into the corresponding storage engine sources + (for example in storage/myisam/ha_myisam.cc) ! +*/ + +#include "sys_vars.h" + +#include "events.h" +#include +#include "slave.h" +#include "rpl_mi.h" + +/* + 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 + elsewhere it should be explicitly declared 'export' here to show that it's + not a mistakenly forgotten 'static' keyword. +*/ +#define export /* not static */ + +static Sys_var_ulong Sys_auto_increment_increment( + "auto_increment_increment", + "Auto-increment columns are incremented by this", + SESSION_VAR(auto_increment_increment), + CMD_LINE(OPT_ARG), + VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1), + NO_MUTEX_GUARD, IN_BINLOG); + +static Sys_var_ulong Sys_auto_increment_offset( + "auto_increment_offset", + "Offset added to Auto-increment columns. Used when " + "auto-increment-increment != 1", + SESSION_VAR(auto_increment_offset), + CMD_LINE(OPT_ARG), + VALID_RANGE(1, 65535), DEFAULT(1), BLOCK_SIZE(1), + NO_MUTEX_GUARD, IN_BINLOG); + +static Sys_var_mybool Sys_automatic_sp_privileges( + "automatic_sp_privileges", + "Creating and dropping stored procedures alters ACLs", + GLOBAL_VAR(sp_automatic_privileges), + CMD_LINE(OPT_ARG), DEFAULT(TRUE)); + +static Sys_var_ulong Sys_back_log( + "back_log", "The number of outstanding connection requests " + "MySQL can have. This comes into play when the main MySQL thread " + "gets very many connection requests in a very short time", + READ_ONLY GLOBAL_VAR(back_log), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, 65535), DEFAULT(50), BLOCK_SIZE(1)); + +static Sys_var_charptr Sys_basedir( + "basedir", "Path to installation directory. All paths are " + "usually resolved relative to this", + READ_ONLY GLOBAL_VAR(mysql_home_ptr), CMD_LINE(REQUIRED_ARG, 'b'), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_ulong Sys_binlog_cache_size( + "binlog_cache_size", "The size of the cache to " + "hold the SQL statements for the binary log during a " + "transaction. If you often use big, multi-statement " + "transactions you can increase this to get more performance", + GLOBAL_VAR(binlog_cache_size), + CMD_LINE(REQUIRED_ARG), + VALID_RANGE(IO_SIZE, ULONG_MAX), DEFAULT(32768), BLOCK_SIZE(IO_SIZE)); + +static bool check_has_super(sys_var *self, THD *thd, set_var *var) +{ + DBUG_ASSERT(self->scope() != sys_var::GLOBAL);// don't abuse check_has_super() +#ifndef NO_EMBEDDED_ACCESS_CHECKS + if (!(thd->security_ctx->master_access & SUPER_ACL)) + { + my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); + return true; + } +#endif + return false; +} +static bool binlog_format_check(sys_var *self, THD *thd, set_var *var) +{ + if (check_has_super(self, thd, var)) + return true; + if (var->type == OPT_GLOBAL || + (thd->variables.binlog_format == var->save_result.ulonglong_value)) + return false; + + /* + If RBR and open temporary tables, their CREATE TABLE may not be in the + binlog, so we can't toggle to SBR in this connection. + */ + if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) && + thd->temporary_tables) + { + my_error(ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, MYF(0)); + return true; + } + /* + if in a stored function/trigger, it's too late to change mode + */ + if (thd->in_sub_stmt) + { + my_error(ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0)); + return true; + } + return false; +} + +static bool fix_binlog_format_after_update(sys_var *self, THD *thd, + enum_var_type type) +{ + if (type == OPT_SESSION) + thd->reset_current_stmt_binlog_row_based(); + return false; +} + +static Sys_var_enum Sys_binlog_format( + "binlog_format", "What form of binary logging the master will " + "use: either ROW for row-based binary logging, STATEMENT " + "for statement-based binary logging, or MIXED. MIXED is statement-" + "based binary logging except for those statements where only row-" + "based is correct: those which involve user-defined functions (i.e. " + "UDFs) or the UUID() function; for those, row-based binary logging is " + "automatically used. If NDBCLUSTER is enabled and binlog-format is " + "MIXED, the format switches to row-based and back implicitly per each " + "query accessing an NDBCLUSTER table", + SESSION_VAR(binlog_format), CMD_LINE(REQUIRED_ARG, OPT_BINLOG_FORMAT), + binlog_format_names, DEFAULT(BINLOG_FORMAT_STMT), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(binlog_format_check), + ON_UPDATE(fix_binlog_format_after_update)); + +static Sys_var_ulong Sys_bulk_insert_buff_size( + "bulk_insert_buffer_size", "Size of tree cache used in bulk " + "insert optimisation. Note that this is a limit per thread!", + SESSION_VAR(bulk_insert_buff_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(8192*1024), BLOCK_SIZE(1)); + +static Sys_var_charptr Sys_character_sets_dir( + "character_sets_dir", "Directory where character sets are", + READ_ONLY GLOBAL_VAR(charsets_dir), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static bool check_not_null(sys_var *self, THD *thd, set_var *var) +{ + return var->value && var->value->is_null(); +} +static bool check_charset(sys_var *self, THD *thd, set_var *var) +{ + if (!var->value) + return false; + + char buff[STRING_BUFFER_USUAL_SIZE]; + if (var->value->result_type() == STRING_RESULT) + { + String str(buff, sizeof(buff), system_charset_info), *res; + if (!(res=var->value->val_str(&str))) + var->save_result.ptr= NULL; + else if (!(var->save_result.ptr= get_charset_by_csname(res->c_ptr(), + MY_CS_PRIMARY, + MYF(0))) && + !(var->save_result.ptr= get_old_charset_by_name(res->c_ptr()))) + { + ErrConvString err(res); + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr()); + return true; + } + } + else // INT_RESULT + { + int csno= (int)var->value->val_int(); + if (!(var->save_result.ptr= get_charset(csno, MYF(0)))) + { + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), llstr(csno, buff)); + return true; + } + } + return false; +} +static bool check_charset_not_null(sys_var *self, THD *thd, set_var *var) +{ + return check_charset(self, thd, var) || check_not_null(self, thd, var); +} +static Sys_var_struct Sys_character_set_system( + "character_set_system", "The character set used by the server " + "for storing identifiers", + READ_ONLY GLOBAL_VAR(system_charset_info), NO_CMD_LINE, + offsetof(CHARSET_INFO, csname), DEFAULT(0)); + +static Sys_var_struct Sys_character_set_server( + "character_set_server", "The default character set", + SESSION_VAR(collation_server), NO_CMD_LINE, + offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_not_null)); + +static bool check_charset_db(sys_var *self, THD *thd, set_var *var) +{ + if (check_charset_not_null(self, thd, var)) + return true; + if (!var->value) // = DEFAULT + var->save_result.ptr= thd->db_charset; + return false; +} +static Sys_var_struct Sys_character_set_database( + "character_set_database", + " The character set used by the default database", + SESSION_VAR(collation_database), NO_CMD_LINE, + offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_db)); + +static bool check_cs_client(sys_var *self, THD *thd, set_var *var) +{ + if (check_charset_not_null(self, thd, var)) + return true; + + // Currently, UCS-2 cannot be used as a client character set + if (((CHARSET_INFO *)(var->save_result.ptr))->mbminlen > 1) + return true; + + return false; +} +static bool fix_thd_charset(sys_var *self, THD *thd, enum_var_type type) +{ + if (type == OPT_SESSION) + thd->update_charset(); + return false; +} +static Sys_var_struct Sys_character_set_client( + "character_set_client", "The character set for statements " + "that arrive from the client", + SESSION_VAR(character_set_client), NO_CMD_LINE, + offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_cs_client), + ON_UPDATE(fix_thd_charset)); + +static Sys_var_struct Sys_character_set_connection( + "character_set_connection", "The character set used for " + "literals that do not have a character set introducer and for " + "number-to-string conversion", + SESSION_VAR(collation_connection), NO_CMD_LINE, + offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_not_null), + ON_UPDATE(fix_thd_charset)); + +static Sys_var_struct Sys_character_set_results( + "character_set_results", "The character set used for returning " + "query results to the client", + SESSION_VAR(character_set_results), NO_CMD_LINE, + offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_charset)); + +static Sys_var_struct Sys_character_set_filesystem( + "character_set_filesystem", "The filesystem character set", + SESSION_VAR(character_set_filesystem), NO_CMD_LINE, + offsetof(CHARSET_INFO, csname), DEFAULT(&character_set_filesystem), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_charset_not_null), + ON_UPDATE(fix_thd_charset)); + +static const char *completion_type_names[]= {"NO_CHAIN", "CHAIN", "RELEASE", 0}; +static Sys_var_enum Sys_completion_type( + "completion_type", "The transaction completion type, one of " + "NO_CHAIN, CHAIN, RELEASE", + SESSION_VAR(completion_type), CMD_LINE(REQUIRED_ARG), + completion_type_names, DEFAULT(0)); + +static bool check_collation_not_null(sys_var *self, THD *thd, set_var *var) +{ + if (!var->value) + return false; + + char buff[STRING_BUFFER_USUAL_SIZE]; + if (var->value->result_type() == STRING_RESULT) + { + String str(buff, sizeof(buff), system_charset_info), *res; + if (!(res= var->value->val_str(&str))) + var->save_result.ptr= NULL; + else if (!(var->save_result.ptr= get_charset_by_name(res->c_ptr(), MYF(0)))) + { + ErrConvString err(res); + my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr()); + return true; + } + } + else // INT_RESULT + { + int csno= (int)var->value->val_int(); + if (!(var->save_result.ptr= get_charset(csno, MYF(0)))) + { + my_error(ER_UNKNOWN_COLLATION, MYF(0), llstr(csno, buff)); + return true; + } + } + return check_not_null(self, thd, var); +} +static Sys_var_struct Sys_collation_connection( + "collation_connection", "The collation of the connection " + "character set", + SESSION_VAR(collation_connection), NO_CMD_LINE, + offsetof(CHARSET_INFO, name), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_collation_not_null), + ON_UPDATE(fix_thd_charset)); + +static bool check_collation_db(sys_var *self, THD *thd, set_var *var) +{ + if (check_collation_not_null(self, thd, var)) + return true; + if (!var->value) // = DEFAULT + var->save_result.ptr= thd->db_charset; + return false; +} +static Sys_var_struct Sys_collation_database( + "collation_database", "The collation of the database " + "character set", + SESSION_VAR(collation_database), NO_CMD_LINE, + offsetof(CHARSET_INFO, name), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_collation_db)); + +static Sys_var_struct Sys_collation_server( + "collation_server", "The server default collation", + SESSION_VAR(collation_server), NO_CMD_LINE, + offsetof(CHARSET_INFO, name), DEFAULT(&default_charset_info), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_collation_not_null)); + +static const char *concurrent_insert_names[]= {"NEVER", "AUTO", "ALWAYS", 0}; +static Sys_var_enum Sys_concurrent_insert( + "concurrent_insert", "Use concurrent insert with MyISAM. Possible " + "values are NEVER, AUTO, ALWAYS", + GLOBAL_VAR(myisam_concurrent_insert), CMD_LINE(OPT_ARG), + concurrent_insert_names, DEFAULT(1)); + +static Sys_var_ulong Sys_connect_timeout( + "connect_timeout", + "The number of seconds the mysqld server is waiting for a connect " + "packet before responding with 'Bad handshake'", + GLOBAL_VAR(connect_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(2, LONG_TIMEOUT), DEFAULT(CONNECT_TIMEOUT), BLOCK_SIZE(1)); + +static Sys_var_charptr Sys_datadir( + "datadir", "Path to the database root directory", + READ_ONLY GLOBAL_VAR(mysql_real_data_home_ptr), + CMD_LINE(REQUIRED_ARG, 'h'), IN_FS_CHARSET, DEFAULT(0)); + +#ifndef DBUG_OFF +static Sys_var_dbug Sys_dbug( + "debug", "Debug log", sys_var::SESSION, + CMD_LINE(OPT_ARG, '#'), DEFAULT(""), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_has_super)); +#endif + +/** + @todo + When updating myisam_delay_key_write, we should do a 'flush tables' + of all MyISAM tables to ensure that they are reopen with the + new attribute. +*/ +export bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type) +{ + switch (delay_key_write_options) { + case DELAY_KEY_WRITE_NONE: + myisam_delay_key_write=0; + break; + case DELAY_KEY_WRITE_ON: + myisam_delay_key_write=1; + break; + case DELAY_KEY_WRITE_ALL: + myisam_delay_key_write=1; + ha_open_options|= HA_OPEN_DELAY_KEY_WRITE; + break; + } + return false; +} +static const char *delay_key_write_names[]= { "OFF", "ON", "ALL", NullS }; +static Sys_var_enum Sys_delay_key_write( + "delay_key_write", "Type of DELAY_KEY_WRITE", + GLOBAL_VAR(delay_key_write_options), CMD_LINE(OPT_ARG), + delay_key_write_names, DEFAULT(DELAY_KEY_WRITE_ON), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_delay_key_write)); + +static Sys_var_ulong Sys_delayed_insert_limit( + "delayed_insert_limit", + "After inserting delayed_insert_limit rows, the INSERT DELAYED " + "handler will check if there are any SELECT statements pending. " + "If so, it allows these to execute before continuing", + GLOBAL_VAR(delayed_insert_limit), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(DELAYED_LIMIT), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_delayed_insert_timeout( + "delayed_insert_timeout", + "How long a INSERT DELAYED thread should wait for INSERT statements " + "before terminating", + GLOBAL_VAR(delayed_insert_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(DELAYED_WAIT_TIMEOUT), + BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_delayed_queue_size( + "delayed_queue_size", + "What size queue (in rows) should be allocated for handling INSERT " + "DELAYED. If the queue becomes full, any client that does INSERT " + "DELAYED will wait until there is room in the queue again", + GLOBAL_VAR(delayed_queue_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(DELAYED_QUEUE_SIZE), BLOCK_SIZE(1)); + +#ifdef HAVE_EVENT_SCHEDULER +static const char *event_scheduler_names[]= { "OFF", "ON", "DISABLED", NullS }; +static bool event_scheduler_check(sys_var *self, THD *thd, set_var *var) +{ + /* DISABLED is only accepted on the command line */ + if (var->save_result.ulonglong_value == Events::EVENTS_DISABLED) + return true; + /* + If the scheduler was disabled because there are no/bad + system tables, produce a more meaningful error message + than ER_OPTION_PREVENTS_STATEMENT + */ + if (Events::check_if_system_tables_error()) + return true; + if (Events::opt_event_scheduler == Events::EVENTS_DISABLED) + { + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), + "--event-scheduler=DISABLED or --skip-grant-tables"); + return true; + } + return false; +} +static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type) +{ + pthread_mutex_unlock(&LOCK_global_system_variables); + /* + Events::start() is heavyweight. In particular it creates a new THD, + which takes LOCK_global_system_variables internally. + Thus we have to release it here. + We need to re-take it before returning, though. + And we need to take it *without* holding Events::LOCK_event_metadata. + */ + 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); + if (ret) + my_error(ER_EVENT_SET_VAR_ERROR, MYF(0)); + return ret; +} +static PolyLock_mutex PLock_event_metadata(&Events::LOCK_event_metadata); +static Sys_var_enum Sys_event_scheduler( + "event_scheduler", "Enable the event scheduler. Possible values are " + "ON, OFF, and DISABLED (keep the event scheduler completely " + "deactivated, it cannot be activated run-time)", + GLOBAL_VAR(Events::opt_event_scheduler), CMD_LINE(OPT_ARG), + event_scheduler_names, DEFAULT(Events::EVENTS_OFF), + &PLock_event_metadata, NOT_IN_BINLOG, + ON_CHECK(event_scheduler_check), ON_UPDATE(event_scheduler_update)); +#endif + +static Sys_var_ulong Sys_expire_logs_days( + "expire_logs_days", + "If non-zero, binary logs will be purged after expire_logs_days " + "days; possible purges happen at startup and at binary log rotation", + GLOBAL_VAR(expire_logs_days), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 99), DEFAULT(0), BLOCK_SIZE(1)); + +static Sys_var_mybool Sys_flush( + "flush", "Flush MyISAM tables to disk between SQL commands", + GLOBAL_VAR(myisam_flush), + CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +static Sys_var_ulong Sys_flush_time( + "flush_time", + "A dedicated thread is created to flush all tables at the " + "given interval", + GLOBAL_VAR(flush_time), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), + DEFAULT(FLUSH_TIME), BLOCK_SIZE(1)); + +static bool check_ftb_syntax(sys_var *self, THD *thd, set_var *var) +{ + return ft_boolean_check_syntax_string((uchar*) + (var->save_result.string_value.str)); +} +static bool query_cache_flush(sys_var *self, THD *thd, enum_var_type type) +{ +#ifdef HAVE_QUERY_CACHE + query_cache.flush(); +#endif /* HAVE_QUERY_CACHE */ + return false; +} +/// @todo make SESSION_VAR (usability enhancement and a fix for a race condition) +static Sys_var_charptr Sys_ft_boolean_syntax( + "ft_boolean_syntax", "List of operators for " + "MATCH ... AGAINST ( ... IN BOOLEAN MODE)", + GLOBAL_VAR(ft_boolean_syntax), + CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, + DEFAULT(DEFAULT_FTB_SYNTAX), NO_MUTEX_GUARD, + NOT_IN_BINLOG, ON_CHECK(check_ftb_syntax), ON_UPDATE(query_cache_flush)); + +static Sys_var_ulong Sys_ft_max_word_len( + "ft_max_word_len", + "The maximum length of the word to be included in a FULLTEXT index. " + "Note: FULLTEXT indexes must be rebuilt after changing this variable", + READ_ONLY GLOBAL_VAR(ft_max_word_len), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(10, HA_FT_MAXCHARLEN), DEFAULT(HA_FT_MAXCHARLEN), + BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_ft_min_word_len( + "ft_min_word_len", + "The minimum length of the word to be included in a FULLTEXT index. " + "Note: FULLTEXT indexes must be rebuilt after changing this variable", + READ_ONLY GLOBAL_VAR(ft_min_word_len), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, HA_FT_MAXCHARLEN), DEFAULT(4), BLOCK_SIZE(1)); + +/// @todo make it an updatable SESSION_VAR +static Sys_var_ulong Sys_ft_query_expansion_limit( + "ft_query_expansion_limit", + "Number of best matches to use for query expansion", + READ_ONLY GLOBAL_VAR(ft_query_expansion_limit), + CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 1000), DEFAULT(20), BLOCK_SIZE(1)); + +static Sys_var_charptr Sys_ft_stopword_file( + "ft_stopword_file", + "Use stopwords from this file instead of built-in list", + READ_ONLY GLOBAL_VAR(ft_stopword_file), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_mybool Sys_ignore_builtin_innodb( + "ignore_builtin_innodb", + "Disable initialization of builtin InnoDB plugin", + READ_ONLY GLOBAL_VAR(opt_ignore_builtin_innodb), + CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +static bool check_init_string(sys_var *self, THD *thd, set_var *var) +{ + if (var->save_result.string_value.str == 0) + { + var->save_result.string_value.str= const_cast(""); + var->save_result.string_value.length= 0; + } + return false; +} +static PolyLock_rwlock PLock_sys_init_connect(&LOCK_sys_init_connect); +static Sys_var_lexstring Sys_init_connect( + "init_connect", "Command(s) that are executed for each " + "new connection", GLOBAL_VAR(opt_init_connect), + CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, + DEFAULT(""), &PLock_sys_init_connect, NOT_IN_BINLOG, + ON_CHECK(check_init_string)); + +static Sys_var_charptr Sys_init_file( + "init_file", "Read SQL commands from this file at startup", + READ_ONLY GLOBAL_VAR(opt_init_file), + IF_DISABLE_GRANT_OPTIONS(NO_CMD_LINE, CMD_LINE(REQUIRED_ARG)), + IN_FS_CHARSET, DEFAULT(0)); + +static PolyLock_rwlock PLock_sys_init_slave(&LOCK_sys_init_slave); +static Sys_var_lexstring Sys_init_slave( + "init_slave", "Command(s) that are executed by a slave server " + "each time the SQL thread starts", GLOBAL_VAR(opt_init_slave), + CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, + DEFAULT(""), &PLock_sys_init_slave, + NOT_IN_BINLOG, ON_CHECK(check_init_string)); + +static Sys_var_ulong Sys_interactive_timeout( + "interactive_timeout", + "The number of seconds the server waits for activity on an interactive " + "connection before closing it", + SESSION_VAR(net_interactive_timeout), + CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_join_buffer_size( + "join_buffer_size", + "The size of the buffer that is used for full joins", + SESSION_VAR(join_buff_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(128, ULONG_MAX), DEFAULT(128*1024), BLOCK_SIZE(128)); + +static Sys_var_keycache Sys_key_buffer_size( + "key_buffer_size", "The size of the buffer used for " + "index blocks for MyISAM tables. Increase this to get better index " + "handling (for all reads and multiple writes) to as much as you can " + "afford", + KEYCACHE_VAR(param_buff_size), + CMD_LINE(REQUIRED_ARG, OPT_KEY_BUFFER_SIZE), + VALID_RANGE(0, SIZE_T_MAX), DEFAULT(KEY_CACHE_SIZE), + BLOCK_SIZE(IO_SIZE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_buffer_size)); + +static Sys_var_keycache Sys_key_cache_block_size( + "key_cache_block_size", "The default size of key cache blocks", + KEYCACHE_VAR(param_block_size), + CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_BLOCK_SIZE), + VALID_RANGE(512, 1024*16), DEFAULT(KEY_CACHE_BLOCK_SIZE), + BLOCK_SIZE(512), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_keycache_param)); + +static Sys_var_keycache Sys_key_cache_division_limit( + "key_cache_division_limit", + "The minimum percentage of warm blocks in key cache", + KEYCACHE_VAR(param_division_limit), + CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_DIVISION_LIMIT), + VALID_RANGE(1, 100), DEFAULT(100), + BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_keycache_param)); + +static Sys_var_keycache Sys_key_cache_age_threshold( + "key_cache_age_threshold", "This characterizes the number of " + "hits a hot block has to be untouched until it is considered aged " + "enough to be downgraded to a warm block. This specifies the " + "percentage ratio of that number of hits to the total number of " + "blocks in key cache", + KEYCACHE_VAR(param_age_threshold), + CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_AGE_THRESHOLD), + VALID_RANGE(100, ULONG_MAX), DEFAULT(300), + BLOCK_SIZE(100), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_keycache_param)); + +static Sys_var_mybool Sys_large_files_support( + "large_files_support", + "Whether mysqld was compiled with options for large file support", + READ_ONLY GLOBAL_VAR(opt_large_files), + NO_CMD_LINE, DEFAULT(sizeof(my_off_t) > 4)); + +static Sys_var_uint Sys_large_page_size( + "large_page_size", + "If large page support is enabled, this shows the size of memory pages", + READ_ONLY GLOBAL_VAR(opt_large_page_size), NO_CMD_LINE, + VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); + +static Sys_var_mybool Sys_large_pages( + "large_pages", "Enable support for large pages", + READ_ONLY GLOBAL_VAR(opt_large_files), + IF_WIN(NO_CMD_LINE, CMD_LINE(OPT_ARG)), DEFAULT(FALSE)); + +static Sys_var_charptr Sys_language( + "lc_messages_dir", "Directory where error messages are", + READ_ONLY GLOBAL_VAR(lc_messages_dir_ptr), CMD_LINE(REQUIRED_ARG, 'L'), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_mybool Sys_local_infile( + "local_infile", "Enable LOAD DATA LOCAL INFILE", + GLOBAL_VAR(opt_local_infile), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); + +#ifdef HAVE_MLOCKALL +static Sys_var_mybool Sys_locked_in_memory( + "locked_in_memory", + "Whether mysqld was locked in memory with --memlock", + READ_ONLY GLOBAL_VAR(locked_in_memory), NO_CMD_LINE, DEFAULT(FALSE)); +#endif + +/* this says NO_CMD_LINE, as command-line option takes a string, not a bool */ +static Sys_var_mybool Sys_log_bin( + "log_bin", "Whether the binary log is enabled", + READ_ONLY GLOBAL_VAR(opt_bin_log), NO_CMD_LINE, DEFAULT(FALSE)); + +static Sys_var_mybool Sys_trust_function_creators( + "log_bin_trust_function_creators", + "If set to FALSE (the default), then when --log-bin is used, creation " + "of a stored function (or trigger) is allowed only to users having the " + "SUPER privilege and only if this stored function (trigger) may not " + "break binary logging. Note that if ALL connections to this server " + "ALWAYS use row-based binary logging, the security issues do not " + "exist and the binary logging cannot break, so you can safely set " + "this to TRUE", + GLOBAL_VAR(trust_function_creators), + CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +static Sys_var_charptr Sys_log_error( + "log_error", "Error log file", + READ_ONLY GLOBAL_VAR(log_error_file_ptr), CMD_LINE(OPT_ARG), + IN_FS_CHARSET, DEFAULT(disabled_my_option)); + +static Sys_var_mybool Sys_log_queries_not_using_indexes( + "log_queries_not_using_indexes", + "Log queries that are executed without benefit of any index to the " + "slow log if it is open", + GLOBAL_VAR(opt_log_queries_not_using_indexes), + CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +static Sys_var_ulong Sys_log_warnings( + "log_warnings", + "Log some not critical warnings to the log file", + SESSION_VAR(log_warnings), + CMD_LINE(OPT_ARG, 'W'), + VALID_RANGE(0, ULONG_MAX), DEFAULT(1), BLOCK_SIZE(1)); + +static bool update_cached_long_query_time(sys_var *self, THD *thd, + enum_var_type type) +{ + if (type == OPT_SESSION) + thd->variables.long_query_time= + thd->variables.long_query_time_double * 1e6; + else + global_system_variables.long_query_time= + global_system_variables.long_query_time_double * 1e6; + return false; +} + +static Sys_var_double Sys_long_query_time( + "long_query_time", + "Log all queries that have taken more than long_query_time seconds " + "to execute to file. The argument will be treated as a decimal value " + "with microsecond precision", + SESSION_VAR(long_query_time_double), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(10), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_cached_long_query_time)); + +static bool fix_low_prio_updates(sys_var *self, THD *thd, enum_var_type type) +{ + if (type == OPT_SESSION) + thd->update_lock_default= (thd->variables.low_priority_updates ? + TL_WRITE_LOW_PRIORITY : TL_WRITE); + else + thr_upgraded_concurrent_insert_lock= + (global_system_variables.low_priority_updates ? + TL_WRITE_LOW_PRIORITY : TL_WRITE); + return false; +} +static Sys_var_mybool Sys_low_priority_updates( + "low_priority_updates", + "INSERT/DELETE/UPDATE has lower priority than selects", + SESSION_VAR(low_priority_updates), + CMD_LINE(OPT_ARG), + DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_low_prio_updates)); + +#ifndef TO_BE_DELETED /* Alias for the low_priority_updates */ +static Sys_var_mybool Sys_sql_low_priority_updates( + "sql_low_priority_updates", + "INSERT/DELETE/UPDATE has lower priority than selects", + SESSION_VAR(low_priority_updates), NO_CMD_LINE, + DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_low_prio_updates)); +#endif + +static Sys_var_mybool Sys_lower_case_file_system( + "lower_case_file_system", + "Case sensitivity of file names on the file system where the " + "data directory is located", + READ_ONLY GLOBAL_VAR(lower_case_file_system), NO_CMD_LINE, + DEFAULT(FALSE)); + +static Sys_var_uint Sys_lower_case_table_names( + "lower_case_table_names", + "If set to 1 table names are stored in lowercase on disk and table " + "names will be case-insensitive. Should be set to 2 if you are using " + "a case insensitive file system", + READ_ONLY GLOBAL_VAR(lower_case_table_names), + CMD_LINE(OPT_ARG, OPT_LOWER_CASE_TABLE_NAMES), + VALID_RANGE(0, 2), +#ifdef FN_NO_CASE_SENSE + DEFAULT(1), +#else + DEFAULT(0), +#endif + BLOCK_SIZE(1)); + +static bool session_readonly(sys_var *self, THD *thd, set_var *var) +{ + if (var->type == OPT_GLOBAL) + return false; + my_error(ER_VARIABLE_IS_READONLY, MYF(0), "SESSION", + self->name.str, "GLOBAL"); + return true; +} +static Sys_var_ulong Sys_max_allowed_packet( + "max_allowed_packet", + "Max packet length to send to or receive from the server", + SESSION_VAR(max_allowed_packet), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, 1024*1024*1024), DEFAULT(1024*1024), + BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(session_readonly)); + +static Sys_var_ulonglong Sys_max_binlog_cache_size( + "max_binlog_cache_size", + "Can be used to restrict the total size used to cache a " + "multi-transaction query", + GLOBAL_VAR(max_binlog_cache_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(IO_SIZE, ULONGLONG_MAX), + DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE), + BLOCK_SIZE(IO_SIZE)); + +static bool fix_max_binlog_size(sys_var *self, THD *thd, enum_var_type type) +{ + mysql_bin_log.set_max_size(max_binlog_size); +#ifdef HAVE_REPLICATION + if (!max_relay_log_size) + active_mi->rli.relay_log.set_max_size(max_binlog_size); +#endif + return false; +} +static Sys_var_ulong Sys_max_binlog_size( + "max_binlog_size", + "Binary log will be rotated automatically when the size exceeds this " + "value. Will also apply to relay logs if max_relay_log_size is 0", + GLOBAL_VAR(max_binlog_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(IO_SIZE, 1024*1024L*1024L), DEFAULT(1024*1024L*1024L), + BLOCK_SIZE(IO_SIZE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_max_binlog_size)); + +static bool fix_max_connections(sys_var *self, THD *thd, enum_var_type type) +{ +#ifndef EMBEDDED_LIBRARY + resize_thr_alarm(max_connections + + global_system_variables.max_insert_delayed_threads + 10); +#endif + return false; +} + +// Default max_connections of 151 is larger than Apache's default max +// children, to avoid "too many connections" error in a common setup +static Sys_var_ulong Sys_max_connections( + "max_connections", "The number of simultaneous clients allowed", + GLOBAL_VAR(max_connections), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, 100000), DEFAULT(151), BLOCK_SIZE(1), NO_MUTEX_GUARD, + NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_max_connections)); + +static Sys_var_ulong Sys_max_connect_errors( + "max_connect_errors", + "If there is more than this number of interrupted connections from " + "a host this host will be blocked from further connections", + GLOBAL_VAR(max_connect_errors), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(MAX_CONNECT_ERRORS), + BLOCK_SIZE(1)); + +static bool check_max_delayed_threads(sys_var *self, THD *thd, set_var *var) +{ + return var->type != OPT_GLOBAL && + var->save_result.ulonglong_value != 0 && + var->save_result.ulonglong_value != + global_system_variables.max_insert_delayed_threads; +} + +// Alias for max_delayed_threads +static Sys_var_ulong Sys_max_insert_delayed_threads( + "max_insert_delayed_threads", + "Don't start more than this number of threads to handle INSERT " + "DELAYED statements. If set to zero INSERT DELAYED will be not used", + SESSION_VAR(max_insert_delayed_threads), + NO_CMD_LINE, VALID_RANGE(0, 16384), DEFAULT(20), + BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_max_delayed_threads), ON_UPDATE(fix_max_connections)); + +static Sys_var_ulong Sys_max_delayed_threads( + "max_delayed_threads", + "Don't start more than this number of threads to handle INSERT " + "DELAYED statements. If set to zero INSERT DELAYED will be not used", + SESSION_VAR(max_insert_delayed_threads), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 16384), DEFAULT(20), + BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_max_delayed_threads), ON_UPDATE(fix_max_connections)); + +static Sys_var_ulong Sys_max_error_count( + "max_error_count", + "Max number of errors/warnings to store for a statement", + SESSION_VAR(max_error_count), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 65535), DEFAULT(DEFAULT_ERROR_COUNT), BLOCK_SIZE(1)); + +static Sys_var_ulonglong Sys_max_heap_table_size( + "max_heap_table_size", + "Don't allow creation of heap tables bigger than this", + SESSION_VAR(max_heap_table_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(16384, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024), + BLOCK_SIZE(1024)); + +static Sys_var_ulong Sys_pseudo_thread_id( + "pseudo_thread_id", + "This variable is for internal server use", + SESSION_ONLY(pseudo_thread_id), + NO_CMD_LINE, VALID_RANGE(0, ULONG_MAX), DEFAULT(0), + BLOCK_SIZE(1), NO_MUTEX_GUARD, IN_BINLOG, + ON_CHECK(check_has_super)); + +static bool fix_max_join_size(sys_var *self, THD *thd, enum_var_type type) +{ + SV *sv= type == OPT_GLOBAL ? &global_system_variables : &thd->variables; + if (sv->max_join_size == HA_POS_ERROR) + sv->option_bits|= OPTION_BIG_SELECTS; + else + sv->option_bits&= ~OPTION_BIG_SELECTS; + return false; +} +static Sys_var_harows Sys_max_join_size( + "max_join_size", + "Joins that are probably going to read more than max_join_size " + "records return an error", + SESSION_VAR(max_join_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_max_join_size)); + +static Sys_var_ulong Sys_max_seeks_for_key( + "max_seeks_for_key", + "Limit assumed max number of seeks when looking up rows based on a key", + SESSION_VAR(max_seeks_for_key), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(ULONG_MAX), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_max_length_for_sort_data( + "max_length_for_sort_data", + "Max number of bytes in sorted records", + SESSION_VAR(max_length_for_sort_data), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(4, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1)); + +static Sys_var_harows Sys_sql_max_join_size( + "sql_max_join_size", "Alias for max_join_size", + SESSION_VAR(max_join_size), NO_CMD_LINE, + VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_max_join_size), DEPRECATED(70000, 0)); + +static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count); +static Sys_var_ulong Sys_max_prepared_stmt_count( + "max_prepared_stmt_count", + "Maximum number of prepared statements in the server", + GLOBAL_VAR(max_prepared_stmt_count), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 1024*1024), DEFAULT(16382), BLOCK_SIZE(1), + &PLock_prepared_stmt_count); + +static bool fix_max_relay_log_size(sys_var *self, THD *thd, enum_var_type type) +{ +#ifdef HAVE_REPLICATION + active_mi->rli.relay_log.set_max_size(max_relay_log_size ? + max_relay_log_size: max_binlog_size); +#endif + return false; +} +static Sys_var_ulong Sys_max_relay_log_size( + "max_relay_log_size", + "If non-zero: relay log will be rotated automatically when the " + "size exceeds this value; if zero: when the size " + "exceeds max_binlog_size", + GLOBAL_VAR(max_relay_log_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 1024L*1024*1024), DEFAULT(0), BLOCK_SIZE(IO_SIZE), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_max_relay_log_size)); + +static Sys_var_ulong Sys_max_sort_length( + "max_sort_length", + "The number of bytes to use when sorting BLOB or TEXT values (only " + "the first max_sort_length bytes of each value are used; the rest " + "are ignored)", + SESSION_VAR(max_sort_length), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(4, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_max_sp_recursion_depth( + "max_sp_recursion_depth", + "Maximum stored procedure recursion depth", + SESSION_VAR(max_sp_recursion_depth), CMD_LINE(OPT_ARG), + VALID_RANGE(0, 255), DEFAULT(0), BLOCK_SIZE(1)); + +// non-standard session_value_ptr() here +static Sys_var_max_user_conn Sys_max_user_connections( + "max_user_connections", + "The maximum number of active connections for a single user " + "(0 = no limit)", + SESSION_VAR(max_user_connections), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1), NO_MUTEX_GUARD, + NOT_IN_BINLOG, ON_CHECK(session_readonly)); + +static Sys_var_ulong Sys_max_tmp_tables( + "max_tmp_tables", + "Maximum number of temporary tables a client can keep open at a time", + SESSION_VAR(max_tmp_tables), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(32), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_max_write_lock_count( + "max_write_lock_count", + "After this many write locks, allow some read locks to run in between", + GLOBAL_VAR(max_write_lock_count), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(ULONG_MAX), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_min_examined_row_limit( + "min_examined_row_limit", + "Don't write queries to slow log that examine fewer rows " + "than that", + SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1)); + +#ifdef _WIN32 +static Sys_var_mybool Sys_named_pipe( + "named_pipe", "Enable the named pipe (NT)", + READ_ONLY GLOBAL_VAR(opt_enable_named_pipe), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); +#endif + +static Sys_var_ulong Sys_net_buffer_length( + "net_buffer_length", + "Buffer length for TCP/IP and socket communication", + SESSION_VAR(net_buffer_length), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, 1024*1024), DEFAULT(16384), BLOCK_SIZE(1024), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(session_readonly)); + +static bool fix_net_read_timeout(sys_var *self, THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + my_net_set_read_timeout(&thd->net, thd->variables.net_read_timeout); + return false; +} +static Sys_var_ulong Sys_net_read_timeout( + "net_read_timeout", + "Number of seconds to wait for more data from a connection before " + "aborting the read", + SESSION_VAR(net_read_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_net_read_timeout)); + +static bool fix_net_write_timeout(sys_var *self, THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + my_net_set_write_timeout(&thd->net, thd->variables.net_write_timeout); + return false; +} +static Sys_var_ulong Sys_net_write_timeout( + "net_write_timeout", + "Number of seconds to wait for a block to be written to a connection " + "before aborting the write", + SESSION_VAR(net_write_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_net_write_timeout)); + +static bool fix_net_retry_count(sys_var *self, THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + thd->net.retry_count=thd->variables.net_retry_count; + return false; +} +static Sys_var_ulong Sys_net_retry_count( + "net_retry_count", + "If a read on a communication port is interrupted, retry this " + "many times before giving up", + SESSION_VAR(net_retry_count), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(MYSQLD_NET_RETRY_COUNT), + BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_net_retry_count)); + +static Sys_var_mybool Sys_new_mode( + "new", "Use very new possible \"unsafe\" functions", + SESSION_VAR(new_mode), CMD_LINE(OPT_ARG, 'n'), DEFAULT(FALSE)); + +static Sys_var_mybool Sys_old_mode( + "old", "Use compatible behavior", + READ_ONLY GLOBAL_VAR(old_mode), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +static Sys_var_mybool Sys_old_alter_table( + "old_alter_table", "Use old, non-optimized alter table", + SESSION_VAR(old_alter_table), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +static bool check_old_passwords(sys_var *self, THD *thd, set_var *var) +{ + return mysql_user_table_is_in_short_password_format; +} +static Sys_var_mybool Sys_old_passwords( + "old_passwords", + "Use old password encryption method (needed for 4.0 and older clients)", + SESSION_VAR(old_passwords), CMD_LINE(OPT_ARG), DEFAULT(FALSE), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_old_passwords)); + +static Sys_var_ulong Sys_open_files_limit( + "open_files_limit", + "If this is not 0, then mysqld will use this value to reserve file " + "descriptors to use with setrlimit(). If this value is 0 then mysqld " + "will reserve max_connections*5 or max_connections + table_cache*2 " + "(whichever is larger) number of file descriptors", + READ_ONLY GLOBAL_VAR(open_files_limit), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, OS_FILE_LIMIT), DEFAULT(0), BLOCK_SIZE(1)); + +/// @todo change to enum +static Sys_var_ulong Sys_optimizer_prune_level( + "optimizer_prune_level", + "Controls the heuristic(s) applied during query optimization to prune " + "less-promising partial plans from the optimizer search space. " + "Meaning: 0 - do not apply any heuristic, thus perform exhaustive " + "search; 1 - prune plans based on number of retrieved rows", + SESSION_VAR(optimizer_prune_level), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 1), DEFAULT(1), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_optimizer_search_depth( + "optimizer_search_depth", + "Maximum depth of search performed by the query optimizer. Values " + "larger than the number of relations in a query result in better " + "query plans, but take longer to compile a query. Values smaller " + "than the number of tables in a relation result in faster " + "optimization, but may produce very bad query plans. If set to 0, " + "the system will automatically pick a reasonable value; if set to " + "63, the optimizer will switch to the original find_best search" + "(used for testing/comparison)", + SESSION_VAR(optimizer_search_depth), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, MAX_TABLES+2), DEFAULT(MAX_TABLES+1), BLOCK_SIZE(1)); + +static const char *optimizer_switch_names[]= +{ + "index_merge", "index_merge_union", "index_merge_sort_union", + "index_merge_intersection", + "default", NullS +}; +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}", + SESSION_VAR(optimizer_switch), CMD_LINE(REQUIRED_ARG), + optimizer_switch_names, DEFAULT(OPTIMIZER_SWITCH_DEFAULT)); + +static Sys_var_charptr Sys_pid_file( + "pid_file", "Pid file used by safe_mysqld", + READ_ONLY GLOBAL_VAR(pidfile_name_ptr), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_plugin_dir( + "plugin_dir", "Directory for plugins", + READ_ONLY GLOBAL_VAR(opt_plugin_dir_ptr), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_uint Sys_port( + "port", + "Port number to use for connection or 0 to default to, " + "my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) "), whatever comes first", + READ_ONLY GLOBAL_VAR(mysqld_port), CMD_LINE(REQUIRED_ARG, 'P'), + VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_preload_buff_size( + "preload_buffer_size", + "The size of the buffer that is allocated when preloading indexes", + SESSION_VAR(preload_buff_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, 1024*1024*1024), DEFAULT(32768), BLOCK_SIZE(1)); + +static Sys_var_uint Sys_protocol_version( + "protocol_version", + "The version of the client/server protocol used by the MySQL server", + READ_ONLY GLOBAL_VAR(protocol_version), NO_CMD_LINE, + VALID_RANGE(0, ~0), DEFAULT(PROTOCOL_VERSION), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_read_buff_size( + "read_buffer_size", + "Each thread that does a sequential scan allocates a buffer of " + "this size for each table it scans. If you do many sequential scans, " + "you may want to increase this value", + SESSION_VAR(read_buff_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(IO_SIZE*2, INT_MAX32), DEFAULT(128*1024), + BLOCK_SIZE(IO_SIZE)); + +static my_bool read_only; +static bool check_read_only(sys_var *self, THD *thd, set_var *var) +{ + /* Prevent self dead-lock */ + if (thd->locked_tables || thd->active_transaction()) + { + my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0)); + return true; + } + return false; +} +static bool fix_read_only(sys_var *self, THD *thd, enum_var_type type) +{ + bool result= true; + my_bool new_read_only= read_only; // make a copy before releasing a mutex + DBUG_ENTER("sys_var_opt_readonly::update"); + + if (read_only == FALSE || read_only == opt_readonly) + { + opt_readonly= read_only; + DBUG_RETURN(false); + } + + if (check_read_only(self, thd, 0)) // just in case + goto end; + + if (thd->global_read_lock) + { + /* + This connection already holds the global read lock. + This can be the case with: + - FLUSH TABLES WITH READ LOCK + - SET GLOBAL READ_ONLY = 1 + */ + opt_readonly= read_only; + DBUG_RETURN(false); + } + + /* + Perform a 'FLUSH TABLES WITH READ LOCK'. + This is a 3 step process: + - [1] lock_global_read_lock() + - [2] close_cached_tables() + - [3] make_global_read_lock_block_commit() + [1] prevents new connections from obtaining tables locked for write. + [2] waits until all existing connections close their tables. + [3] prevents transactions from being committed. + */ + + read_only= opt_readonly; + pthread_mutex_unlock(&LOCK_global_system_variables); + + if (lock_global_read_lock(thd)) + goto end_with_mutex_unlock; + + /* + This call will be blocked by any connection holding a READ or WRITE lock. + Ideally, we want to wait only for pending WRITE locks, but since: + con 1> LOCK TABLE T FOR READ; + con 2> LOCK TABLE T FOR WRITE; (blocked by con 1) + con 3> SET GLOBAL READ ONLY=1; (blocked by con 2) + can cause to wait on a read lock, it's required for the client application + to unlock everything, and acceptable for the server to wait on all locks. + */ + if ((result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE))) + goto end_with_read_lock; + + if ((result= make_global_read_lock_block_commit(thd))) + goto end_with_read_lock; + + /* Change the opt_readonly system variable, safe because the lock is held */ + opt_readonly= new_read_only; + result= false; + + end_with_read_lock: + /* Release the lock */ + unlock_global_read_lock(thd); + end_with_mutex_unlock: + pthread_mutex_lock(&LOCK_global_system_variables); + end: + read_only= opt_readonly; + DBUG_RETURN(result); +} +static Sys_var_mybool Sys_readonly( + "read_only", + "Make all non-temporary tables read-only, with the exception for " + "replication (slave) threads and users with the SUPER privilege", + GLOBAL_VAR(read_only), CMD_LINE(OPT_ARG), DEFAULT(FALSE), + NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_read_only), ON_UPDATE(fix_read_only)); + +// Small lower limit to be able to test MRR +static Sys_var_ulong Sys_read_rnd_buff_size( + "read_rnd_buffer_size", + "When reading rows in sorted order after a sort, the rows are read " + "through this buffer to avoid a disk seeks. If not set, then it's " + "set to the value of record_buffer", + SESSION_VAR(read_rnd_buff_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, INT_MAX32), DEFAULT(256*1024), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_div_precincrement( + "div_precision_increment", "Precision of the result of '/' " + "operator will be increased on that value", + SESSION_VAR(div_precincrement), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, DECIMAL_MAX_SCALE), DEFAULT(4), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_rpl_recovery_rank( + "rpl_recovery_rank", "Unused, will be removed", + GLOBAL_VAR(rpl_recovery_rank), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), + DEPRECATED(70000, 0)); + +static Sys_var_ulong Sys_range_alloc_block_size( + "range_alloc_block_size", + "Allocation block size for storing ranges during optimization", + SESSION_VAR(range_alloc_block_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX), + DEFAULT(RANGE_ALLOC_BLOCK_SIZE), BLOCK_SIZE(1024)); + +static Sys_var_ulong Sys_multi_range_count( + "multi_range_count", "Number of key ranges to request at once", + SESSION_VAR(multi_range_count), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(256), BLOCK_SIZE(1)); + +static bool fix_thd_mem_root(sys_var *self, THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + reset_root_defaults(thd->mem_root, + thd->variables.query_alloc_block_size, + thd->variables.query_prealloc_size); + return false; +} +static Sys_var_ulong Sys_query_alloc_block_size( + "query_alloc_block_size", + "Allocation block size for query parsing and execution", + SESSION_VAR(query_alloc_block_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, ULONG_MAX), DEFAULT(QUERY_ALLOC_BLOCK_SIZE), + BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_thd_mem_root)); + +static Sys_var_ulong Sys_query_prealloc_size( + "query_prealloc_size", + "Persistent buffer for query parsing and execution", + SESSION_VAR(query_prealloc_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(QUERY_ALLOC_PREALLOC_SIZE, ULONG_MAX), + DEFAULT(QUERY_ALLOC_PREALLOC_SIZE), + BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_thd_mem_root)); + +#ifdef HAVE_SMEM +static Sys_var_mybool Sys_shared_memory( + "shared_memory", "Enable the shared memory", + READ_ONLY GLOBAL_VAR(opt_enable_shared_memory), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); + +static Sys_var_charptr Sys_shared_memory_base_name( + "shared_memory_base_name", "Base name of shared memory", + READ_ONLY GLOBAL_VAR(shared_memory_base_name), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); +#endif + +// this has to be NO_CMD_LINE as the command-line option has a different name +static Sys_var_mybool Sys_skip_external_locking( + "skip_external_locking", "Don't use system (external) locking", + READ_ONLY GLOBAL_VAR(my_disable_locking), NO_CMD_LINE, DEFAULT(TRUE)); + +static Sys_var_mybool Sys_skip_networking( + "skip_networking", "Don't allow connection with TCP/IP", + READ_ONLY GLOBAL_VAR(opt_disable_networking), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); + +static Sys_var_mybool Sys_skip_show_database( + "skip_show_database", "Don't allow 'SHOW DATABASE' commands", + READ_ONLY GLOBAL_VAR(opt_skip_show_db), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); + +static Sys_var_charptr Sys_socket( + "socket", "Socket file to use for connection", + READ_ONLY GLOBAL_VAR(mysqld_unix_port), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +#ifdef HAVE_THR_SETCONCURRENCY +static Sys_var_ulong Sys_thread_concurrency( + "thread_concurrency", + "Permits the application to give the threads system a hint for " + "the desired number of threads that should be run at the same time", + READ_ONLY GLOBAL_VAR(concurrency), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1)); +#endif + +static Sys_var_ulong Sys_thread_stack( + "thread_stack", "The stack size for each thread", + READ_ONLY GLOBAL_VAR(my_thread_stack_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(128*1024, ULONG_MAX), DEFAULT(DEFAULT_THREAD_STACK), + BLOCK_SIZE(1024)); + +static Sys_var_charptr Sys_tmpdir( + "tmpdir", "Path for temporary files. Several paths may " + "be specified, separated by a " +#if defined(__WIN__) || defined(__NETWARE__) + "semicolon (;)" +#else + "colon (:)" +#endif + ", in this case they are used in a round-robin fashion", + READ_ONLY GLOBAL_VAR(opt_mysql_tmpdir), CMD_LINE(REQUIRED_ARG, 't'), + IN_FS_CHARSET, DEFAULT(0)); + +static bool fix_trans_mem_root(sys_var *self, THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + reset_root_defaults(&thd->transaction.mem_root, + thd->variables.trans_alloc_block_size, + thd->variables.trans_prealloc_size); + return false; +} +static Sys_var_ulong Sys_trans_alloc_block_size( + "transaction_alloc_block_size", + "Allocation block size for transactions to be stored in binary log", + SESSION_VAR(trans_alloc_block_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, ULONG_MAX), DEFAULT(QUERY_ALLOC_BLOCK_SIZE), + BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_trans_mem_root)); + +static Sys_var_ulong Sys_trans_prealloc_size( + "transaction_prealloc_size", + "Persistent buffer for transactions to be stored in binary log", + SESSION_VAR(trans_prealloc_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, ULONG_MAX), DEFAULT(TRANS_ALLOC_PREALLOC_SIZE), + BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_trans_mem_root)); + +static const char *thread_handling_names[]= +{ + "one-thread-per-connection", "no-threads", +#if HAVE_POOL_OF_THREADS == 1 + "pool-of-threads", +#endif + 0 +}; +static Sys_var_enum Sys_thread_handling( + "thread_handling", + "Define threads usage for handling queries, one of " + "one-thread-per-connection, no-threads" +#if HAVE_POOL_OF_THREADS == 1 + ", pool-of-threads" +#endif + , READ_ONLY GLOBAL_VAR(thread_handling), CMD_LINE(REQUIRED_ARG), + thread_handling_names, DEFAULT(0)); + +#ifdef HAVE_QUERY_CACHE +static bool fix_query_cache_size(sys_var *self, THD *thd, enum_var_type type) +{ + ulong new_cache_size= query_cache.resize(query_cache_size); + /* + Note: query_cache_size is a global variable reflecting the + requested cache size. See also query_cache_size_arg + */ + if (query_cache_size != new_cache_size) + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), + query_cache_size, new_cache_size); + + query_cache_size= new_cache_size; + return false; +} +static Sys_var_ulong Sys_query_cache_size( + "query_cache_size", + "The memory allocated to store results from old queries", + GLOBAL_VAR(query_cache_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1024), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_query_cache_size)); + +static Sys_var_ulong Sys_query_cache_limit( + "query_cache_limit", + "Don't cache results that are bigger than this", + GLOBAL_VAR(query_cache.query_cache_limit), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(1024*1024), BLOCK_SIZE(1)); + +static bool fix_qcache_min_res_unit(sys_var *self, THD *thd, enum_var_type type) +{ + query_cache_min_res_unit= + query_cache.set_min_res_unit(query_cache_min_res_unit); + return false; +} +static Sys_var_ulong Sys_query_cache_min_res_unit( + "query_cache_min_res_unit", + "The minimum size for blocks allocated by the query cache", + GLOBAL_VAR(query_cache_min_res_unit), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(QUERY_CACHE_MIN_RESULT_DATA_SIZE), + BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_qcache_min_res_unit)); + +static const char *query_cache_type_names[]= { "OFF", "ON", "DEMAND", 0 }; +static bool check_query_cache_type(sys_var *self, THD *thd, set_var *var) +{ + if (query_cache.is_disabled()) + { + my_error(ER_QUERY_CACHE_DISABLED, MYF(0)); + return true; + } + return false; +} +static Sys_var_enum Sys_query_cache_type( + "query_cache_type", + "OFF = Don't cache or retrieve results. ON = Cache all results " + "except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only " + "SELECT SQL_CACHE ... queries", + SESSION_VAR(query_cache_type), CMD_LINE(REQUIRED_ARG), + query_cache_type_names, DEFAULT(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_query_cache_type)); + +static Sys_var_mybool Sys_query_cache_wlock_invalidate( + "query_cache_wlock_invalidate", + "Invalidate queries in query cache on LOCK for write", + SESSION_VAR(query_cache_wlock_invalidate), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); +#endif /* HAVE_QUERY_CACHE */ + +static Sys_var_mybool Sys_secure_auth( + "secure_auth", + "Disallow authentication for accounts that have old (pre-4.1) " + "passwords", + GLOBAL_VAR(opt_secure_auth), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); + +static Sys_var_charptr Sys_secure_file_priv( + "secure_file_priv", + "Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files " + "within specified directory", + PREALLOCATED READ_ONLY GLOBAL_VAR(opt_secure_file_priv), + CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(0)); + +static bool fix_server_id(sys_var *self, THD *thd, enum_var_type type) +{ + server_id_supplied = 1; + thd->server_id= server_id; + return false; +} +static Sys_var_ulong Sys_server_id( + "server_id", + "Uniquely identifies the server instance in the community of " + "replication partners", + GLOBAL_VAR(server_id), CMD_LINE(REQUIRED_ARG, OPT_SERVER_ID), + VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1), NO_MUTEX_GUARD, + NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_server_id)); + +static Sys_var_mybool Sys_slave_compressed_protocol( + "slave_compressed_protocol", + "Use compression on master/slave protocol", + GLOBAL_VAR(opt_slave_compressed_protocol), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); + +#ifdef HAVE_REPLICATION +static const char *slave_exec_mode_names[]= {"STRICT", "IDEMPOTENT", 0}; +static Sys_var_enum Slave_exec_mode( + "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", + GLOBAL_VAR(slave_exec_mode_options), CMD_LINE(REQUIRED_ARG), + slave_exec_mode_names, DEFAULT(SLAVE_EXEC_MODE_STRICT)); +#endif + +static Sys_var_ulong Sys_slow_launch_time( + "slow_launch_time", + "If creating the thread takes longer than this value (in seconds), " + "the Slow_launch_threads counter will be incremented", + GLOBAL_VAR(slow_launch_time), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(2), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_sort_buffer( + "sort_buffer_size", + "Each thread that needs to do a sort allocates a buffer of this size", + SESSION_VAR(sortbuff_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(MIN_SORT_MEMORY, ULONG_MAX), DEFAULT(MAX_SORT_MEMORY), + BLOCK_SIZE(1)); + +export ulong expand_sql_mode(ulonglong sql_mode) +{ + if (sql_mode & MODE_ANSI) + { + /* + Note that we dont set + MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | MODE_NO_FIELD_OPTIONS + to allow one to get full use of MySQL in this mode. + + MODE_ONLY_FULL_GROUP_BY was removed from ANSI mode because it is + currently overly restrictive (see BUG#8510). + */ + sql_mode|= (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | + MODE_IGNORE_SPACE); + } + if (sql_mode & MODE_ORACLE) + sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | + MODE_IGNORE_SPACE | + MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | + MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER); + if (sql_mode & MODE_MSSQL) + sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | + MODE_IGNORE_SPACE | + MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | + MODE_NO_FIELD_OPTIONS); + if (sql_mode & MODE_POSTGRESQL) + sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | + MODE_IGNORE_SPACE | + MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | + MODE_NO_FIELD_OPTIONS); + if (sql_mode & MODE_DB2) + sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | + MODE_IGNORE_SPACE | + MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | + MODE_NO_FIELD_OPTIONS); + if (sql_mode & MODE_MAXDB) + sql_mode|= (MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | + MODE_IGNORE_SPACE | + MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | + MODE_NO_FIELD_OPTIONS | MODE_NO_AUTO_CREATE_USER); + if (sql_mode & MODE_MYSQL40) + sql_mode|= MODE_HIGH_NOT_PRECEDENCE; + if (sql_mode & MODE_MYSQL323) + sql_mode|= MODE_HIGH_NOT_PRECEDENCE; + if (sql_mode & MODE_TRADITIONAL) + sql_mode|= (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES | + MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | + MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER | + MODE_NO_ENGINE_SUBSTITUTION); + return sql_mode; +} +static bool check_sql_mode(sys_var *self, THD *thd, set_var *var) +{ + var->save_result.ulonglong_value= + expand_sql_mode(var->save_result.ulonglong_value); + return false; +} +static bool fix_sql_mode(sys_var *self, THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + { + /* Update thd->server_status */ + if (thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) + thd->server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; + else + thd->server_status&= ~SERVER_STATUS_NO_BACKSLASH_ESCAPES; + } + return false; +} +/* + WARNING: When adding new SQL modes don't forget to update the + tables definitions that stores it's value (ie: mysql.event, mysql.proc) +*/ +static const char *sql_mode_names[]= +{ + "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE", ",", + "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION", "NO_DIR_IN_CREATE", + "POSTGRESQL", "ORACLE", "MSSQL", "DB2", "MAXDB", "NO_KEY_OPTIONS", + "NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40", "ANSI", + "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "STRICT_TRANS_TABLES", + "STRICT_ALL_TABLES", "NO_ZERO_IN_DATE", "NO_ZERO_DATE", + "ALLOW_INVALID_DATES", "ERROR_FOR_DIVISION_BY_ZERO", "TRADITIONAL", + "NO_AUTO_CREATE_USER", "HIGH_NOT_PRECEDENCE", "NO_ENGINE_SUBSTITUTION", + "PAD_CHAR_TO_FULL_LENGTH", + 0 +}; +export bool sql_mode_string_representation(THD *thd, ulong sql_mode, + LEX_STRING *ls) +{ + set_to_string(thd, ls, sql_mode, sql_mode_names); + return ls->str == 0; +} +/* + sql_mode should *not* be IN_BINLOG: even though it is written to the binlog, + the slave ignores the MODE_NO_DIR_IN_CREATE variable, so slave's value + differs from master's (see log_event.cc: Query_log_event::do_apply_event()). +*/ +static Sys_var_set Sys_sql_mode( + "sql_mode", + "Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the " + "complete list of valid sql modes", + SESSION_VAR(sql_mode), CMD_LINE(REQUIRED_ARG), + sql_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_sql_mode), ON_UPDATE(fix_sql_mode)); + +static Sys_var_charptr Sys_ssl_ca( + "ssl_ca", + "CA file in PEM format (check OpenSSL docs, implies --ssl)", + READ_ONLY GLOBAL_VAR(opt_ssl_ca), CMD_LINE(REQUIRED_ARG, OPT_SSL_CA), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_ssl_capath( + "ssl_capath", + "CA directory (check OpenSSL docs, implies --ssl)", + READ_ONLY GLOBAL_VAR(opt_ssl_capath), + CMD_LINE(REQUIRED_ARG, OPT_SSL_CAPATH), IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_ssl_cert( + "ssl_cert", "X509 cert in PEM format (implies --ssl)", + READ_ONLY GLOBAL_VAR(opt_ssl_cert), CMD_LINE(REQUIRED_ARG, OPT_SSL_CERT), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_ssl_cipher( + "ssl_cipher", "SSL cipher to use (implies --ssl)", + READ_ONLY GLOBAL_VAR(opt_ssl_cipher), + CMD_LINE(REQUIRED_ARG, OPT_SSL_CIPHER), IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_ssl_key( + "ssl_key", "X509 key in PEM format (implies --ssl)", + READ_ONLY GLOBAL_VAR(opt_ssl_key), CMD_LINE(REQUIRED_ARG, OPT_SSL_KEY), + IN_FS_CHARSET, DEFAULT(0)); + +// why ENUM and not BOOL ? +static const char *updatable_views_with_limit_names[]= {"NO", "YES", 0}; +static Sys_var_enum Sys_updatable_views_with_limit( + "updatable_views_with_limit", + "YES = Don't issue an error message (warning only) if a VIEW without " + "presence of a key of the underlying table is used in queries with a " + "LIMIT clause for updating. NO = Prohibit update of a VIEW, which " + "does not contain a key of the underlying table and the query uses " + "a LIMIT clause (usually get from GUI tools)", + SESSION_VAR(updatable_views_with_limit), CMD_LINE(REQUIRED_ARG), + updatable_views_with_limit_names, DEFAULT(TRUE)); + +static Sys_var_mybool Sys_sync_frm( + "sync_frm", "Sync .frm files to disk on creation", + GLOBAL_VAR(opt_sync_frm), CMD_LINE(OPT_ARG), + DEFAULT(TRUE)); + +static char *system_time_zone_ptr; +static Sys_var_charptr Sys_system_time_zone( + "system_time_zone", "The server system time zone", + READ_ONLY GLOBAL_VAR(system_time_zone_ptr), NO_CMD_LINE, + IN_FS_CHARSET, DEFAULT(system_time_zone)); + +static Sys_var_ulong Sys_table_def_size( + "table_definition_cache", + "The number of cached table definitions", + GLOBAL_VAR(table_def_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(TABLE_DEF_CACHE_MIN, 512*1024), + DEFAULT(TABLE_DEF_CACHE_DEFAULT), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_table_cache_size( + "table_open_cache", "The number of cached open tables", + GLOBAL_VAR(table_cache_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, 512*1024), DEFAULT(TABLE_OPEN_CACHE_DEFAULT), + BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_table_lock_wait_timeout( + "table_lock_wait_timeout", + "Timeout in seconds to wait for a table level lock before returning an " + "error. Used only if the connection has active cursors", + GLOBAL_VAR(table_lock_wait_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, 1024*1024*1024), DEFAULT(50), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_thread_cache_size( + "thread_cache_size", + "How many threads we should keep in a cache for reuse", + GLOBAL_VAR(thread_cache_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 16384), DEFAULT(0), BLOCK_SIZE(1)); + +#if HAVE_POOL_OF_THREADS == 1 +static Sys_var_ulong Sys_thread_pool_size( + "thread_pool_size", + "How many threads we should create to handle query requests in " + "case of 'thread_handling=pool-of-threads'", + GLOBAL_VAR(thread_pool_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, 16384), DEFAULT(20), BLOCK_SIZE(0)); +#endif + +// Can't change the 'next' tx_isolation if we are already in a transaction +static bool check_tx_isolation(sys_var *self, THD *thd, set_var *var) +{ + if (var->type == OPT_DEFAULT && (thd->server_status & SERVER_STATUS_IN_TRANS)) + { + my_error(ER_CANT_CHANGE_TX_ISOLATION, MYF(0)); + return true; + } + return false; +} + +/* + If one doesn't use the SESSION modifier, the isolation level + is only active for the next command. +*/ +static bool fix_tx_isolation(sys_var *self, THD *thd, enum_var_type type) +{ + if (type == OPT_SESSION) + thd->session_tx_isolation= (enum_tx_isolation)thd->variables.tx_isolation; + return false; +} +// NO_CMD_LINE - different name of the option +static Sys_var_enum Sys_tx_isolation( + "tx_isolation", "Default transaction isolation level", + SESSION_VAR(tx_isolation), NO_CMD_LINE, + tx_isolation_names, DEFAULT(ISO_REPEATABLE_READ), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_tx_isolation), + ON_UPDATE(fix_tx_isolation)); + +static Sys_var_ulonglong Sys_tmp_table_size( + "tmp_table_size", + "If an internal in-memory temporary table exceeds this size, MySQL " + "will automatically convert it to an on-disk MyISAM table", + SESSION_VAR(tmp_table_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024), + BLOCK_SIZE(1)); + +static Sys_var_mybool Sys_timed_mutexes( + "timed_mutexes", + "Specify whether to time mutexes (only InnoDB mutexes are currently " + "supported)", + GLOBAL_VAR(timed_mutexes), CMD_LINE(OPT_ARG), DEFAULT(0)); + +static char *server_version_ptr; +static Sys_var_charptr Sys_version( + "version", "Server version", + READ_ONLY GLOBAL_VAR(server_version_ptr), NO_CMD_LINE, + IN_SYSTEM_CHARSET, DEFAULT(server_version)); + +static char *server_version_comment_ptr; +static Sys_var_charptr Sys_version_comment( + "version_comment", "version_comment", + READ_ONLY GLOBAL_VAR(server_version_comment_ptr), NO_CMD_LINE, + IN_SYSTEM_CHARSET, DEFAULT(MYSQL_COMPILATION_COMMENT)); + +static char *server_version_compile_machine_ptr; +static Sys_var_charptr Sys_version_compile_machine( + "version_compile_machine", "version_compile_machine", + READ_ONLY GLOBAL_VAR(server_version_compile_machine_ptr), NO_CMD_LINE, + IN_SYSTEM_CHARSET, DEFAULT(MACHINE_TYPE)); + +static char *server_version_compile_os_ptr; +static Sys_var_charptr Sys_version_compile_os( + "version_compile_os", "version_compile_os", + READ_ONLY GLOBAL_VAR(server_version_compile_os_ptr), NO_CMD_LINE, + IN_SYSTEM_CHARSET, DEFAULT(SYSTEM_TYPE)); + +static Sys_var_ulong Sys_net_wait_timeout( + "wait_timeout", + "The number of seconds the server waits for activity on a " + "connection before closing it", + SESSION_VAR(net_wait_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)), + DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1)); + +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)); + +static Sys_var_plugin Sys_default_storage_engine( + "default_storage_engine", "The default storage engine for new tables", + SESSION_VAR(table_plugin), NO_CMD_LINE, + MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_storage_engine), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_not_null)); + +// Alias for @@default_storage_engine +static Sys_var_plugin Sys_storage_engine( + "storage_engine", "Alias for @@default_storage_engine. Deprecated", + SESSION_VAR(table_plugin), NO_CMD_LINE, + MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_storage_engine), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_not_null)); + +#if defined(ENABLED_DEBUG_SYNC) +/* + Variable can be set for the session only. + + This could be changed later. Then we need to have a global array of + actions in addition to the thread local ones. SET GLOBAL would + manage the global array, SET [SESSION] the local array. A sync point + would need to look for a local and a global action. Setting and + executing of global actions need to be protected by a mutex. + + The purpose of global actions could be to allow synchronizing with + connectionless threads that cannot execute SET statements. +*/ +static Sys_var_debug_sync Sys_debug_sync( + "debug_sync", "Debug Sync Facility", + sys_var::ONLY_SESSION, NO_CMD_LINE, + DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super)); +#endif /* defined(ENABLED_DEBUG_SYNC) */ + +/** + "time_format" "date_format" "datetime_format" + + the following three variables are unused, and the source of confusion + (bug reports like "I've changed date_format, but date format hasn't changed. + I've made them read-only, to alleviate the situation somewhat. + + @todo make them NO_CMD_LINE ? +*/ +static Sys_var_charptr Sys_date_format( + "date_format", "The DATE format (ignored)", + READ_ONLY GLOBAL_VAR(global_date_format.format.str), + CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, + DEFAULT(known_date_time_formats[ISO_FORMAT].date_format)); + +static Sys_var_charptr Sys_datetime_format( + "datetime_format", "The DATETIME format (ignored)", + READ_ONLY GLOBAL_VAR(global_datetime_format.format.str), + CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, + DEFAULT(known_date_time_formats[ISO_FORMAT].datetime_format)); + +static Sys_var_charptr Sys_time_format( + "time_format", "The TIME format (ignored)", + READ_ONLY GLOBAL_VAR(global_time_format.format.str), + CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, + DEFAULT(known_date_time_formats[ISO_FORMAT].time_format)); + +static bool fix_autocommit(sys_var *self, THD *thd, enum_var_type type) +{ + if (type == OPT_GLOBAL) + { + if (global_system_variables.option_bits & OPTION_AUTOCOMMIT) + global_system_variables.option_bits&= ~OPTION_NOT_AUTOCOMMIT; + else + global_system_variables.option_bits|= OPTION_NOT_AUTOCOMMIT; + return false; + } + + if (thd->variables.option_bits & OPTION_AUTOCOMMIT && + thd->variables.option_bits & OPTION_NOT_AUTOCOMMIT) + { // activating autocommit + + if (ha_commit(thd)) + { + thd->variables.option_bits&= ~OPTION_AUTOCOMMIT; + return true; + } + + thd->variables.option_bits&= + ~(OPTION_BEGIN | OPTION_KEEP_LOG | OPTION_NOT_AUTOCOMMIT); + thd->transaction.all.modified_non_trans_table= false; + thd->server_status|= SERVER_STATUS_AUTOCOMMIT; + return false; + } + + if (!(thd->variables.option_bits & OPTION_AUTOCOMMIT) && + !(thd->variables.option_bits & OPTION_NOT_AUTOCOMMIT)) + { // disabling autocommit + + thd->transaction.all.modified_non_trans_table= false; + thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT; + thd->variables.option_bits|= OPTION_NOT_AUTOCOMMIT; + return false; + } + + return false; // autocommit value wasn't changed +} +static Sys_var_bit Sys_autocommit( + "autocommit", "autocommit", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_AUTOCOMMIT, DEFAULT(TRUE), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_autocommit)); +export sys_var *Sys_autocommit_ptr= &Sys_autocommit; // for sql_yacc.yy + +static Sys_var_mybool Sys_big_tables( + "big_tables", "Allow big result sets by saving all " + "temporary sets on file (Solves most 'table full' errors)", + SESSION_VAR(big_tables), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +#ifndef TO_BE_DELETED /* Alias for big_tables */ +static Sys_var_mybool Sys_sql_big_tables( + "sql_big_tables", "alias for big_tables", + SESSION_VAR(big_tables), NO_CMD_LINE, DEFAULT(FALSE)); +#endif + +static Sys_var_bit Sys_big_selects( + "sql_big_selects", "sql_big_selects", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BIG_SELECTS, + DEFAULT(FALSE)); + +static Sys_var_bit Sys_log_off( + "sql_log_off", "sql_log_off", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_LOG_OFF, + DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super)); + +static bool fix_sql_log_bin(sys_var *self, THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL && !thd->in_sub_stmt) + thd->sql_log_bin_toplevel= thd->variables.option_bits & OPTION_BIN_LOG; + return false; +} +static Sys_var_bit Sys_log_binlog( + "sql_log_bin", "sql_log_bin", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BIN_LOG, + DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super), + ON_UPDATE(fix_sql_log_bin)); + +static bool deprecated_log_update(sys_var *self, THD *thd, set_var *var) +{ + /* + The update log is not supported anymore since 5.0. + See sql/mysqld.cc/, comments in function init_server_components() for an + explaination of the different warnings we send below + */ + + if (opt_sql_bin_update) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_UPDATE_LOG_DEPRECATED_TRANSLATED, + ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED)); + else + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_UPDATE_LOG_DEPRECATED_IGNORED, + ER(ER_UPDATE_LOG_DEPRECATED_IGNORED)); + return check_has_super(self, thd, var); +} +static Sys_var_bit Sys_log_update( + "sql_log_update", "alias for sql_log_bin", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BIN_LOG, + DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(deprecated_log_update), ON_UPDATE(fix_sql_log_bin)); + +static Sys_var_bit Sys_sql_warnings( + "sql_warnings", "sql_warnings", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_WARNINGS, + DEFAULT(FALSE)); + +static Sys_var_bit Sys_sql_notes( + "sql_notes", "sql_notes", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_SQL_NOTES, + DEFAULT(TRUE)); + +static Sys_var_bit Sys_auto_is_null( + "sql_auto_is_null", "sql_auto_is_null", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_AUTO_IS_NULL, + DEFAULT(FALSE), NO_MUTEX_GUARD, IN_BINLOG); + +static Sys_var_bit Sys_safe_updates( + "sql_safe_updates", "sql_safe_updates", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_SAFE_UPDATES, + DEFAULT(FALSE)); + +static Sys_var_bit Sys_buffer_results( + "sql_buffer_result", "sql_buffer_result", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BUFFER_RESULT, + DEFAULT(FALSE)); + +static Sys_var_bit Sys_quote_show_create( + "sql_quote_show_create", "sql_quote_show_create", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_QUOTE_SHOW_CREATE, + DEFAULT(TRUE)); + +static Sys_var_bit Sys_foreign_key_checks( + "foreign_key_checks", "foreign_key_checks", + SESSION_VAR(option_bits), NO_CMD_LINE, + REVERSE(OPTION_NO_FOREIGN_KEY_CHECKS), + DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG); + +static Sys_var_bit Sys_unique_checks( + "unique_checks", "unique_checks", + SESSION_VAR(option_bits), NO_CMD_LINE, + REVERSE(OPTION_RELAXED_UNIQUE_CHECKS), + DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG); + +#ifdef ENABLED_PROFILING +static Sys_var_bit Sys_profiling( + "profiling", "profiling", + SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_PROFILING, + DEFAULT(FALSE)); + +static Sys_var_ulong Sys_profiling_history_size( + "profiling_history_size", "Limit of query profiling memory", + SESSION_VAR(profiling_history_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 100), DEFAULT(15), BLOCK_SIZE(1)); +#endif + +static Sys_var_harows Sys_select_limit( + "sql_select_limit", + "The maximum number of rows to return from SELECT statements", + SESSION_VAR(select_limit), NO_CMD_LINE, + VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1)); + +static bool update_timestamp(THD *thd, set_var *var) +{ + if (var->value) + thd->set_time((time_t) var->save_result.ulonglong_value); + else // SET timestamp=DEFAULT + thd->user_time= 0; + return false; +} +static ulonglong read_timestamp(THD *thd) +{ + return (ulonglong) thd->start_time; +} +static Sys_var_session_special Sys_timestamp( + "timestamp", "Set the time for this client", + sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ~(time_t)0), BLOCK_SIZE(1), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_timestamp), + ON_READ(read_timestamp)); + +static bool update_last_insert_id(THD *thd, set_var *var) +{ + if (!var->value) + { + my_error(ER_NO_DEFAULT, MYF(0), var->var->name); + return true; + } + thd->first_successful_insert_id_in_prev_stmt= + var->save_result.ulonglong_value; + return false; +} +static ulonglong read_last_insert_id(THD *thd) +{ + return (ulonglong) thd->read_first_successful_insert_id_in_prev_stmt(); +} +static Sys_var_session_special Sys_last_insert_id( + "last_insert_id", "The value to be returned from LAST_INSERT_ID()", + sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_last_insert_id), ON_READ(read_last_insert_id)); + +// alias for last_insert_id(), Sybase-style +static Sys_var_session_special Sys_identity( + "identity", "Synonym for the last_insert_id variable", + sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_last_insert_id), ON_READ(read_last_insert_id)); + +/* + insert_id should *not* be marked as written to the binlog (i.e., it + should *not* be IN_BINLOG), because we want any statement that + refers to insert_id explicitly to be unsafe. (By "explicitly", we + mean using @@session.insert_id, whereas insert_id is used + "implicitly" when NULL value is inserted into an auto_increment + column). + + We want statements referring explicitly to @@session.insert_id to be + unsafe, because insert_id is modified internally by the slave sql + thread when NULL values are inserted in an AUTO_INCREMENT column. + This modification interfers with the value of the + @@session.insert_id variable if @@session.insert_id is referred + explicitly by an insert statement (as is seen by executing "SET + @@session.insert_id=0; CREATE TABLE t (a INT, b INT KEY + AUTO_INCREMENT); INSERT INTO t(a) VALUES (@@session.insert_id);" in + statement-based logging mode: t will be different on master and + slave). +*/ +static bool update_insert_id(THD *thd, set_var *var) +{ + if (!var->value) + { + my_error(ER_NO_DEFAULT, MYF(0), var->var->name); + return true; + } + thd->force_one_auto_inc_interval(var->save_result.ulonglong_value); + return false; +} + +static ulonglong read_insert_id(THD *thd) +{ + return thd->auto_inc_intervals_forced.minimum(); +} +static Sys_var_session_special Sys_insert_id( + "insert_id", "The value to be used by the following INSERT " + "or ALTER TABLE statement when inserting an AUTO_INCREMENT value", + sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_insert_id), ON_READ(read_insert_id)); + +static bool update_rand_seed1(THD *thd, set_var *var) +{ + if (!var->value) + { + my_error(ER_NO_DEFAULT, MYF(0), var->var->name); + return true; + } + thd->rand.seed1= (ulong) var->save_result.ulonglong_value; + return false; +} +static ulonglong read_rand_seed(THD *thd) +{ + return 0; +} +static Sys_var_session_special Sys_rand_seed1( + "rand_seed1", "Sets the internal state of the RAND() " + "generator for replication purposes", + sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ULONG_MAX), BLOCK_SIZE(1), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_rand_seed1), ON_READ(read_rand_seed)); + +static bool update_rand_seed2(THD *thd, set_var *var) +{ + if (!var->value) + { + my_error(ER_NO_DEFAULT, MYF(0), var->var->name); + return true; + } + thd->rand.seed2= (ulong) var->save_result.ulonglong_value; + return false; +} +static Sys_var_session_special Sys_rand_seed2( + "rand_seed2", "Sets the internal state of the RAND() " + "generator for replication purposes", + sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ULONG_MAX), BLOCK_SIZE(1), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), + ON_UPDATE(update_rand_seed2), ON_READ(read_rand_seed)); + +static ulonglong read_error_count(THD *thd) +{ + return thd->warning_info->error_count(); +} +// this really belongs to the SHOW STATUS +static Sys_var_session_special Sys_error_count( + "error_count", "The number of errors that resulted from the " + "last statement that generated messages", + READ_ONLY sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1), NO_MUTEX_GUARD, + NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), ON_READ(read_error_count)); + +static ulonglong read_warning_count(THD *thd) +{ + return thd->warning_info->warn_count(); +} +// this really belongs to the SHOW STATUS +static Sys_var_session_special Sys_warning_count( + "warning_count", "The number of errors, warnings, and notes " + "that resulted from the last statement that generated messages", + READ_ONLY sys_var::ONLY_SESSION, NO_CMD_LINE, + VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1), NO_MUTEX_GUARD, + NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), ON_READ(read_warning_count)); + +static Sys_var_ulong Sys_default_week_format( + "default_week_format", + "The default week format used by WEEK() functions", + SESSION_VAR(default_week_format), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 7), DEFAULT(0), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_group_concat_max_len( + "group_concat_max_len", + "The maximum length of the result of function GROUP_CONCAT()", + SESSION_VAR(group_concat_max_len), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(4, ULONG_MAX), DEFAULT(1024), BLOCK_SIZE(1)); + +static char *glob_hostname_ptr; +static Sys_var_charptr Sys_hostname( + "hostname", "Server host name", + READ_ONLY GLOBAL_VAR(glob_hostname_ptr), NO_CMD_LINE, + IN_FS_CHARSET, DEFAULT(glob_hostname)); + +#ifndef EMBEDDED_LIBRARY +static Sys_var_charptr Sys_repl_report_host( + "report_host", + "Hostname or IP of the slave to be reported to the master during " + "slave registration. Will appear in the output of SHOW SLAVE HOSTS. " + "Leave unset if you do not want the slave to register itself with the " + "master. Note that it is not sufficient for the master to simply read " + "the IP of the slave off the socket once the slave connects. Due to " + "NAT and other routing issues, that IP may not be valid for connecting " + "to the slave from the master or other hosts", + READ_ONLY GLOBAL_VAR(report_host), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_repl_report_user( + "report_user", + "The account user name of the slave to be reported to the master " + "during slave registration", + READ_ONLY GLOBAL_VAR(report_user), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_repl_report_password( + "report_password", + "The account password of the slave to be reported to the master " + "during slave registration", + READ_ONLY GLOBAL_VAR(report_password), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_uint Sys_repl_report_port( + "report_port", + "Port for connecting to slave reported to the master during slave " + "registration. Set it only if the slave is listening on a non-default " + "port or if you have a special tunnel from the master or other clients " + "to the slave. If not sure, leave this option unset", + READ_ONLY GLOBAL_VAR(report_port), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, UINT_MAX), DEFAULT(MYSQL_PORT), BLOCK_SIZE(1)); +#endif + +static Sys_var_mybool Sys_keep_files_on_create( + "keep_files_on_create", + "Don't overwrite stale .MYD and .MYI even if no directory is specified", + SESSION_VAR(keep_files_on_create), CMD_LINE(OPT_ARG), + DEFAULT(FALSE)); + +static char *license; +static Sys_var_charptr Sys_license( + "license", "The type of license the server has", + READ_ONLY GLOBAL_VAR(license), NO_CMD_LINE, IN_SYSTEM_CHARSET, + DEFAULT(STRINGIFY_ARG(LICENSE))); + +static bool check_log_path(sys_var *self, THD *thd, set_var *var) +{ + if (!var->value) + return false; // DEFAULT is ok + + if (!var->save_result.string_value.str) + return true; + + if (var->save_result.string_value.length > FN_REFLEN) + { // path is too long + my_error(ER_PATH_LENGTH, MYF(0), self->name.str); + return true; + } + + char path[FN_REFLEN]; + size_t path_length= unpack_filename(path, var->save_result.string_value.str); + + if (!path_length) + return true; + + MY_STAT f_stat; + + if (my_stat(path, &f_stat, MYF(0))) + { + if (!MY_S_ISREG(f_stat.st_mode) || !(f_stat.st_mode & MY_S_IWRITE)) + return true; // not a regular writable file + return false; + } + + (void) dirname_part(path, var->save_result.string_value.str, &path_length); + + if (var->save_result.string_value.length - path_length >= FN_LEN) + { // filename is too long + my_error(ER_PATH_LENGTH, MYF(0), self->name.str); + return true; + } + + if (!path_length) // no path is good path (remember, relative to datadir) + return false; + + if (my_access(path, (F_OK|W_OK))) + return true; // directory is not writable + + return false; +} +static bool fix_log(char** logname, const char* default_logname, + const char*ext, bool enabled, void (*reopen)(char*)) +{ + if (!*logname) // SET ... = DEFAULT + { + char buff[FN_REFLEN]; + *logname= my_strdup(make_log_name(buff, default_logname, ext), + MYF(MY_FAE+MY_WME)); + if (!*logname) + return true; + } + logger.lock_exclusive(); + pthread_mutex_unlock(&LOCK_global_system_variables); + if (enabled) + reopen(*logname); + logger.unlock(); + pthread_mutex_lock(&LOCK_global_system_variables); + return false; +} +static void reopen_general_log(char* name) +{ + logger.get_log_file_handler()->close(0); + logger.get_log_file_handler()->open_query_log(name); +} +static bool fix_general_log_file(sys_var *self, THD *thd, enum_var_type type) +{ + return fix_log(&opt_logname, default_logfile_name, ".log", opt_log, + reopen_general_log); +} +static Sys_var_charptr Sys_general_log_path( + "general_log_file", "Log connections and queries to given file", + PREALLOCATED GLOBAL_VAR(opt_logname), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_log_path), ON_UPDATE(fix_general_log_file)); + +static void reopen_slow_log(char* name) +{ + logger.get_slow_log_file_handler()->close(0); + logger.get_slow_log_file_handler()->open_slow_log(name); +} +static bool fix_slow_log_file(sys_var *self, THD *thd, enum_var_type type) +{ + return fix_log(&opt_slow_logname, default_logfile_name, "-slow.log", + opt_slow_log, reopen_slow_log); +} +static Sys_var_charptr Sys_slow_log_path( + "slow_query_log_file", "Log slow queries to given log file. " + "Defaults logging to hostname-slow.log. Must be enabled to activate " + "other slow log options", + PREALLOCATED GLOBAL_VAR(opt_slow_logname), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_log_path), ON_UPDATE(fix_slow_log_file)); + +/// @todo deprecate these four legacy have_PLUGIN variables and use I_S instead +export SHOW_COMP_OPTION have_csv, have_innodb; +export SHOW_COMP_OPTION have_ndbcluster, have_partitioning; +static Sys_var_have Sys_have_csv( + "have_csv", "have_csv", + READ_ONLY GLOBAL_VAR(have_csv), NO_CMD_LINE); + +static Sys_var_have Sys_have_innodb( + "have_innodb", "have_innodb", + READ_ONLY GLOBAL_VAR(have_innodb), NO_CMD_LINE); + +static Sys_var_have Sys_have_ndbcluster( + "have_ndbcluster", "have_ndbcluster", + READ_ONLY GLOBAL_VAR(have_ndbcluster), NO_CMD_LINE); + +static Sys_var_have Sys_have_partition_db( + "have_partitioning", "have_partitioning", + READ_ONLY GLOBAL_VAR(have_partitioning), NO_CMD_LINE); + +static Sys_var_have Sys_have_compress( + "have_compress", "have_compress", + READ_ONLY GLOBAL_VAR(have_compress), NO_CMD_LINE); + +static Sys_var_have Sys_have_crypt( + "have_crypt", "have_crypt", + READ_ONLY GLOBAL_VAR(have_crypt), NO_CMD_LINE); + +static Sys_var_have Sys_have_dlopen( + "have_dynamic_loading", "have_dynamic_loading", + READ_ONLY GLOBAL_VAR(have_dlopen), NO_CMD_LINE); + +static Sys_var_have Sys_have_geometry( + "have_geometry", "have_geometry", + READ_ONLY GLOBAL_VAR(have_geometry), NO_CMD_LINE); + +static Sys_var_have Sys_have_openssl( + "have_openssl", "have_openssl", + READ_ONLY GLOBAL_VAR(have_ssl), NO_CMD_LINE); + +static Sys_var_have Sys_have_profiling( + "have_profiling", "have_profiling", + READ_ONLY GLOBAL_VAR(have_profiling), NO_CMD_LINE); + +static Sys_var_have Sys_have_query_cache( + "have_query_cache", "have_query_cache", + READ_ONLY GLOBAL_VAR(have_query_cache), NO_CMD_LINE); + +static Sys_var_have Sys_have_rtree_keys( + "have_rtree_keys", "have_rtree_keys", + READ_ONLY GLOBAL_VAR(have_rtree_keys), NO_CMD_LINE); + +static Sys_var_have Sys_have_ssl( + "have_ssl", "have_ssl", + READ_ONLY GLOBAL_VAR(have_ssl), NO_CMD_LINE); + +static Sys_var_have Sys_have_symlink( + "have_symlink", "have_symlink", + READ_ONLY GLOBAL_VAR(have_symlink), NO_CMD_LINE); + +static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type); +static Sys_var_mybool Sys_general_log( + "general_log", "Log connections and queries to a table or log file. " + "Defaults logging to a file hostname.log or a table mysql.general_log" + "if --log-output=TABLE is used", + GLOBAL_VAR(opt_log), CMD_LINE(OPT_ARG), + DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_log_state)); + +// Synonym of "general_log" for consistency with SHOW VARIABLES output +static Sys_var_mybool Sys_log( + "log", "Alias for --general-log. Deprecated", + GLOBAL_VAR(opt_log), NO_CMD_LINE, + DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_log_state), DEPRECATED(70000, "'@@general_log'")); + +static Sys_var_mybool Sys_slow_query_log( + "slow_query_log", + "Log slow queries to a table or log file. Defaults logging to a file " + "hostname-slow.log or a table mysql.slow_log if --log-output=TABLE is " + "used. Must be enabled to activate other slow log options", + GLOBAL_VAR(opt_slow_log), CMD_LINE(OPT_ARG), + DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_log_state)); + +/* Synonym of "slow_query_log" for consistency with SHOW VARIABLES output */ +static Sys_var_mybool Sys_log_slow( + "log_slow_queries", + "Alias for --slow-query-log. Deprecated", + GLOBAL_VAR(opt_slow_log), NO_CMD_LINE, + DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_log_state), DEPRECATED(70000, "'@@slow_query_log'")); + +static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type) +{ + bool res; + my_bool *newvalptr, newval, oldval; + uint log_type; + + if (self == &Sys_general_log || self == &Sys_log) + { + newvalptr= &opt_log; + oldval= logger.get_log_file_handler()->is_open(); + log_type= QUERY_LOG_GENERAL; + } + else if (self == &Sys_slow_query_log || self == &Sys_log_slow) + { + newvalptr= &opt_slow_log; + oldval= logger.get_slow_log_file_handler()->is_open(); + log_type= QUERY_LOG_SLOW; + } + else + DBUG_ASSERT(FALSE); + + newval= *newvalptr; + if (oldval == newval) + return false; + + *newvalptr= oldval; // [de]activate_log_handler works that way (sigh) + + pthread_mutex_unlock(&LOCK_global_system_variables); + if (!newval) + { + logger.deactivate_log_handler(thd, log_type); + res= false; + } + else + res= logger.activate_log_handler(thd, log_type); + pthread_mutex_lock(&LOCK_global_system_variables); + return res; +} + +static bool check_not_empty_set(sys_var *self, THD *thd, set_var *var) +{ + return var->save_result.ulonglong_value == 0; +} +static bool fix_log_output(sys_var *self, THD *thd, enum_var_type type) +{ + logger.lock_exclusive(); + logger.init_slow_log(log_output_options); + logger.init_general_log(log_output_options); + logger.unlock(); + return false; +} + +static Sys_var_set Sys_log_output( + "log_output", "Syntax: log-output=value[,value...], " + "where \"value\" could be TABLE, FILE or NONE", + GLOBAL_VAR(log_output_options), CMD_LINE(REQUIRED_ARG), + log_output_names, DEFAULT(LOG_FILE), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(check_not_empty_set), ON_UPDATE(fix_log_output)); + +#ifdef HAVE_REPLICATION +static Sys_var_mybool Sys_log_slave_updates( + "log_slave_updates", "Tells the slave to log the updates from " + "the slave thread to the binary log. You will need to turn it on if " + "you plan to daisy-chain the slaves", + READ_ONLY GLOBAL_VAR(opt_log_slave_updates), CMD_LINE(OPT_ARG), + DEFAULT(0)); + +static Sys_var_charptr Sys_relay_log( + "relay_log", "The location and name to use for relay logs", + READ_ONLY GLOBAL_VAR(opt_relay_logname), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_relay_log_index( + "relay_log_index", "The location and name to use for the file " + "that keeps a list of the last relay logs", + READ_ONLY GLOBAL_VAR(opt_relaylog_index_name), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_charptr Sys_relay_log_info_file( + "relay_log_info_file", "The location and name of the file that " + "remembers where the SQL replication thread is in the relay logs", + READ_ONLY GLOBAL_VAR(relay_log_info_file), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static Sys_var_mybool Sys_relay_log_purge( + "relay_log_purge", "if disabled - do not purge relay logs. " + "if enabled - purge them as soon as they are no more needed", + GLOBAL_VAR(relay_log_purge), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); + +static Sys_var_mybool Sys_relay_log_recovery( + "relay_log_recovery", "Enables automatic relay log recovery " + "right after the database startup, which means that the IO Thread " + "starts re-fetching from the master right after the last transaction " + "processed", + GLOBAL_VAR(relay_log_recovery), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +static Sys_var_charptr Sys_slave_load_tmpdir( + "slave_load_tmpdir", "The location where the slave should put " + "its temporary files when replicating a LOAD DATA INFILE command", + READ_ONLY GLOBAL_VAR(slave_load_tmpdir), CMD_LINE(REQUIRED_ARG), + IN_FS_CHARSET, DEFAULT(0)); + +static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type) +{ + pthread_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))); + if (active_mi && slave_net_timeout < active_mi->heartbeat_period) + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, + "The current value for master_heartbeat_period" + " 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); + return false; +} +static Sys_var_ulong Sys_slave_net_timeout( + "slave_net_timeout", "Number of seconds to wait for more data " + "from a master/slave connection before aborting the read", + GLOBAL_VAR(slave_net_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(SLAVE_NET_TIMEOUT), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_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); + 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); + 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); + /* + The following test should normally never be true as we test this + in the check function; To be safe against multiple + SQL_SLAVE_SKIP_COUNTER request, we do the check anyway + */ + if (!active_mi->rli.slave_running) + { + pthread_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); + } + pthread_mutex_unlock(&active_mi->rli.run_lock); + pthread_mutex_unlock(&LOCK_active_mi); + return 0; +} +static Sys_var_uint Sys_slave_skip_counter( + "sql_slave_skip_counter", "sql_slave_skip_counter", + GLOBAL_VAR(sql_slave_skip_counter), NO_CMD_LINE, + VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_slave_skip_counter), + ON_UPDATE(fix_slave_skip_counter)); + +static Sys_var_charptr Sys_slave_skip_errors( + "slave_skip_errors", "Tells the slave thread to continue " + "replication when a query event returns an error from the " + "provided list", + READ_ONLY GLOBAL_VAR(opt_slave_skip_errors), CMD_LINE(REQUIRED_ARG), + IN_SYSTEM_CHARSET, DEFAULT(0)); + +static Sys_var_ulonglong Sys_relay_log_space_limit( + "relay_log_space_limit", "Maximum space to use for all relay logs", + READ_ONLY GLOBAL_VAR(relay_log_space_limit), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1)); + +static Sys_var_uint Sys_sync_relaylog_period( + "sync_relay_log", "Synchronously flush relay log to disk after " + "every #th event. Use 0 (default) to disable synchronous flushing", + GLOBAL_VAR(sync_relaylog_period), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); + +static Sys_var_uint Sys_sync_relayloginfo_period( + "sync_relay_log_info", "Synchronously flush relay log info " + "to disk after every #th transaction. Use 0 (default) to disable " + "synchronous flushing", + GLOBAL_VAR(sync_relayloginfo_period), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); +#endif + +static Sys_var_uint Sys_sync_binlog_period( + "sync_binlog", "Synchronously flush binary log to disk after " + "every #th event. Use 0 (default) to disable synchronous flushing", + GLOBAL_VAR(sync_binlog_period), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); + +static Sys_var_uint Sys_sync_masterinfo_period( + "sync_master_info", "Synchronously flush master info to disk " + "after every #th event. Use 0 (default) to disable synchronous flushing", + GLOBAL_VAR(sync_masterinfo_period), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); + +#ifdef HAVE_REPLICATION +static Sys_var_ulong Sys_slave_trans_retries( + "slave_transaction_retries", "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", + GLOBAL_VAR(slave_trans_retries), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(10), BLOCK_SIZE(1)); +#endif + +static bool check_locale(sys_var *self, THD *thd, set_var *var) +{ + if (!var->value) + return false; + + MY_LOCALE *locale; + char buff[STRING_BUFFER_USUAL_SIZE]; + if (var->value->result_type() == INT_RESULT) + { + int lcno= (int)var->value->val_int(); + if (!(locale= my_locale_by_number(lcno))) + { + my_error(ER_UNKNOWN_LOCALE, MYF(0), llstr(lcno, buff)); + return true; + } + if (check_not_null(self, thd, var)) + return true; + } + else // STRING_RESULT + { + String str(buff, sizeof(buff), system_charset_info), *res; + if (!(res=var->value->val_str(&str))) + return true; + else if (!(locale= my_locale_by_name(res->c_ptr()))) + { + ErrConvString err(res); + my_error(ER_UNKNOWN_LOCALE, MYF(0), err.ptr()); + return true; + } + } + + var->save_result.ptr= locale; + + if (!locale->errmsgs->errmsgs) + { + pthread_mutex_lock(&LOCK_error_messages); + if (!locale->errmsgs->errmsgs && + read_texts(ERRMSG_FILE, locale->errmsgs->language, + &locale->errmsgs->errmsgs, + ER_ERROR_LAST - ER_ERROR_FIRST + 1)) + { + 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); + return true; + } + pthread_mutex_unlock(&LOCK_error_messages); + } + return false; +} +static Sys_var_struct Sys_lc_messages( + "lc_messages", "Set the language used for the error messages", + SESSION_VAR(lc_messages), NO_CMD_LINE, + offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_messages), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_locale)); + +static Sys_var_struct Sys_lc_time_names( + "lc_time_names", "Set the language used for the month " + "names and the days of the week", + SESSION_VAR(lc_time_names), NO_CMD_LINE, + offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_time_names), + NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_locale)); + +static Sys_var_tz Sys_time_zone( + "time_zone", "time_zone", + SESSION_VAR(time_zone), NO_CMD_LINE, + DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG); + diff --git a/sql/sys_vars.h b/sql/sys_vars.h new file mode 100644 index 00000000000..bdbbcbbbd59 --- /dev/null +++ b/sql/sys_vars.h @@ -0,0 +1,1600 @@ +/* Copyright (C) 2002-2006 MySQL AB, 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 + "private" interface to sys_var - server configuration variables. + + This header is included only by the file that contains declarations + of sys_var variables (sys_vars.cc). +*/ + +#include "sys_vars_shared.h" +#include +#include +#include +#include "keycaches.h" + +/* + a set of mostly trivial (as in f(X)=X) defines below to make system variable + declarations more readable +*/ +#define VALID_RANGE(X,Y) X,Y +#define DEFAULT(X) X +#define BLOCK_SIZE(X) X +#define GLOBAL_VAR(X) sys_var::GLOBAL, (((char*)&(X))-(char*)&global_system_variables), sizeof(X) +#define SESSION_VAR(X) sys_var::SESSION, offsetof(SV, X), sizeof(((SV *)0)->X) +#define SESSION_ONLY(X) sys_var::ONLY_SESSION, offsetof(SV, X), sizeof(((SV *)0)->X) +#define NO_CMD_LINE CMD_LINE(NO_ARG, -1) +/* + the define below means that there's no *second* mutex guard, + LOCK_global_system_variables always guards all system variables +*/ +#define NO_MUTEX_GUARD ((PolyLock*)0) +#define IN_BINLOG sys_var::SESSION_VARIABLE_IN_BINLOG +#define NOT_IN_BINLOG sys_var::VARIABLE_NOT_IN_BINLOG +#define ON_READ(X) X +#define ON_CHECK(X) X +#define ON_UPDATE(X) X +#define READ_ONLY sys_var::READONLY+ +// this means that Sys_var_charptr initial value was malloc()ed +#define PREALLOCATED sys_var::ALLOCATED+ +/* + Sys_var_bit meaning is reversed, like in + @@foreign_key_checks <-> OPTION_NO_FOREIGN_KEY_CHECKS +*/ +#define REVERSE(X) ~(X) +#define DEPRECATED(X, Y) X, Y + +#define session_var(THD, TYPE) (*(TYPE*)session_var_ptr(THD)) +#define global_var(TYPE) (*(TYPE*)global_var_ptr()) + +#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES) +#define GET_HA_ROWS GET_ULL +#else +#define GET_HA_ROWS GET_ULONG +#endif + +enum charset_enum {IN_SYSTEM_CHARSET, IN_FS_CHARSET}; + +static const char *bool_values[3]= {"OFF", "ON", 0}; +TYPELIB bool_typelib={ array_elements(bool_values)-1, "", bool_values, 0 }; + +/** + A small wrapper class to pass getopt arguments as a pair + to the Sys_var_* constructors. It improves type safety and helps + to catch errors in the argument order. +*/ +struct CMD_LINE +{ + int id; + enum get_opt_arg_type arg_type; + CMD_LINE(enum get_opt_arg_type getopt_arg_type, int getopt_id=0) + : id(getopt_id), arg_type(getopt_arg_type) {} +}; + +/** + Sys_var_unsigned template is used to generate Sys_var_* classes + for variables that represent the value as an unsigned integer. + They are Sys_var_uint, Sys_var_ulong, Sys_var_harows, Sys_var_ulonglong. + + An integer variable has a minimal and maximal values, and a "block_size" + (any valid value of the variable must be divisible by the block_size). + + Class specific constructor arguments: min, max, block_size + Backing store: uint, ulong, ha_rows, ulonglong, depending on the Sys_var_* +*/ +template +class Sys_var_unsigned: public sys_var +{ +public: + Sys_var_unsigned(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + T min_val, T max_val, T def_val, uint block_size, PolyLock *lock=0, + 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) + : 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) + { + option.var_type= ARGT; + option.min_value= min_val; + option.max_value= max_val; + option.block_size= block_size; + option.u_max_value= (uchar**)max_var_ptr(); + if (max_var_ptr()) + *max_var_ptr()= max_val; + global_var(T)= def_val; + DBUG_ASSERT(size == sizeof(T)); + DBUG_ASSERT(min_val < max_val); + DBUG_ASSERT(min_val <= def_val); + DBUG_ASSERT(max_val >= def_val); + DBUG_ASSERT(block_size > 0); + DBUG_ASSERT(def_val % block_size == 0); + } + bool do_check(THD *thd, set_var *var) + { + my_bool fixed= FALSE; + ulonglong uv; + longlong v; + + v= var->value->val_int(); + if (var->value->unsigned_flag) + uv= (ulonglong) v; + else + uv= (ulonglong) (v < 0 ? 0 : v); + + var->save_result.ulonglong_value= + getopt_ull_limit_value(uv, &option, &fixed); + + if (max_var_ptr() && var->save_result.ulonglong_value > *max_var_ptr()) + var->save_result.ulonglong_value= *max_var_ptr(); + + return throw_bounds_warning(thd, name.str, + var->save_result.ulonglong_value != uv, + var->value->unsigned_flag, v); + } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, T)= var->save_result.ulonglong_value; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(T)= var->save_result.ulonglong_value; + return false; + } + bool check_update_type(Item_result type) + { return type != INT_RESULT; } + void session_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= (ulonglong)*(T*)global_value_ptr(thd, 0); } + void global_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= option.def_value; } + private: + T *max_var_ptr() + { + return scope() == SESSION ? (T*)(((uchar*)&max_system_variables) + offset) + : 0; + } +}; + +typedef Sys_var_unsigned Sys_var_uint; +typedef Sys_var_unsigned Sys_var_ulong; +typedef Sys_var_unsigned Sys_var_harows; +typedef Sys_var_unsigned Sys_var_ulonglong; + +/** + Helper class for variables that take values from a TYPELIB +*/ +class Sys_var_typelib: public sys_var +{ +protected: + TYPELIB typelib; +public: + Sys_var_typelib(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, + CMD_LINE getopt, + SHOW_TYPE show_val_type_arg, const char *values[], + 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) + : 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) + { + for (typelib.count= 0; values[typelib.count]; typelib.count++) /*no-op */; + typelib.name=""; + typelib.type_names= values; + typelib.type_lengths= 0; // only used by Fields_enum and Field_set + option.typelib= &typelib; + } + bool do_check(THD *thd, set_var *var) // works for enums and my_bool + { + char buff[STRING_BUFFER_USUAL_SIZE]; + String str(buff, sizeof(buff), system_charset_info), *res; + + if (var->value->result_type() == STRING_RESULT) + { + if (!(res=var->value->val_str(&str))) + return true; + else + if (!(var->save_result.ulonglong_value= + find_type(&typelib, res->ptr(), res->length(), false))) + return true; + else + var->save_result.ulonglong_value--; + } + else + { + longlong tmp=var->value->val_int(); + if (tmp < 0 || tmp >= typelib.count) + return true; + else + var->save_result.ulonglong_value= tmp; + } + + return false; + } + bool check_update_type(Item_result type) + { return type != INT_RESULT && type != STRING_RESULT; } +}; + +/** + The class for ENUM variables - variables that take one value from a fixed + list of values. + + Class specific constructor arguments: + char* values[] - 0-terminated list of strings of valid values + + Backing store: uint + + @note + Do *not* use "enum FOO" variables as a backing store, there is no + guarantee that sizeof(enum FOO) == sizeof(uint), there is no guarantee + even that sizeof(enum FOO) == sizeof(enum BAR) +*/ +class Sys_var_enum: public Sys_var_typelib +{ +public: + Sys_var_enum(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + const char *values[], uint def_val, PolyLock *lock=0, + 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) + : Sys_var_typelib(name_arg, comment, flag_args, off, getopt, + SHOW_CHAR, values, def_val, lock, + binlog_status_arg, on_check_func, on_update_func, + deprecated_version, substitute) + { + option.var_type= GET_ENUM; + global_var(uint)= def_val; + DBUG_ASSERT(def_val < typelib.count); + DBUG_ASSERT(size == sizeof(uint)); + } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, uint)= var->save_result.ulonglong_value; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(uint)= var->save_result.ulonglong_value; + return false; + } + void session_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= global_var(uint); } + void global_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= option.def_value; } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { return (uchar*)typelib.type_names[session_var(thd, uint)]; } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { return (uchar*)typelib.type_names[global_var(uint)]; } +}; + +/** + The class for boolean variables - a variant of ENUM variables + with the fixed list of values of { OFF , ON } + + Backing store: my_bool +*/ +class Sys_var_mybool: public Sys_var_typelib +{ +public: + Sys_var_mybool(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + my_bool def_val, PolyLock *lock=0, + 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) + : 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) + { + option.var_type= GET_BOOL; + global_var(my_bool)= def_val; + DBUG_ASSERT(def_val < 2); + DBUG_ASSERT(getopt.arg_type == OPT_ARG || getopt.id == -1); + DBUG_ASSERT(size == sizeof(my_bool)); + } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, my_bool)= var->save_result.ulonglong_value; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(my_bool)= var->save_result.ulonglong_value; + return false; + } + void session_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= (ulonglong)*(my_bool *)global_value_ptr(thd, 0); } + void global_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= option.def_value; } +}; + +/** + The class for string variables. The string can be in character_set_filesystem + or in character_set_system. The string can be allocated with my_malloc() + or not. The state of the initial value is specified in the constructor, + after that it's managed automatically. The value of NULL is supported. + + Class specific constructor arguments: + enum charset_enum is_os_charset_arg + + Backing store: char* + + @note + This class supports only GLOBAL variables, because THD on destruction + does not destroy individual members of SV, there's no way to free + allocated string variables for every thread. +*/ +class Sys_var_charptr: public sys_var +{ +public: + Sys_var_charptr(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + enum charset_enum is_os_charset_arg, + const char *def_val, PolyLock *lock=0, + 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) + : 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) + { + is_os_charset= is_os_charset_arg == IN_FS_CHARSET; + /* + use GET_STR_ALLOC - if ALLOCATED it must be *always* allocated, + otherwise (GET_STR) you'll never know whether to free it or not. + (think of an exit because of an error right after my_getopt) + */ + option.var_type= (flags & ALLOCATED) ? GET_STR_ALLOC : GET_STR; + global_var(const char*)= def_val; + DBUG_ASSERT(scope() == GLOBAL); + DBUG_ASSERT(size == sizeof(char *)); + } + ~Sys_var_charptr() + { + if (flags & ALLOCATED) + my_free(global_var(char*), MYF(MY_ALLOW_ZERO_PTR)); + flags&= ~ALLOCATED; + } + bool do_check(THD *thd, set_var *var) + { + char buff[STRING_BUFFER_USUAL_SIZE], buff2[STRING_BUFFER_USUAL_SIZE]; + String str(buff, sizeof(buff), charset(thd)); + String str2(buff2, sizeof(buff2), charset(thd)), *res; + + if (!(res=var->value->val_str(&str))) + var->save_result.string_value.str= 0; + else + { + uint32 unused; + if (String::needs_conversion(res->length(), res->charset(), + charset(thd), &unused)) + { + uint errors; + str2.copy(res->ptr(), res->length(), res->charset(), charset(thd), + &errors); + res=&str2; + + } + var->save_result.string_value.str= thd->strmake(res->ptr(), res->length()); + var->save_result.string_value.length= res->length(); + } + + return false; + } + bool session_update(THD *thd, set_var *var) + { + DBUG_ASSERT(FALSE); + return true; + } + bool global_update(THD *thd, set_var *var) + { + char *new_val, *ptr= var->save_result.string_value.str; + size_t len=var->save_result.string_value.length; + if (ptr) + { + new_val= (char*)my_memdup(ptr, len+1, MYF(MY_WME)); + if (!new_val) return true; + new_val[len]=0; + } + else + new_val= 0; + if (flags & ALLOCATED) + my_free(global_var(char*), MYF(MY_ALLOW_ZERO_PTR)); + flags|= ALLOCATED; + global_var(char*)= new_val; + return false; + } + void session_save_default(THD *thd, set_var *var) + { DBUG_ASSERT(FALSE); } + void global_save_default(THD *thd, set_var *var) + { + char *ptr= (char*)(intptr)option.def_value; + var->save_result.string_value.str= ptr; + var->save_result.string_value.length= ptr ? strlen(ptr) : 0; + } + bool check_update_type(Item_result type) + { return type != STRING_RESULT; } +}; + +/** + The class for string variables. Useful for strings that aren't necessarily + \0-terminated. Otherwise the same as Sys_var_charptr. + + Class specific constructor arguments: + enum charset_enum is_os_charset_arg + + Backing store: LEX_STRING + + @note + Behaves exactly as Sys_var_charptr, only the backing store is different. +*/ +class Sys_var_lexstring: public Sys_var_charptr +{ +public: + Sys_var_lexstring(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + enum charset_enum is_os_charset_arg, + const char *def_val, PolyLock *lock=0, + 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) + : Sys_var_charptr(name_arg, comment, flag_args, off, sizeof(char*), + getopt, is_os_charset_arg, def_val, lock, binlog_status_arg, + on_check_func, on_update_func, deprecated_version, substitute) + { + global_var(LEX_STRING).length= strlen(def_val); + DBUG_ASSERT(size == sizeof(LEX_STRING)); + *const_cast(&show_val_type)= SHOW_LEX_STRING; + } + bool global_update(THD *thd, set_var *var) + { + if (Sys_var_charptr::global_update(thd, var)) + return true; + global_var(LEX_STRING).length= var->save_result.string_value.length; + return false; + } +}; + +#ifndef DBUG_OFF +/** + @@session.dbug and @@global.dbug variables. + + @@dbug variable differs from other variables in one aspect: + if its value is not assigned in the session, it "points" to the global + value, and so when the global value is changed, the change + immediately takes effect in the session. + + This semantics is intentional, to be able to debug one session from + another. +*/ +class Sys_var_dbug: public sys_var +{ +public: + Sys_var_dbug(const char *name_arg, + const char *comment, int flag_args, + CMD_LINE getopt, + const char *def_val, PolyLock *lock=0, + 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) + : 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) + { option.var_type= GET_NO_ARG; } + bool do_check(THD *thd, set_var *var) + { + char buff[STRING_BUFFER_USUAL_SIZE]; + String str(buff, sizeof(buff), system_charset_info), *res; + + if (!(res=var->value->val_str(&str))) + var->save_result.string_value.str= const_cast(""); + else + var->save_result.string_value.str= thd->strmake(res->ptr(), res->length()); + return false; + } + bool session_update(THD *thd, set_var *var) + { + const char *val= var->save_result.string_value.str; + if (!var->value) + DBUG_POP(); + else + DBUG_SET(val); + return false; + } + bool global_update(THD *thd, set_var *var) + { + const char *val= var->save_result.string_value.str; + DBUG_SET_INITIAL(val); + return false; + } + void session_save_default(THD *thd, set_var *var) + { } + void global_save_default(THD *thd, set_var *var) + { + char *ptr= (char*)(intptr)option.def_value; + var->save_result.string_value.str= ptr; + } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + char buf[256]; + DBUG_EXPLAIN(buf, sizeof(buf)); + return (uchar*) thd->strdup(buf); + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + char buf[256]; + DBUG_EXPLAIN_INITIAL(buf, sizeof(buf)); + return (uchar*) thd->strdup(buf); + } + bool check_update_type(Item_result type) + { return type != STRING_RESULT; } +}; +#endif + +#define KEYCACHE_VAR(X) sys_var::GLOBAL,offsetof(KEY_CACHE, X), sizeof(((KEY_CACHE *)0)->X) +#define keycache_var_ptr(KC, OFF) (((uchar*)(KC))+(OFF)) +#define keycache_var(KC, OFF) (*(ulonglong*)keycache_var_ptr(KC, OFF)) +typedef bool (*keycache_update_function)(THD *, KEY_CACHE *, ptrdiff_t, ulonglong); + +/** + The class for keycache_* variables. Supports structured names, + keycache_name.variable_name. + + Class specific constructor arguments: + everything derived from Sys_var_ulonglong + + Backing store: ulonglong + + @note these variables can be only GLOBAL +*/ +class Sys_var_keycache: public Sys_var_ulonglong +{ + keycache_update_function keycache_update; +public: + Sys_var_keycache(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + ulonglong min_val, ulonglong max_val, ulonglong def_val, + ulonglong block_size, PolyLock *lock, + enum binlog_status_enum binlog_status_arg, + on_check_function on_check_func, + keycache_update_function on_update_func, + uint deprecated_version=0, const char *substitute=0) + : Sys_var_ulonglong(name_arg, comment, flag_args, off, size, + getopt, min_val, max_val, def_val, + block_size, lock, binlog_status_arg, on_check_func, 0, + deprecated_version, substitute), + keycache_update(on_update_func) + { + option.var_type|= GET_ASK_ADDR; + option.value= (uchar**)1; // crash me, please + keycache_var(dflt_key_cache, off)= def_val; + DBUG_ASSERT(scope() == GLOBAL); + } + bool global_update(THD *thd, set_var *var) + { + ulonglong new_value= var->save_result.ulonglong_value; + LEX_STRING *base_name= &var->base; + KEY_CACHE *key_cache; + + /* If no basename, assume it's for the key cache named 'default' */ + if (!base_name->length) + base_name= &default_key_cache_base; + + key_cache= get_key_cache(base_name); + + if (!key_cache) + { // Key cache didn't exists */ + if (!new_value) // Tried to delete cache + return false; // Ok, nothing to do + if (!(key_cache= create_key_cache(base_name->str, base_name->length))) + return true; + } + + /** + Abort if some other thread is changing the key cache + @todo This should be changed so that we wait until the previous + assignment is done and then do the new assign + */ + if (key_cache->in_init) + return true; + + return keycache_update(thd, key_cache, offset, new_value); + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + KEY_CACHE *key_cache= get_key_cache(base); + if (!key_cache) + key_cache= &zero_key_cache; + return keycache_var_ptr(key_cache, offset); + } +}; + +static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache, + ptrdiff_t offset, ulonglong new_value) +{ + bool error= false; + DBUG_ASSERT(offset == offsetof(KEY_CACHE, param_buff_size)); + + if (new_value == 0) + { + if (key_cache == dflt_key_cache) + { + my_error(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, MYF(0)); + return true; + } + + if (key_cache->key_cache_inited) // If initied + { + /* + Move tables using this key cache to the default key cache + and clear the old key cache. + */ + key_cache->in_init= 1; + pthread_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); + /* + 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); + key_cache->in_init= 0; + } + return error; + } + + key_cache->param_buff_size= new_value; + + /* If key cache didn't exist initialize it, else resize it */ + key_cache->in_init= 1; + pthread_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); + key_cache->in_init= 0; + + return error; +} + +static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache, + ptrdiff_t offset, ulonglong new_value) +{ + bool error= false; + DBUG_ASSERT(offset != offsetof(KEY_CACHE, param_buff_size)); + + keycache_var(key_cache, offset)= new_value; + + key_cache->in_init= 1; + pthread_mutex_unlock(&LOCK_global_system_variables); + error= ha_resize_key_cache(key_cache); + + pthread_mutex_lock(&LOCK_global_system_variables); + key_cache->in_init= 0; + + return error; +} + +/** + The class for floating point variables + + Class specific constructor arguments: min, max + + Backing store: double +*/ +class Sys_var_double: public sys_var +{ +public: + Sys_var_double(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + double min_val, double max_val, double def_val, PolyLock *lock=0, + 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) + : 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) + { + option.var_type= GET_DOUBLE; + option.min_value= min_val; + option.max_value= max_val; + global_var(double)= (double)option.def_value; + DBUG_ASSERT(min_val < max_val); + DBUG_ASSERT(min_val <= def_val); + DBUG_ASSERT(max_val >= def_val); + DBUG_ASSERT(size == sizeof(double)); + } + bool do_check(THD *thd, set_var *var) + { + my_bool fixed; + double v= var->value->val_real(); + var->save_result.double_value= getopt_double_limit_value(v, &option, &fixed); + + return throw_bounds_warning(thd, name.str, fixed, v); + } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, double)= var->save_result.double_value; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(double)= var->save_result.double_value; + return false; + } + bool check_update_type(Item_result type) + { + return type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT; + } + void session_save_default(THD *thd, set_var *var) + { var->save_result.double_value= global_var(double); } + void global_save_default(THD *thd, set_var *var) + { var->save_result.double_value= (double)option.def_value; } +}; + +/** + The class for the @max_user_connections. + It's derived from Sys_var_uint, but non-standard session value + requires a new class. + + Class specific constructor arguments: + everything derived from Sys_var_uint + + Backing store: uint +*/ +class Sys_var_max_user_conn: public Sys_var_uint +{ +public: + Sys_var_max_user_conn(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + uint min_val, uint max_val, uint def_val, + uint block_size, PolyLock *lock=0, + 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) + : Sys_var_uint(name_arg, comment, SESSION, off, size, getopt, + min_val, max_val, def_val, block_size, + lock, binlog_status_arg, on_check_func, on_update_func, + deprecated_version, substitute) + { } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + if (thd->user_connect && thd->user_connect->user_resources.user_conn) + return (uchar*) &(thd->user_connect->user_resources.user_conn); + return global_value_ptr(thd, base); + } +}; + +// overflow-safe (1 << X)-1 +#define MAX_SET(X) ((((1UL << ((X)-1))-1) << 1) | 1) + +/** + The class for flagset variables - a variant of SET that allows in-place + editing (turning on/off individual bits). String representations looks like + a "flag=val,flag=val,...". Example: @@optimizer_switch + + Class specific constructor arguments: + char* values[] - 0-terminated list of strings of valid values + + Backing store: ulonglong + + @note + the last value in the values[] array should + *always* be the string "default". +*/ +class Sys_var_flagset: public Sys_var_typelib +{ +public: + Sys_var_flagset(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + const char *values[], ulonglong def_val, PolyLock *lock=0, + 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) + : Sys_var_typelib(name_arg, comment, flag_args, off, getopt, + SHOW_CHAR, values, def_val, lock, + binlog_status_arg, on_check_func, on_update_func, + deprecated_version, substitute) + { + option.var_type= GET_FLAGSET; + global_var(ulonglong)= def_val; + DBUG_ASSERT(typelib.count > 1); + DBUG_ASSERT(typelib.count <= 65); + DBUG_ASSERT(def_val < MAX_SET(typelib.count)); + DBUG_ASSERT(strcmp(values[typelib.count-1], "default") == 0); + DBUG_ASSERT(size == sizeof(ulonglong)); + } + bool do_check(THD *thd, set_var *var) + { + char buff[STRING_BUFFER_USUAL_SIZE]; + String str(buff, sizeof(buff), system_charset_info), *res; + ulonglong default_value, current_value; + if (var->type == OPT_GLOBAL) + { + default_value= option.def_value; + current_value= global_var(ulonglong); + } + else + { + default_value= global_var(ulonglong); + current_value= session_var(thd, ulonglong); + } + + if (var->value->result_type() == STRING_RESULT) + { + if (!(res=var->value->val_str(&str))) + return true; + else + { + char *error; + uint error_len; + + var->save_result.ulonglong_value= + find_set_from_flags(&typelib, + typelib.count, + current_value, + default_value, + res->ptr(), res->length(), + &error, &error_len); + if (error) + { + ErrConvString err(error, error_len, res->charset()); + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name.str, err.ptr()); + return true; + } + } + } + else + { + longlong tmp=var->value->val_int(); + if ((tmp < 0 && ! var->value->unsigned_flag) + || (ulonglong)tmp > MAX_SET(typelib.count)) + return true; + else + var->save_result.ulonglong_value= tmp; + } + + return false; + } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, ulonglong)= var->save_result.ulonglong_value; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(ulonglong)= var->save_result.ulonglong_value; + return false; + } + void session_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= global_var(ulonglong); } + void global_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= option.def_value; } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + return (uchar*)flagset_to_string(thd, 0, session_var(thd, ulonglong), + typelib.type_names); + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + return (uchar*)flagset_to_string(thd, 0, global_var(ulonglong), + typelib.type_names); + } +}; + +/** + The class for SET variables - variables taking zero or more values + from the given list. Example: @@sql_mode + + Class specific constructor arguments: + char* values[] - 0-terminated list of strings of valid values + + Backing store: ulonglong +*/ +class Sys_var_set: public Sys_var_typelib +{ +public: + Sys_var_set(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + const char *values[], ulonglong def_val, PolyLock *lock=0, + 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) + : Sys_var_typelib(name_arg, comment, flag_args, off, getopt, + SHOW_CHAR, values, def_val, lock, + binlog_status_arg, on_check_func, on_update_func, + deprecated_version, substitute) + { + option.var_type= GET_SET; + global_var(ulonglong)= def_val; + DBUG_ASSERT(typelib.count > 0); + DBUG_ASSERT(typelib.count <= 64); + DBUG_ASSERT(def_val < MAX_SET(typelib.count)); + DBUG_ASSERT(size == sizeof(ulonglong)); + } + bool do_check(THD *thd, set_var *var) + { + char buff[STRING_BUFFER_USUAL_SIZE]; + String str(buff, sizeof(buff), system_charset_info), *res; + + if (var->value->result_type() == STRING_RESULT) + { + if (!(res=var->value->val_str(&str))) + return true; + else + { + char *error; + uint error_len; + bool not_used; + + var->save_result.ulonglong_value= + find_set(&typelib, res->ptr(), res->length(), NULL, + &error, &error_len, ¬_used); + /* + note, we only issue an error if error_len > 0. + That is even while empty (zero-length) values are considered + errors by find_set(), these errors are ignored here + */ + if (error_len) + { + ErrConvString err(error, error_len, res->charset()); + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name.str, err.ptr()); + return true; + } + } + } + else + { + longlong tmp=var->value->val_int(); + if ((tmp < 0 && ! var->value->unsigned_flag) + || (ulonglong)tmp > MAX_SET(typelib.count)) + return true; + else + var->save_result.ulonglong_value= tmp; + } + + return false; + } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, ulonglong)= var->save_result.ulonglong_value; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(ulonglong)= var->save_result.ulonglong_value; + return false; + } + void session_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= global_var(ulonglong); } + void global_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= option.def_value; } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + return (uchar*)set_to_string(thd, 0, session_var(thd, ulonglong), + typelib.type_names); + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + return (uchar*)set_to_string(thd, 0, global_var(ulonglong), + typelib.type_names); + } +}; + +/** + The class for variables which value is a plugin. + Example: @@default_storage_engine + + Class specific constructor arguments: + int plugin_type_arg (for example MYSQL_STORAGE_ENGINE_PLUGIN) + + Backing store: plugin_ref + + @note + these variables don't support command-line equivalents, any such + command-line options should be added manually to my_long_options in mysqld.cc +*/ +class Sys_var_plugin: public sys_var +{ + int plugin_type; +public: + Sys_var_plugin(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + int plugin_type_arg, char **def_val, PolyLock *lock=0, + 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) + : 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), + plugin_type(plugin_type_arg) + { + option.var_type= GET_STR; + DBUG_ASSERT(size == sizeof(plugin_ref)); + DBUG_ASSERT(getopt.id == -1); // force NO_CMD_LINE + } + bool do_check(THD *thd, set_var *var) + { + char buff[STRING_BUFFER_USUAL_SIZE]; + String str(buff,sizeof(buff), system_charset_info), *res; + if (!(res=var->value->val_str(&str))) + var->save_result.plugin= NULL; + else + { + const LEX_STRING pname= { const_cast(res->ptr()), res->length() }; + plugin_ref plugin; + + // special code for storage engines (e.g. to handle historical aliases) + if (plugin_type == MYSQL_STORAGE_ENGINE_PLUGIN) + plugin= ha_resolve_by_name(thd, &pname); + else + plugin= my_plugin_lock_by_name(thd, &pname, plugin_type); + if (!plugin) + { + // historically different error code + if (plugin_type == MYSQL_STORAGE_ENGINE_PLUGIN) + { + ErrConvString err(res); + my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), err.ptr()); + } + return true; + } + var->save_result.plugin= plugin; + } + return false; + } + void do_update(plugin_ref *valptr, plugin_ref newval) + { + plugin_ref oldval= *valptr; + if (oldval != newval) + { + *valptr= my_plugin_lock(NULL, &newval); + plugin_unlock(NULL, oldval); + } + } + bool session_update(THD *thd, set_var *var) + { + do_update((plugin_ref*)session_var_ptr(thd), + var->save_result.plugin); + return false; + } + bool global_update(THD *thd, set_var *var) + { + do_update((plugin_ref*)global_var_ptr(), + var->save_result.plugin); + return false; + } + void session_save_default(THD *thd, set_var *var) + { + plugin_ref plugin= global_var(plugin_ref); + var->save_result.plugin= my_plugin_lock(thd, &plugin); + } + void global_save_default(THD *thd, set_var *var) + { + LEX_STRING pname; + pname.str= *(char**)option.def_value; + pname.length= strlen(pname.str); + + plugin_ref plugin; + if (plugin_type == MYSQL_STORAGE_ENGINE_PLUGIN) + plugin= ha_resolve_by_name(thd, &pname); + else + plugin= my_plugin_lock_by_name(thd, &pname, plugin_type); + DBUG_ASSERT(plugin); + + var->save_result.plugin= my_plugin_lock(thd, &plugin); + } + bool check_update_type(Item_result type) + { return type != STRING_RESULT; } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + plugin_ref plugin= session_var(thd, plugin_ref); + return (uchar*)(plugin ? thd->strmake(plugin_name(plugin)->str, + plugin_name(plugin)->length) : 0); + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + plugin_ref plugin= global_var(plugin_ref); + return (uchar*)(plugin ? thd->strmake(plugin_name(plugin)->str, + plugin_name(plugin)->length) : 0); + } +}; + +#if defined(ENABLED_DEBUG_SYNC) +/** + The class for @@debug_sync session-only variable +*/ +class Sys_var_debug_sync :public sys_var +{ +public: + Sys_var_debug_sync(const char *name_arg, + const char *comment, int flag_args, + CMD_LINE getopt, + const char *def_val, PolyLock *lock=0, + 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) + : 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) + { + DBUG_ASSERT(scope() == ONLY_SESSION); + option.var_type= GET_NO_ARG; + } + bool do_check(THD *thd, set_var *var) + { + char buff[STRING_BUFFER_USUAL_SIZE]; + String str(buff, sizeof(buff), system_charset_info), *res; + + if (!(res=var->value->val_str(&str))) + var->save_result.string_value.str= const_cast(""); + else + var->save_result.string_value.str= thd->strmake(res->ptr(), res->length()); + return false; + } + bool session_update(THD *thd, set_var *var) + { + extern bool debug_sync_update(THD *thd, char *val_str); + return debug_sync_update(thd, var->save_result.string_value.str); + } + bool global_update(THD *thd, set_var *var) + { + DBUG_ASSERT(FALSE); + return true; + } + void session_save_default(THD *thd, set_var *var) + { + var->save_result.string_value.str= const_cast(""); + var->save_result.string_value.length= 0; + } + void global_save_default(THD *thd, set_var *var) + { + DBUG_ASSERT(FALSE); + } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + extern uchar *debug_sync_value_ptr(THD *thd); + return debug_sync_value_ptr(thd); + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + DBUG_ASSERT(FALSE); + return 0; + } + bool check_update_type(Item_result type) + { return type != STRING_RESULT; } +}; +#endif /* defined(ENABLED_DEBUG_SYNC) */ + +/** + The class for bit variables - a variant of boolean that stores the value + in a bit. + + Class specific constructor arguments: + ulonglong bitmask_arg - the mask for the bit to set in the ulonglong + backing store + + Backing store: ulonglong + + @note + This class supports the "reverse" semantics, when the value of the bit + being 0 corresponds to the value of variable being set. To activate it + use REVERSE(bitmask) instead of simply bitmask in the constructor. + + @note + variables of this class cannot be set from the command line as + my_getopt does not support bits. +*/ +class Sys_var_bit: public Sys_var_typelib +{ + ulonglong bitmask; + bool reverse_semantics; + void set(uchar *ptr, ulonglong value) + { + if ((value != 0) ^ reverse_semantics) + (*(ulonglong *)ptr)|= bitmask; + else + (*(ulonglong *)ptr)&= ~bitmask; + } +public: + Sys_var_bit(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + ulonglong bitmask_arg, my_bool def_val, PolyLock *lock=0, + 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) + : 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) + { + option.var_type= GET_BOOL; + reverse_semantics= my_count_bits(bitmask_arg) > 1; + bitmask= reverse_semantics ? ~bitmask_arg : bitmask_arg; + set(global_var_ptr(), def_val); + DBUG_ASSERT(def_val < 2); + DBUG_ASSERT(getopt.id == -1); // force NO_CMD_LINE + DBUG_ASSERT(size == sizeof(ulonglong)); + } + bool session_update(THD *thd, set_var *var) + { + set(session_var_ptr(thd), var->save_result.ulonglong_value); + return false; + } + bool global_update(THD *thd, set_var *var) + { + set(global_var_ptr(), var->save_result.ulonglong_value); + return false; + } + void session_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= global_var(ulonglong) & bitmask; } + void global_save_default(THD *thd, set_var *var) + { var->save_result.ulonglong_value= option.def_value; } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + thd->sys_var_tmp.my_bool_value= reverse_semantics ^ + ((session_var(thd, ulonglong) & bitmask) != 0); + return (uchar*) &thd->sys_var_tmp.my_bool_value; + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + thd->sys_var_tmp.my_bool_value= reverse_semantics ^ + ((global_var(ulonglong) & bitmask) != 0); + return (uchar*) &thd->sys_var_tmp.my_bool_value; + } +}; + +/** + The class for variables that have a special meaning for a session, + such as @@timestamp or @@rnd_seed1, their values typically cannot be read + from SV structure, and a special "read" callback is provided. + + Class specific constructor arguments: + everything derived from Sys_var_ulonglong + session_special_read_function read_func_arg + + Backing store: ulonglong + + @note + These variables are session-only, global or command-line equivalents + are not supported as they're generally meaningless. +*/ +class Sys_var_session_special: public Sys_var_ulonglong +{ + typedef bool (*session_special_update_function)(THD *thd, set_var *var); + typedef ulonglong (*session_special_read_function)(THD *thd); + + session_special_read_function read_func; + session_special_update_function update_func; +public: + Sys_var_session_special(const char *name_arg, + const char *comment, int flag_args, + CMD_LINE getopt, + ulonglong min_val, ulonglong max_val, ulonglong block_size, + PolyLock *lock, enum binlog_status_enum binlog_status_arg, + on_check_function on_check_func, + session_special_update_function update_func_arg, + session_special_read_function read_func_arg, + uint deprecated_version=0, const char *substitute=0) + : Sys_var_ulonglong(name_arg, comment, flag_args, 0, + sizeof(ulonglong), getopt, min_val, + max_val, 0, block_size, lock, binlog_status_arg, on_check_func, 0, + deprecated_version, substitute), + read_func(read_func_arg), update_func(update_func_arg) + { + DBUG_ASSERT(scope() == ONLY_SESSION); + DBUG_ASSERT(getopt.id == -1); // NO_CMD_LINE, because the offset is fake + } + bool session_update(THD *thd, set_var *var) + { return update_func(thd, var); } + bool global_update(THD *thd, set_var *var) + { + DBUG_ASSERT(FALSE); + return true; + } + void session_save_default(THD *thd, set_var *var) + { var->value= 0; } + void global_save_default(THD *thd, set_var *var) + { DBUG_ASSERT(FALSE); } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + thd->sys_var_tmp.ulonglong_value= read_func(thd); + return (uchar*) &thd->sys_var_tmp.ulonglong_value; + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + DBUG_ASSERT(FALSE); + return 0; + } +}; + +/** + The class for read-only variables that show whether a particular + feature is supported by the server. Example: have_compression + + Backing store: enum SHOW_COMP_OPTION + + @note + These variables are necessarily read-only, only global, and have no + command-line equivalent. +*/ +class Sys_var_have: public sys_var +{ +public: + Sys_var_have(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + PolyLock *lock=0, + 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) + : 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) + { + DBUG_ASSERT(scope() == GLOBAL); + DBUG_ASSERT(getopt.id == -1); + DBUG_ASSERT(lock == 0); + DBUG_ASSERT(binlog_status_arg == VARIABLE_NOT_IN_BINLOG); + DBUG_ASSERT(is_readonly()); + DBUG_ASSERT(on_update == 0); + DBUG_ASSERT(size == sizeof(enum SHOW_COMP_OPTION)); + } + bool do_check(THD *thd, set_var *var) { + DBUG_ASSERT(FALSE); + return true; + } + bool session_update(THD *thd, set_var *var) + { + DBUG_ASSERT(FALSE); + return true; + } + bool global_update(THD *thd, set_var *var) + { + DBUG_ASSERT(FALSE); + return true; + } + void session_save_default(THD *thd, set_var *var) { } + void global_save_default(THD *thd, set_var *var) { } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + DBUG_ASSERT(FALSE); + return 0; + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + return (uchar*)show_comp_option_name[global_var(enum SHOW_COMP_OPTION)]; + } + bool check_update_type(Item_result type) { return false; } +}; + +/** + Generic class for variables for storing entities that are internally + represented as structures, have names, and possibly can be referred to by + numbers. Examples: character sets, collations, locales, + + Class specific constructor arguments: + ptrdiff_t name_offset - offset of the 'name' field in the structure + + Backing store: void* + + @note + As every such a structure requires special treatment from my_getopt, + these variables don't support command-line equivalents, any such + command-line options should be added manually to my_long_options in mysqld.cc +*/ +class Sys_var_struct: public sys_var +{ + ptrdiff_t name_offset; // offset to the 'name' property in the structure +public: + Sys_var_struct(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + ptrdiff_t name_off, void *def_val, PolyLock *lock=0, + 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) + : 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) + { + option.var_type= GET_STR; + /* + struct variables are special on the command line - often (e.g. for + charsets) the name cannot be immediately resolved, but only after all + options (in particular, basedir) are parsed. + + thus all struct command-line options should be added manually + to my_long_options in mysqld.cc + */ + DBUG_ASSERT(getopt.id == -1); + DBUG_ASSERT(size == sizeof(void *)); + } + bool do_check(THD *thd, set_var *var) + { return false; } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, void*)= var->save_result.ptr; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(void*)= var->save_result.ptr; + return false; + } + void session_save_default(THD *thd, set_var *var) + { var->save_result.ptr= global_var(void*); } + void global_save_default(THD *thd, set_var *var) + { var->save_result.ptr= *(void**)option.def_value; } + bool check_update_type(Item_result type) + { return type != INT_RESULT && type != STRING_RESULT; } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + uchar *ptr= session_var(thd, uchar*); + return ptr ? *(uchar**)(ptr+name_offset) : 0; + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + uchar *ptr= global_var(uchar*); + return ptr ? *(uchar**)(ptr+name_offset) : 0; + } +}; + +/** + The class for variables that store time zones + + Backing store: Time_zone* + + @note + Time zones cannot be supported directly by my_getopt, thus + these variables don't support command-line equivalents, any such + command-line options should be added manually to my_long_options in mysqld.cc +*/ +class Sys_var_tz: public sys_var +{ +public: + Sys_var_tz(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + Time_zone **def_val, PolyLock *lock=0, + 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) + : 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) + { + DBUG_ASSERT(getopt.id == -1); + DBUG_ASSERT(size == sizeof(Time_zone *)); + } + bool do_check(THD *thd, set_var *var) + { + char buff[MAX_TIME_ZONE_NAME_LENGTH]; + String str(buff, sizeof(buff), &my_charset_latin1); + String *res= var->value->val_str(&str); + + if (!res) + return true; + + if (!(var->save_result.time_zone= my_tz_find(thd, res))) + { + ErrConvString err(res); + my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), err.ptr()); + return true; + } + return false; + } + bool session_update(THD *thd, set_var *var) + { + session_var(thd, Time_zone*)= var->save_result.time_zone; + return false; + } + bool global_update(THD *thd, set_var *var) + { + global_var(Time_zone*)= var->save_result.time_zone; + return false; + } + void session_save_default(THD *thd, set_var *var) + { + var->save_result.time_zone= global_var(Time_zone*); + } + void global_save_default(THD *thd, set_var *var) + { + var->save_result.time_zone= + *(Time_zone**)(intptr)option.def_value; + } + uchar *session_value_ptr(THD *thd, LEX_STRING *base) + { + /* + This is an ugly fix for replication: we don't replicate properly queries + invoking system variables' values to update tables; but + CONVERT_TZ(,,@@session.time_zone) is so popular that we make it + replicable (i.e. we tell the binlog code to store the session + timezone). If it's the global value which was used we can't replicate + (binlog code stores session value only). + */ + thd->time_zone_used= 1; + return (uchar *)(session_var(thd, Time_zone*)->get_name()->ptr()); + } + uchar *global_value_ptr(THD *thd, LEX_STRING *base) + { + return (uchar *)(global_var(Time_zone*)->get_name()->ptr()); + } + bool check_update_type(Item_result type) + { return type != STRING_RESULT; } +}; + +/**************************************************************************** + Used templates +****************************************************************************/ + +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION +template class List; +template class List_iterator_fast; +template class Sys_var_unsigned; +template class Sys_var_unsigned; +template class Sys_var_unsigned; +template class Sys_var_unsigned; +#endif + diff --git a/sql/sys_vars_shared.h b/sql/sys_vars_shared.h new file mode 100644 index 00000000000..e996fdba52e --- /dev/null +++ b/sql/sys_vars_shared.h @@ -0,0 +1,81 @@ +/* Copyright (C) 2002-2006 MySQL AB, 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 + "protected" interface to sys_var - server configuration variables. + + This header is included by files implementing support and utility + functions of sys_var's (set_var.cc) and files implementing + classes in the sys_var hierarchy (sql_plugin.cc) +*/ + +#include +#include "set_var.h" + +extern bool throw_bounds_warning(THD *thd, const char *name, + bool fixed, bool is_unsigned, longlong v); +extern bool throw_bounds_warning(THD *thd, const char *name, bool fixed, + double v); +extern sys_var *intern_find_sys_var(const char *str, uint length); + +extern sys_var_chain all_sys_vars; + +/** wrapper to hide a mutex and an rwlock under a common interface */ +class PolyLock +{ +public: + virtual void rdlock()= 0; + virtual void wrlock()= 0; + virtual void unlock()= 0; + virtual ~PolyLock() {} +}; + +class PolyLock_mutex: public PolyLock +{ + pthread_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); } +}; + +class PolyLock_rwlock: public PolyLock +{ + rw_lock_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); } +}; + +class AutoWLock +{ + PolyLock *lock; +public: + AutoWLock(PolyLock *l) : lock(l) { if (lock) lock->wrlock(); } + ~AutoWLock() { if (lock) lock->unlock(); } +}; + +class AutoRLock +{ + PolyLock *lock; +public: + AutoRLock(PolyLock *l) : lock(l) { if (lock) lock->rdlock(); } + ~AutoRLock() { if (lock) lock->unlock(); } +}; + diff --git a/sql/table.cc b/sql/table.cc index 0f68bb7c29e..eef03955183 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1406,12 +1406,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, keyinfo->extra_length+=HA_KEY_BLOB_LENGTH; key_part->store_length+=HA_KEY_BLOB_LENGTH; keyinfo->key_length+= HA_KEY_BLOB_LENGTH; - /* - Mark that there may be many matching values for one key - combination ('a', 'a ', 'a '...) - */ - if (!(field->flags & BINARY_FLAG)) - keyinfo->flags|= HA_END_SPACE_KEY; } if (field->type() == MYSQL_TYPE_BIT) key_part->key_part_flag|= HA_BIT_PART; diff --git a/sql/tztime.cc b/sql/tztime.cc index dbed1a16982..0784b73f353 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1756,6 +1756,10 @@ end: my_pthread_setspecific_ptr(THR_THD, 0); my_pthread_setspecific_ptr(THR_MALLOC, 0); } + + default_tz= default_tz_name ? global_system_variables.time_zone + : my_tz_SYSTEM; + DBUG_RETURN(return_val); } diff --git a/sql/unireg.h b/sql/unireg.h index 80c6ad23907..006ffff5d52 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -93,8 +93,8 @@ #define MAX_SELECT_NESTING (sizeof(nesting_map)*8-1) -#define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD) -#define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD) +#define MAX_SORT_MEMORY 2048*1024 +#define MIN_SORT_MEMORY 32*1024 /* Memory allocated when parsing a statement / saving a statement */ #define MEM_ROOT_BLOCK_SIZE 8192 diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c index 3f651d1573c..85e632e5aad 100644 --- a/storage/heap/hp_create.c +++ b/storage/heap/hp_create.c @@ -85,8 +85,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, keyinfo->seg[j].type= HA_KEYTYPE_VARTEXT1; /* fall_through */ case HA_KEYTYPE_VARTEXT1: - if (!my_binary_compare(keyinfo->seg[j].charset)) - keyinfo->flag|= HA_END_SPACE_KEY; keyinfo->flag|= HA_VAR_LENGTH_KEY; length+= 2; /* Save number of bytes used to store length */ @@ -96,8 +94,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, /* Case-insensitiveness is handled in coll->hash_sort */ /* fall_through */ case HA_KEYTYPE_VARTEXT2: - if (!my_binary_compare(keyinfo->seg[j].charset)) - keyinfo->flag|= HA_END_SPACE_KEY; keyinfo->flag|= HA_VAR_LENGTH_KEY; length+= 2; /* Save number of bytes used to store length */ @@ -111,8 +107,6 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, default: break; } - if (keyinfo->seg[j].flag & HA_END_SPACE_ARE_EQUAL) - keyinfo->flag|= HA_END_SPACE_KEY; } keyinfo->length= length; length+= keyinfo->rb_tree.size_of_element + diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c index 6eeac6acd7b..27d1114770e 100644 --- a/storage/heap/hp_rkey.c +++ b/storage/heap/hp_rkey.c @@ -63,7 +63,7 @@ int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key, info->update= 0; DBUG_RETURN(my_errno); } - if (!(keyinfo->flag & HA_NOSAME) || (keyinfo->flag & HA_END_SPACE_KEY)) + if (!(keyinfo->flag & HA_NOSAME)) memcpy(info->lastkey, key, (size_t) keyinfo->length); } memcpy(record, pos, (size_t) share->reclength); diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c index 4cde3834ed7..8f5779b04ee 100644 --- a/storage/myisam/ft_parser.c +++ b/storage/myisam/ft_parser.c @@ -83,10 +83,10 @@ my_bool ft_boolean_check_syntax_string(const uchar *str) uint i, j; if (!str || - (strlen((char*) str)+1 != sizeof(ft_boolean_syntax)) || + (strlen((char*) str)+1 != sizeof(DEFAULT_FTB_SYNTAX)) || (str[0] != ' ' && str[1] != ' ')) return 1; - for (i=0; i 127 || my_isalnum(default_charset_info, str[i])) @@ -127,7 +127,6 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end, break; if (*doc == FTB_RQUOT && param->quot) { - param->quot= (char*) doc; *start=doc+1; param->type= FT_TOKEN_RIGHT_PAREN; goto ret; @@ -139,7 +138,7 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end, /* param->prev=' '; */ *start=doc+1; if (*doc == FTB_LQUOT) - param->quot= (char*) *start; + param->quot= (char*) 1; param->type= (*doc == FTB_RBR ? FT_TOKEN_RIGHT_PAREN : FT_TOKEN_LEFT_PAREN); goto ret; } @@ -193,7 +192,6 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end, if (param->quot) { *start= doc; - param->quot= (char*) doc; param->type= 3; /* FT_RBR */ goto ret; } diff --git a/storage/myisam/ft_static.c b/storage/myisam/ft_static.c index 16cbfa1dada..78fbc5781e9 100644 --- a/storage/myisam/ft_static.c +++ b/storage/myisam/ft_static.c @@ -17,12 +17,12 @@ #include "ftdefs.h" -ulong ft_min_word_len=4; -ulong ft_max_word_len=HA_FT_MAXCHARLEN; -ulong ft_query_expansion_limit=5; -char ft_boolean_syntax[]="+ -><()~*:\"\"&|"; +ulong ft_min_word_len= 4; +ulong ft_max_word_len= HA_FT_MAXCHARLEN; +ulong ft_query_expansion_limit= 5; +const char *ft_boolean_syntax= DEFAULT_FTB_SYNTAX; -const HA_KEYSEG ft_keysegs[FT_SEGS]={ +const HA_KEYSEG ft_keysegs[FT_SEGS]= { { 0, /* charset */ HA_FT_WLEN, /* start */ @@ -45,11 +45,11 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={ } }; -const struct _ft_vft _ft_vft_nlq = { +const struct _ft_vft _ft_vft_nlq= { ft_nlq_read_next, ft_nlq_find_relevance, ft_nlq_close_search, ft_nlq_get_relevance, ft_nlq_reinit_search }; -const struct _ft_vft _ft_vft_boolean = { +const struct _ft_vft _ft_vft_boolean= { ft_boolean_read_next, ft_boolean_find_relevance, ft_boolean_close_search, ft_boolean_get_relevance, ft_boolean_reinit_search }; @@ -68,8 +68,8 @@ FT_INFO *ft_init_search(uint flags, void *info, uint keynr, return res; } -const char *ft_stopword_file = 0; -const char *ft_precompiled_stopwords[] = { +const char *ft_stopword_file= 0; +const char *ft_precompiled_stopwords[]= { #ifdef COMPILE_STOPWORDS_IN diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 33678e9677b..d09eefda463 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -30,11 +30,12 @@ #include "myisamdef.h" #include "rt_index.h" -ulong myisam_recover_options= HA_RECOVER_NONE; +ulonglong myisam_recover_options; +static ulong opt_myisam_block_size; /* bits in myisam_recover_options */ const char *myisam_recover_names[] = -{ "DEFAULT", "BACKUP", "FORCE", "QUICK", NullS}; +{ "DEFAULT", "BACKUP", "FORCE", "QUICK", "OFF", NullS}; TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"", myisam_recover_names, NULL}; @@ -44,6 +45,54 @@ TYPELIB myisam_stats_method_typelib= { array_elements(myisam_stats_method_names) - 1, "", myisam_stats_method_names, NULL}; +static MYSQL_SYSVAR_ULONG(block_size, opt_myisam_block_size, + PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG, + "Block size to be used for MyISAM index pages", NULL, NULL, + MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH, + MI_MIN_KEY_BLOCK_LENGTH); + +static MYSQL_SYSVAR_ULONG(data_pointer_size, myisam_data_pointer_size, + PLUGIN_VAR_RQCMDARG, "Default pointer size to be used for MyISAM tables", + NULL, NULL, 6, 2, 7, 1); + +#define MB (1024*1024) +static MYSQL_SYSVAR_ULONGLONG(max_sort_file_size, myisam_max_temp_length, + PLUGIN_VAR_RQCMDARG, "Don't use the fast sort index method to created " + "index if the temporary file would get bigger than this", NULL, NULL, + LONG_MAX/MB*MB, 0, MAX_FILE_SIZE, MB); + +static MYSQL_SYSVAR_SET(recover_options, myisam_recover_options, + PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, + "Syntax: myisam-recover-options[=option[,option...]], where option can be " + "DEFAULT, BACKUP, FORCE, QUICK, or OFF", + NULL, NULL, 0, &myisam_recover_typelib); + +static MYSQL_THDVAR_ULONG(repair_threads, PLUGIN_VAR_RQCMDARG, + "If larger than 1, when repairing a MyISAM table all indexes will be " + "created in parallel, with one thread per index. The value of 1 " + "disables parallel repair", NULL, NULL, + 1, 1, ULONG_MAX, 1); + +static MYSQL_THDVAR_ULONG(sort_buffer_size, PLUGIN_VAR_RQCMDARG, + "The buffer that is allocated when sorting the index when doing " + "a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE", NULL, NULL, + 8192*1024, 4, ULONG_MAX, 1); + +static MYSQL_SYSVAR_BOOL(use_mmap, opt_myisam_use_mmap, PLUGIN_VAR_NOCMDARG, + "Use memory mapping for reading and writing MyISAM tables", NULL, NULL, FALSE); + +static MYSQL_SYSVAR_ULONGLONG(mmap_size, myisam_mmap_size, + PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, "Restricts the total memory " + "used for memory mapping of MySQL tables", NULL, NULL, + SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 1); + +static MYSQL_THDVAR_ENUM(stats_method, PLUGIN_VAR_RQCMDARG, + "Specifies how MyISAM index statistics collection code should " + "treat NULLs. Possible values of name are NULLS_UNEQUAL (default " + "behavior for 4.1 and later), NULLS_EQUAL (emulate 4.0 behavior), " + "and NULLS_IGNORED", NULL, NULL, + MI_STATS_METHOD_NULLS_NOT_EQUAL, &myisam_stats_method_typelib); + #ifndef DBUG_OFF /** Causes the thread to wait in a spin lock for a query kill signal. @@ -751,7 +800,7 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) param.db_name= table->s->db.str; param.table_name= table->alias; param.testflag = check_opt->flags | T_CHECK | T_SILENT; - param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; + param.stats_method= (enum_mi_stats_method)THDVAR(thd, stats_method); if (!(table->db_stat & HA_READ_ONLY)) param.testflag|= T_STATISTICS; @@ -843,7 +892,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt) param.testflag= (T_FAST | T_CHECK | T_SILENT | T_STATISTICS | T_DONT_CHECK_CHECKSUM); param.using_global_keycache = 1; - param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; + param.stats_method= (enum_mi_stats_method)THDVAR(thd, stats_method); if (!(share->state.changed & STATE_NOT_ANALYZED)) return HA_ADMIN_ALREADY_DONE; @@ -875,7 +924,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt) param.testflag= ((check_opt->flags & ~(T_EXTEND)) | T_SILENT | T_FORCE_CREATE | T_CALC_CHECKSUM | (check_opt->flags & T_EXTEND ? T_REP : T_REP_BY_SORT)); - param.sort_buffer_length= check_opt->sort_buffer_size; + param.sort_buffer_length= THDVAR(thd, sort_buffer_size); start_records=file->state->records; while ((error=repair(thd,param,0)) && param.retry_repair) { @@ -921,7 +970,7 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt) param.op_name= "optimize"; param.testflag= (check_opt->flags | T_SILENT | T_FORCE_CREATE | T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX); - param.sort_buffer_length= check_opt->sort_buffer_size; + param.sort_buffer_length= THDVAR(thd, sort_buffer_size); if ((error= repair(thd,param,1)) && param.retry_repair) { sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying", @@ -979,7 +1028,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize) local_testflag|= T_STATISTICS; param.testflag|= T_STATISTICS; // We get this for free statistics_done=1; - if (thd->variables.myisam_repair_threads>1) + if (THDVAR(thd, repair_threads)>1) { char buf[40]; /* TODO: respect myisam_repair_threads variable */ @@ -1290,8 +1339,8 @@ int ha_myisam::enable_indexes(uint mode) param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK | T_CREATE_MISSING_KEYS); param.myf_rw&= ~MY_WAIT_IF_FULL; - param.sort_buffer_length= thd->variables.myisam_sort_buff_size; - param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; + param.sort_buffer_length= THDVAR(thd, sort_buffer_size); + param.stats_method= (enum_mi_stats_method)THDVAR(thd, stats_method); param.tmpdir=&mysql_tmpdir_list; if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair) { @@ -1970,6 +2019,14 @@ static int myisam_init(void *p) init_myisam_psi_keys(); #endif + /* Set global variables based on startup options */ + if (myisam_recover_options) + ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; + else + myisam_recover_options= HA_RECOVER_OFF; + + myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size); + myisam_hton= (handlerton *)p; myisam_hton->state= SHOW_OPTION_YES; myisam_hton->db_type= DB_TYPE_MYISAM; @@ -1979,6 +2036,19 @@ static int myisam_init(void *p) return 0; } +static struct st_mysql_sys_var* myisam_sysvars[]= { + MYSQL_SYSVAR(block_size), + MYSQL_SYSVAR(data_pointer_size), + MYSQL_SYSVAR(max_sort_file_size), + MYSQL_SYSVAR(recover_options), + MYSQL_SYSVAR(repair_threads), + MYSQL_SYSVAR(sort_buffer_size), + MYSQL_SYSVAR(use_mmap), + MYSQL_SYSVAR(mmap_size), + MYSQL_SYSVAR(stats_method), + 0 +}; + struct st_mysql_storage_engine myisam_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; @@ -1994,8 +2064,8 @@ mysql_declare_plugin(myisam) NULL, /* Plugin Deinit */ 0x0100, /* 1.0 */ NULL, /* status variables */ - NULL, /* system variables */ - NULL /* config options */ + myisam_sysvars, /* system variables */ + NULL } mysql_declare_plugin_end; diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 5bb46b03650..2f41670b934 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -23,15 +23,16 @@ #include #include -#define HA_RECOVER_NONE 0 /* No automatic recover */ #define HA_RECOVER_DEFAULT 1 /* Automatic recover active */ #define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */ #define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */ #define HA_RECOVER_QUICK 8 /* Don't check rows in data file */ +#define HA_RECOVER_OFF 16 /* No automatic recover */ extern ulong myisam_sort_buffer_size; extern TYPELIB myisam_recover_typelib; -extern ulong myisam_recover_options; +extern const char *myisam_recover_names[]; +extern ulonglong myisam_recover_options; class ha_myisam: public handler { diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 8e55a7bc50e..1cc521baf0e 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -4673,8 +4673,7 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) } return (key->flag & HA_SPATIAL) || (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && - ((ulonglong) rows * key_maxlength > - (ulonglong) myisam_max_temp_length)); + ((ulonglong) rows * key_maxlength > myisam_max_temp_length)); } /* diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c index 85a3124cba9..614ae6689f8 100644 --- a/storage/myisam/mi_static.c +++ b/storage/myisam/mi_static.c @@ -33,11 +33,11 @@ uint myisam_quick_table_bits=9; ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */ my_bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0; #if defined(THREAD) && !defined(DONT_USE_RW_LOCKS) -ulong myisam_concurrent_insert= 2; +uint myisam_concurrent_insert= 2; #else -ulong myisam_concurrent_insert= 0; +uint myisam_concurrent_insert= 0; #endif -my_off_t myisam_max_temp_length= MAX_FILE_SIZE; +ulonglong myisam_max_temp_length= MAX_FILE_SIZE; ulong myisam_bulk_insert_tree_size=8192*1024; ulong myisam_data_pointer_size=4; ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0; diff --git a/strings/longlong2str.c b/strings/longlong2str.c index d7de5bb0f7c..641ae0955d3 100644 --- a/strings/longlong2str.c +++ b/strings/longlong2str.c @@ -40,17 +40,18 @@ #include #include "m_string.h" -#if defined(HAVE_LONG_LONG) && !defined(longlong2str) && !defined(HAVE_LONGLONG2STR) +#ifndef ll2str /* This assumes that longlong multiplication is faster than longlong division. */ -char *longlong2str(longlong val,char *dst,int radix) +char *ll2str(longlong val,char *dst,int radix, int upcase) { char buffer[65]; register char *p; long long_val; + char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; ulonglong uval= (ulonglong) val; if (radix < 0) @@ -80,20 +81,19 @@ char *longlong2str(longlong val,char *dst,int radix) { ulonglong quo= uval/(uint) radix; uint rem= (uint) (uval- quo* (uint) radix); - *--p = _dig_vec_upper[rem]; + *--p= dig_vec[rem]; uval= quo; } long_val= (long) uval; while (long_val != 0) { long quo= long_val/radix; - *--p = _dig_vec_upper[(uchar) (long_val - quo*radix)]; + *--p= dig_vec[(uchar) (long_val - quo*radix)]; long_val= quo; } while ((*dst++ = *p++) != 0) ; return dst-1; } - #endif #ifndef longlong10_to_str diff --git a/strings/longlong2str_asm.c b/strings/longlong2str_asm.c index 637815e52c5..70fe5d7bd48 100644 --- a/strings/longlong2str_asm.c +++ b/strings/longlong2str_asm.c @@ -26,7 +26,7 @@ extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix, const char *dig_vector); -char *longlong2str(longlong val,char *dst,int radix) +char *ll2str(longlong val,char *dst,int radix, int upcase) { return longlong2str_with_dig_vector(val, dst, radix, _dig_vec_upper); } diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index ad8e7c8c776..bbefa083298 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -36,7 +36,6 @@ struct pos_arg_info uint have_longlong; /* used from integer values */ char *str_arg; /* string value of the arg */ longlong longlong_arg; /* integer value of the arg */ - double double_arg; /* double value of the arg */ }; @@ -235,19 +234,23 @@ static char *process_int_arg(char *to, char *end, size_t length, store_start= buff; if (arg_type == 'd') - store_end= int10_to_str(par, store_start, -10); + store_end= longlong10_to_str(par, store_start, -10); else if (arg_type == 'u') - store_end= int10_to_str(par, store_start, 10); + store_end= longlong10_to_str(par, store_start, 10); else if (arg_type == 'p') { store_start[0]= '0'; store_start[1]= 'x'; - store_end= int2str(par, store_start + 2, 16, 0); + store_end= ll2str(par, store_start + 2, 16, 0); + } + else if (arg_type == 'o') + { + store_end= ll2str(par, store_start, 8, 0); } else { DBUG_ASSERT(arg_type == 'X' || arg_type =='x'); - store_end= int2str(par, store_start, 16, (arg_type == 'X')); + store_end= ll2str(par, store_start, 16, (arg_type == 'X')); } if ((res_length= (size_t) (store_end - store_start)) > to_length) @@ -369,14 +372,11 @@ start: case 'b': args_arr[i].str_arg= va_arg(ap, char *); break; - case 'f': - case 'g': - args_arr[i].double_arg= va_arg(ap, double); - break; case 'd': case 'u': case 'x': case 'X': + case 'o': case 'p': if (args_arr[i].have_longlong) args_arr[i].longlong_arg= va_arg(ap,longlong); @@ -395,21 +395,23 @@ start: /* Print result string */ for (i= 0; i <= idx; i++) { - uint width= 0, length= 0; + size_t width= 0, length= 0; switch (print_arr[i].arg_type) { case 's': { char *par= args_arr[print_arr[i].arg_idx].str_arg; - width= (print_arr[i].flags & WIDTH_ARG) ? - args_arr[print_arr[i].width].longlong_arg : print_arr[i].width; + width= (print_arr[i].flags & WIDTH_ARG) + ? (size_t)args_arr[print_arr[i].width].longlong_arg + : print_arr[i].width; to= process_str_arg(cs, to, end, width, par, print_arr[i].flags); break; } case 'b': { char *par = args_arr[print_arr[i].arg_idx].str_arg; - width= (print_arr[i].flags & WIDTH_ARG) ? - args_arr[print_arr[i].width].longlong_arg : print_arr[i].width; + width= (print_arr[i].flags & WIDTH_ARG) + ? (size_t)args_arr[print_arr[i].width].longlong_arg + : print_arr[i].width; to= process_bin_arg(to, end, width, par); break; } @@ -424,12 +426,14 @@ start: case 'u': case 'x': case 'X': + case 'o': case 'p': { /* Integer parameter */ longlong larg; - length= (print_arr[i].flags & LENGTH_ARG) ? - args_arr[print_arr[i].length].longlong_arg : print_arr[i].length; + length= (print_arr[i].flags & LENGTH_ARG) + ? (size_t)args_arr[print_arr[i].length].longlong_arg + : print_arr[i].length; if (args_arr[print_arr[i].arg_idx].have_longlong) larg = args_arr[print_arr[i].arg_idx].longlong_arg; @@ -571,7 +575,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, continue; } else if (*fmt == 'd' || *fmt == 'u' || *fmt == 'x' || *fmt == 'X' || - *fmt == 'p') + *fmt == 'p' || *fmt == 'o') { /* Integer parameter */ longlong larg; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 94f3ab210d6..e9c70257e01 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -17692,9 +17692,9 @@ static void test_bug20023() SQL_BIG_SELECTS will be 1. ***********************************************************************/ - /* Set MAX_JOIN_SIZE to the default value (-1). */ + /* Set MAX_JOIN_SIZE to the default value (2^64-1). */ - DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1")); + DIE_IF(mysql_query(&con, "SET @@global.max_join_size = cast(-1 as unsigned int)")); DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default")); /* Issue COM_CHANGE_USER. */ @@ -17725,7 +17725,7 @@ static void test_bug20023() DIE_IF(mysql_query(&con, query_buffer)); - DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1")); + DIE_IF(mysql_query(&con, "SET @@global.max_join_size = cast(-1 as unsigned int)")); DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default")); /* Issue COM_CHANGE_USER. */ diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c index f3a6b5700da..c83757782b6 100644 --- a/unittest/mysys/my_vsnprintf-t.c +++ b/unittest/mysys/my_vsnprintf-t.c @@ -31,7 +31,7 @@ void test1(const char *res, const char *fmt, ...) int main(void) { - plan(47); + plan(50); test1("Constant string", "Constant string"); @@ -46,6 +46,8 @@ int main(void) "Format specifier d %d", 1); test1("Format specifier u 2", "Format specifier u %u", 2); + test1("Format specifier o 375", + "Format specifier o %o", 0375); test1("Format specifier x a", "Format specifier x %x", 10); test1("Format specifier X B", @@ -71,6 +73,9 @@ int main(void) test1("Length modifiers work: 1 * -1 * 2 * 3", "Length modifiers work: %d * %ld * %lld * %zd", 1, -1L, 2LL, (size_t)3); + test1("long long X: 123456789abcdef0", + "long long X: %llx", 0x123456789abcdef0LL); + test1("(null) pointer is fine", "%s pointer is fine", NULL); @@ -93,6 +98,9 @@ int main(void) test1("Positional arguments and a width: <0000ab>", "Positional arguments and a width: <%1$06x>", 0xab); + test1("Positional arguments octal: <7777>", + "Positional arguments octal: <%1$o>", 07777); + test1("Padding and %p <0x12> <0x034> <0x0000ab> < 0xcd>", "Padding and %%p <%04p> <%05p> <%08p> <%8p>", 0x12, 0x34, 0xab, 0xcd); diff --git a/vio/viosocket.c b/vio/viosocket.c index 484eb44fe63..6c361e4a462 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -208,7 +208,7 @@ int vio_fastsend(Vio * vio __attribute__((unused))) #endif r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, - IF_WIN(const char*, void*) &nodelay, + IF_WIN((const char*), (void*)) &nodelay, sizeof(nodelay)); } @@ -240,11 +240,20 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) my_bool -vio_should_retry(Vio * vio __attribute__((unused))) +vio_should_retry(Vio * vio) { int en = socket_errno; - return (en == SOCKET_EAGAIN || en == SOCKET_EINTR || - en == SOCKET_EWOULDBLOCK); + /* + man 2 read write + EAGAIN or EWOULDBLOCK when a socket is a non-blocking mode means + that the read/write would block. + man 7 socket + EAGAIN or EWOULDBLOCK when a socket is in a blocking mode means + that the corresponding receiving or sending timeout was reached. + */ + return en == SOCKET_EINTR || + (!vio_is_blocking(vio) && + (en == SOCKET_EAGAIN || en == SOCKET_EWOULDBLOCK)); } @@ -682,15 +691,13 @@ void vio_timeout(Vio *vio, uint which, uint timeout) #endif r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO, - IF_WIN(const char*, const void*)&wait_timeout, + IF_WIN((const char*), (const void*))&wait_timeout, sizeof(wait_timeout)); } -#ifndef DBUG_OFF if (r != 0) DBUG_PRINT("error", ("setsockopt failed: %d, errno: %d", r, socket_errno)); -#endif DBUG_VOID_RETURN; #else From bb865442a4282b1146fd693dac18d98d55d888d2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 22 Dec 2009 12:02:52 +0100 Subject: [PATCH 36/86] minimal changes to errmst-utf8.txt (mostly whitespace) to match 6.0-codebase better --- mysql-test/r/create.result | 4 +-- mysql-test/r/log_tables.result | 2 +- mysql-test/r/mysql.result | 4 +-- mysql-test/r/not_partition.result | 26 +++++++++---------- mysql-test/r/partition.result | 10 +++---- mysql-test/r/partition_innodb.result | 4 +-- mysql-test/r/plugin.result | 2 +- mysql-test/r/show_check.result | 8 +++--- mysql-test/r/variables.result | 2 +- mysql-test/r/warnings_engine_disabled.result | 4 +-- mysql-test/suite/ndb/r/ndb_dd_basic.result | 2 +- .../r/default_storage_engine_basic.result | 4 +-- .../sys_vars/r/storage_engine_basic.result | 4 +-- sql/share/errmsg-utf8.txt | 12 ++++----- 14 files changed, 44 insertions(+), 44 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 471cc6e9a3d..019aeba27b6 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -228,7 +228,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MEMORY DEFAULT CHARSET=latin1 drop table t1; SET SESSION storage_engine="gemini"; -ERROR 42000: Unknown table engine 'gemini' +ERROR 42000: Unknown storage engine 'gemini' SELECT @@storage_engine; @@storage_engine MEMORY @@ -389,7 +389,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MEMORY DEFAULT CHARSET=latin1 drop table t1; SET SESSION storage_engine="gemini"; -ERROR 42000: Unknown table engine 'gemini' +ERROR 42000: Unknown storage engine 'gemini' SELECT @@storage_engine; @@storage_engine MEMORY diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 80684e5f5d2..1666d5e0297 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -249,7 +249,7 @@ set @save_storage_engine= @@session.storage_engine; set storage_engine= MEMORY; alter table mysql.slow_log engine=NonExistentEngine; Warnings: -Warning 1286 Unknown table engine 'NonExistentEngine' +Warning 1286 Unknown storage engine 'NonExistentEngine' alter table mysql.slow_log engine=memory; ERROR HY000: This storage engine cannot be used for log tables" set storage_engine= @save_storage_engine; diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 366052af95e..b2d4531d0ad 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -397,9 +397,9 @@ WARNING: --server-arg option not supported in this configuration. +---+ | 1 | +---+ -Warning (Code 1286): Unknown table engine 'nonexistent' +Warning (Code 1286): Unknown storage engine 'nonexistent' Warning (Code 1266): Using storage engine MyISAM for table 't2' -Warning (Code 1286): Unknown table engine 'nonexistent2' +Warning (Code 1286): Unknown storage engine 'nonexistent2' Warning (Code 1266): Using storage engine MyISAM for table 't2' Error (Code 1050): Table 't2' already exists drop tables t1, t2; diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result index f516f8634ce..f3a0e4ea0e5 100644 --- a/mysql-test/r/not_partition.result +++ b/mysql-test/r/not_partition.result @@ -1,47 +1,47 @@ DROP TABLE IF EXISTS t1; FLUSH TABLES; SELECT * FROM t1; -ERROR 42000: Unknown table engine 'partition' +ERROR 42000: Unknown storage engine 'partition' TRUNCATE TABLE t1; -ERROR 42000: Unknown table engine 'partition' +ERROR 42000: Unknown storage engine 'partition' ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze Error Unknown table engine 'partition' +test.t1 analyze Error Unknown storage engine 'partition' test.t1 analyze error Corrupt CHECK TABLE t1; Table Op Msg_type Msg_text -test.t1 check Error Unknown table engine 'partition' +test.t1 check Error Unknown storage engine 'partition' test.t1 check error Corrupt OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize Error Unknown table engine 'partition' +test.t1 optimize Error Unknown storage engine 'partition' test.t1 optimize error Corrupt REPAIR TABLE t1; Table Op Msg_type Msg_text -test.t1 repair Error Unknown table engine 'partition' +test.t1 repair Error Unknown storage engine 'partition' test.t1 repair error Corrupt ALTER TABLE t1 REPAIR PARTITION ALL; Table Op Msg_type Msg_text -test.t1 repair Error Unknown table engine 'partition' +test.t1 repair Error Unknown storage engine 'partition' test.t1 repair error Corrupt ALTER TABLE t1 CHECK PARTITION ALL; Table Op Msg_type Msg_text -test.t1 check Error Unknown table engine 'partition' +test.t1 check Error Unknown storage engine 'partition' test.t1 check error Corrupt ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize Error Unknown table engine 'partition' +test.t1 optimize Error Unknown storage engine 'partition' test.t1 optimize error Corrupt ALTER TABLE t1 ANALYZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 analyze Error Unknown table engine 'partition' +test.t1 analyze Error Unknown storage engine 'partition' test.t1 analyze error Corrupt ALTER TABLE t1 REBUILD PARTITION ALL; -ERROR 42000: Unknown table engine 'partition' +ERROR 42000: Unknown storage engine 'partition' ALTER TABLE t1 ENGINE Memory; -ERROR 42000: Unknown table engine 'partition' +ERROR 42000: Unknown storage engine 'partition' ALTER TABLE t1 ADD (new INT); -ERROR 42000: Unknown table engine 'partition' +ERROR 42000: Unknown storage engine 'partition' DROP TABLE t1; CREATE TABLE t1 ( firstname VARCHAR(25) NOT NULL, diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 0435db628f4..b72cc607fe2 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -97,30 +97,30 @@ DROP TABLE t1; CREATE TABLE t1 (a INT) ENGINE=NonExistentEngine; Warnings: -Warning 1286 Unknown table engine 'NonExistentEngine' +Warning 1286 Unknown storage engine 'NonExistentEngine' Warning 1266 Using storage engine MyISAM for table 't1' DROP TABLE t1; CREATE TABLE t1 (a INT) ENGINE=NonExistentEngine PARTITION BY HASH (a); Warnings: -Warning 1286 Unknown table engine 'NonExistentEngine' +Warning 1286 Unknown storage engine 'NonExistentEngine' Warning 1266 Using storage engine MyISAM for table 't1' DROP TABLE t1; CREATE TABLE t1 (a INT) ENGINE=Memory; ALTER TABLE t1 ENGINE=NonExistentEngine; Warnings: -Warning 1286 Unknown table engine 'NonExistentEngine' +Warning 1286 Unknown storage engine 'NonExistentEngine' ALTER TABLE t1 PARTITION BY HASH (a) (PARTITION p0 ENGINE=Memory, PARTITION p1 ENGINE=NonExistentEngine); Warnings: -Warning 1286 Unknown table engine 'NonExistentEngine' +Warning 1286 Unknown storage engine 'NonExistentEngine' ALTER TABLE t1 ENGINE=NonExistentEngine; Warnings: -Warning 1286 Unknown table engine 'NonExistentEngine' +Warning 1286 Unknown storage engine 'NonExistentEngine' SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 702a1bf8797..d7145fcc604 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -196,7 +196,7 @@ create table t1 (a int) engine = x partition by key (a); Warnings: -Warning 1286 Unknown table engine 'x' +Warning 1286 Unknown storage engine 'x' Warning 1266 Using storage engine MyISAM for table 't1' show create table t1; Table Create Table @@ -211,7 +211,7 @@ partition by list (a) (partition p0 values in (0)); alter table t1 engine = x; Warnings: -Warning 1286 Unknown table engine 'x' +Warning 1286 Unknown storage engine 'x' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 9cae2b487b2..0d5bc29fc8c 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -1,6 +1,6 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE; Warnings: -Warning 1286 Unknown table engine 'EXAMPLE' +Warning 1286 Unknown storage engine 'EXAMPLE' Warning 1266 Using storage engine MyISAM for table 't1' DROP TABLE t1; INSTALL PLUGIN example SONAME 'ha_example.so'; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index c6276f319a1..fc995d42fae 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1298,13 +1298,13 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par drop table `mysqlttest\1`.`a\b`; drop database `mysqlttest\1`; show engine foobar status; -ERROR 42000: Unknown table engine 'foobar' +ERROR 42000: Unknown storage engine 'foobar' show engine foobar logs; -ERROR 42000: Unknown table engine 'foobar' +ERROR 42000: Unknown storage engine 'foobar' show engine foobar mutex; -ERROR 42000: Unknown table engine 'foobar' +ERROR 42000: Unknown storage engine 'foobar' show engine mutex status; -ERROR 42000: Unknown table engine 'mutex' +ERROR 42000: Unknown storage engine 'mutex' show engine csv status; Type Name Status show engine csv logs; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index e99f4e3deb9..8f8570d43a2 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -427,7 +427,7 @@ ERROR HY000: Unknown system variable 'unknown_variable' set max_join_size="hello"; ERROR 42000: Incorrect argument type to variable 'max_join_size' set default_storage_engine=UNKNOWN_TABLE_TYPE; -ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE' +ERROR 42000: Unknown storage engine 'UNKNOWN_TABLE_TYPE' set default_storage_engine=MERGE, big_tables=2; ERROR 42000: Variable 'big_tables' can't be set to the value of '2' show local variables like 'default_storage_engine'; diff --git a/mysql-test/r/warnings_engine_disabled.result b/mysql-test/r/warnings_engine_disabled.result index e5d35fdaa5f..3b9d92d87f7 100644 --- a/mysql-test/r/warnings_engine_disabled.result +++ b/mysql-test/r/warnings_engine_disabled.result @@ -1,10 +1,10 @@ create table t1 (id int) engine=NDB; Warnings: -Warning 1286 Unknown table engine 'NDB' +Warning 1286 Unknown storage engine 'NDB' Warning 1266 Using storage engine MyISAM for table 't1' alter table t1 engine=NDB; Warnings: -Warning 1286 Unknown table engine 'NDB' +Warning 1286 Unknown storage engine 'NDB' drop table t1; SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster'; ENGINE SUPPORT diff --git a/mysql-test/suite/ndb/r/ndb_dd_basic.result b/mysql-test/suite/ndb/r/ndb_dd_basic.result index b956d3b0047..e56c18c5d95 100644 --- a/mysql-test/suite/ndb/r/ndb_dd_basic.result +++ b/mysql-test/suite/ndb/r/ndb_dd_basic.result @@ -14,7 +14,7 @@ ADD UNDOFILE 'undofile02.dat' INITIAL_SIZE = 4M ENGINE=XYZ; Warnings: -Warning 1286 Unknown table engine 'XYZ' +Warning 1286 Unknown storage engine 'XYZ' Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' diff --git a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result index 2bbb6fe6012..541c0b6b328 100644 --- a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result +++ b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result @@ -61,13 +61,13 @@ ERROR 42000: Incorrect argument type to variable 'default_storage_engine' SET @@global.default_storage_engine = 65530.34; ERROR 42000: Incorrect argument type to variable 'default_storage_engine' SET @@global.default_storage_engine = FILE; -ERROR 42000: Unknown table engine 'FILE' +ERROR 42000: Unknown storage engine 'FILE' SET @@session.default_storage_engine = 8199; ERROR 42000: Incorrect argument type to variable 'default_storage_engine' SET @@session.default_storage_engine = 65530.34; ERROR 42000: Incorrect argument type to variable 'default_storage_engine' SET @@session.default_storage_engine = RECORD; -ERROR 42000: Unknown table engine 'RECORD' +ERROR 42000: Unknown storage engine 'RECORD' '#------------------FN_DYNVARS_005_05-----------------------#' SELECT @@global.default_storage_engine = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/sys_vars/r/storage_engine_basic.result b/mysql-test/suite/sys_vars/r/storage_engine_basic.result index 6af550c1f70..5e80f1343b7 100644 --- a/mysql-test/suite/sys_vars/r/storage_engine_basic.result +++ b/mysql-test/suite/sys_vars/r/storage_engine_basic.result @@ -61,13 +61,13 @@ ERROR 42000: Incorrect argument type to variable 'storage_engine' SET @@global.storage_engine = 65530.34; ERROR 42000: Incorrect argument type to variable 'storage_engine' SET @@global.storage_engine = FILE; -ERROR 42000: Unknown table engine 'FILE' +ERROR 42000: Unknown storage engine 'FILE' SET @@session.storage_engine = 8199; ERROR 42000: Incorrect argument type to variable 'storage_engine' SET @@session.storage_engine = 65530.34; ERROR 42000: Incorrect argument type to variable 'storage_engine' SET @@session.storage_engine = RECORD; -ERROR 42000: Unknown table engine 'RECORD' +ERROR 42000: Unknown storage engine 'RECORD' '#------------------FN_DYNVARS_005_05-----------------------#' SELECT @@global.storage_engine = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 09812583745..69fd6e0fbe2 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -1777,7 +1777,7 @@ ER_TOO_BIG_FIELDLENGTH 42000 S1009 dan "For stor feltlængde for kolonne '%-.192s' (maks = %lu). Brug BLOB i stedet" nla "Te grote kolomlengte voor '%-.192s' (max = %lu). Maak hiervoor gebruik van het type BLOB" eng "Column length too big for column '%-.192s' (max = %lu); use BLOB or TEXT instead" - jps "column '%-.192s' ã¯,確ä¿ã™ã‚‹ column ã®å¤§ãã•ãŒå¤šã™ãŽã¾ã™. (最大 %lu ã¾ã§). BLOB ã‚’ã‹ã‚りã«ä½¿ç”¨ã—ã¦ãã ã•ã„.", + jps "column '%-.192s' ã¯,確ä¿ã™ã‚‹ column ã®å¤§ãã•ãŒå¤šã™ãŽã¾ã™. (最大 %lu ã¾ã§). BLOB ã‚’ã‹ã‚りã«ä½¿ç”¨ã—ã¦ãã ã•ã„." est "Tulba '%-.192s' pikkus on liiga pikk (maksimaalne pikkus: %lu). Kasuta BLOB väljatüüpi" fre "Champ '%-.192s' trop long (max = %lu). Utilisez un BLOB" ger "Feldlänge für Feld '%-.192s' zu groß (maximal %lu). BLOB- oder TEXT-Spaltentyp verwenden!" @@ -5014,7 +5014,7 @@ ER_WARN_HOSTNAME_WONT_WORK por "MySQL foi inicializado em modo --skip-name-resolve. Você necesita reincializá-lo sem esta opção para este grant funcionar" spa "MySQL esta inicializado en modo --skip-name-resolve. Usted necesita reinicializarlo sin esta opción para este derecho funcionar" ER_UNKNOWN_STORAGE_ENGINE 42000 - eng "Unknown table engine '%s'" + eng "Unknown storage engine '%s'" ger "Unbekannte Speicher-Engine '%s'" por "Motor de tabela desconhecido '%s'" spa "Desconocido motor de tabla '%s'" @@ -6120,7 +6120,7 @@ ER_LOAD_DATA_INVALID_COLUMN eng "Invalid column reference (%-.64s) in LOAD DATA" ER_LOG_PURGE_NO_FILE - eng "Being purged log %s was not found" + eng "Being purged log %s was not found" ER_XA_RBTIMEOUT XA106 eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long" @@ -6196,7 +6196,7 @@ ER_RENAMED_NAME eng "Renamed" swe "Namnändrad" ER_TOO_MANY_CONCURRENT_TRXS - eng "Too many active concurrent transactions" + eng "Too many active concurrent transactions" WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED eng "Non-ASCII separator arguments are not fully supported" @@ -6235,7 +6235,7 @@ WARN_COND_ITEM_TRUNCATED ER_COND_ITEM_TOO_LONG eng "Data too long for condition item '%s'" -ER_UNKNOWN_LOCALE +ER_UNKNOWN_LOCALE eng "Unknown locale: '%-.64s'" ER_SLAVE_IGNORE_SERVER_IDS @@ -6261,7 +6261,7 @@ ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD ER_PARTITION_FIELDS_TOO_LONG eng "The total length of the partitioning fields is too large" ER_PATH_LENGTH - eng "The path specified for %.64s is too long." + eng "The path specified for %.64s is too long." 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." From 274e1e4497744e402017f9753de0f3c8354e45e8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 22 Dec 2009 12:05:51 +0100 Subject: [PATCH 37/86] 32-bit fix --- mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test index ac887711514..c5d4f8d0c59 100644 --- a/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test +++ b/mysql-test/suite/sys_vars/t/myisam_mmap_size_basic.test @@ -1,12 +1,17 @@ # # only global # +--replace_result 4294967295 18446744073709551615 select @@global.myisam_mmap_size; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.myisam_mmap_size; +--replace_result 4294967295 18446744073709551615 show global variables like 'myisam_mmap_size'; +--replace_result 4294967295 18446744073709551615 show session variables like 'myisam_mmap_size'; +--replace_result 4294967295 18446744073709551615 select * from information_schema.global_variables where variable_name='myisam_mmap_size'; +--replace_result 4294967295 18446744073709551615 select * from information_schema.session_variables where variable_name='myisam_mmap_size'; # From 67cc50d2a36b7b6fbd55cffe02bec413c05365fc Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 22 Dec 2009 11:51:46 +0000 Subject: [PATCH 38/86] 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 39/86] 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 40/86] 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 12f364ece7663663cabdc29f106ca69af63fe4e7 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 22 Dec 2009 19:23:13 +0300 Subject: [PATCH 41/86] Backport of WL #2934: Make/find library for doing float/double to string conversions and vice versa" Initial import of the dtoa.c code and custom wrappers around it to allow its usage from the server code. Conversion of FLOAT/DOUBLE values to DECIMAL ones or strings and vice versa has been significantly reworked. As the new algoritms are more precise than the older ones, results of such conversions may not always match those obtained from older server versions. This in turn may break compatibility for some applications. This patch also fixes the following bugs: - bug #12860 "Difference in zero padding of exponent between Unix and Windows" - bug #21497 "DOUBLE truncated to unusable value" - bug #26788 "mysqld (debug) aborts when inserting specific numbers into char fields" - bug #24541 "Data truncated..." on decimal type columns without any good reason" --- CMakeLists.txt | 8 + client/Makefile.am | 2 +- client/sql_string.cc | 80 +- configure.in | 17 +- include/m_string.h | 37 +- libmysql/CMakeLists.txt | 4 +- libmysql/Makefile.shared | 4 +- libmysql/libmysql.c | 54 +- mysql-test/r/archive_gis.result | 8 +- mysql-test/r/cast.result | 10 +- mysql-test/r/func_group.result | 18 +- mysql-test/r/func_math.result | 34 +- mysql-test/r/func_str.result | 4 +- mysql-test/r/gis.result | 12 +- mysql-test/r/innodb_gis.result | 8 +- mysql-test/r/insert.result | 70 +- mysql-test/r/loaddata.result | 6 +- mysql-test/r/mysqldump.result | 2 +- mysql-test/r/parser.result | 4 +- mysql-test/r/ps_2myisam.result | 74 +- mysql-test/r/ps_3innodb.result | 74 +- mysql-test/r/ps_4heap.result | 68 +- mysql-test/r/ps_5merge.result | 148 +- mysql-test/r/select.result | 14 +- mysql-test/r/sp.result | 20 +- mysql-test/r/strict.result | 14 +- mysql-test/r/type_decimal.result | 12 + mysql-test/r/type_float.result | 82 +- mysql-test/r/type_newdecimal.result | 124 +- mysql-test/r/variables.result | 2 +- mysql-test/r/view.result | 2 +- .../ndb_backup51_data_be/BACKUP-1-0.1.Data | Bin 43068 -> 43068 bytes .../ndb_backup51_data_le/BACKUP-1-0.2.Data | Bin 49556 -> 49556 bytes mysql-test/suite/ndb/r/ndb_gis.result | 16 +- .../ndb_restore_different_endian_data.result | 4 +- mysql-test/suite/ndb/r/ps_7ndb.result | 74 +- mysql-test/t/cast.test | 2 - mysql-test/t/gis.test | 3 + mysql-test/t/insert.test | 6 - mysql-test/t/mysqldump.test | 3 - mysql-test/t/parser.test | 4 + mysql-test/t/type_decimal.test | 12 + mysql-test/t/type_float.test | 33 +- mysql-test/t/type_newdecimal.test | 6 +- sql/field.cc | 243 +- sql/item.cc | 13 +- sql/log_event.cc | 6 +- sql/mysql_priv.h | 1 + sql/mysqld.cc | 65 +- sql/spatial.cc | 23 +- sql/sql_show.cc | 3 +- sql/sql_string.cc | 80 +- sql/unireg.h | 1 - strings/CMakeLists.txt | 4 +- strings/Makefile.am | 6 +- strings/decimal.c | 45 +- strings/dtoa.c | 2780 +++++++++++++++++ strings/strtod.c | 236 -- 58 files changed, 3526 insertions(+), 1159 deletions(-) create mode 100644 strings/dtoa.c delete mode 100644 strings/strtod.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e8c7db3c2a..4a02a5ca0a9 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,14 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7") MESSAGE("Warning: Building MySQL with Visual Studio 2003.NET is no more supported.") MESSAGE("Please use a newer version of Visual Studio.") SET(WITHOUT_DYNAMIC_PLUGINS TRUE) + + # VS2003 needs the /Op compiler option to disable floating point optimizations + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Op") + SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Op") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Op") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Op") + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Op") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Op") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7") # Settings for Visual Studio 7 and above. diff --git a/client/Makefile.am b/client/Makefile.am index ccd0d8aada0..e94d638a8be 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -108,7 +108,7 @@ sql_src=log_event.h mysql_priv.h rpl_constants.h \ log_event.cc my_decimal.h my_decimal.cc \ log_event_old.h log_event_old.cc \ rpl_record_old.h rpl_record_old.cc -strings_src=decimal.c +strings_src=decimal.c dtoa.c link_sources: for f in $(sql_src) ; do \ diff --git a/client/sql_string.cc b/client/sql_string.cc index 3292bc7e6f2..ccbc8977e7f 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -24,10 +24,6 @@ #include #include #include -#ifdef HAVE_FCONVERT -#include -#endif - /* The following extern declarations are ok as these are interface functions required by the string function @@ -117,82 +113,19 @@ bool String::set(ulonglong num, CHARSET_INFO *cs) bool String::set(double num,uint decimals, CHARSET_INFO *cs) { - char buff[331]; + char buff[FLOATING_POINT_BUFFER]; uint dummy_errors; + size_t len; str_charset=cs; if (decimals >= NOT_FIXED_DEC) { - uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME + len= my_gcvt(num, MY_GCVT_ARG_DOUBLE, sizeof(buff) - 1, buff, NULL); return copy(buff, len, &my_charset_latin1, cs, &dummy_errors); } -#ifdef HAVE_FCONVERT - int decpt,sign; - char *pos,*to; - - (void) fconvert(num,(int) decimals,&decpt,&sign,buff+1); - if (!my_isdigit(&my_charset_latin1, buff[1])) - { // Nan or Inf - pos=buff+1; - if (sign) - { - buff[0]='-'; - pos=buff; - } - uint dummy_errors; - return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs, &dummy_errors); - } - if (alloc((uint32) ((uint32) decpt+3+decimals))) - return TRUE; - to=Ptr; - if (sign) - *to++='-'; - - pos=buff+1; - if (decpt < 0) - { /* value is < 0 */ - *to++='0'; - if (!decimals) - goto end; - *to++='.'; - if ((uint32) -decpt > decimals) - decpt= - (int) decimals; - decimals=(uint32) ((int) decimals+decpt); - while (decpt++ < 0) - *to++='0'; - } - else if (decpt == 0) - { - *to++= '0'; - if (!decimals) - goto end; - *to++='.'; - } - else - { - while (decpt-- > 0) - *to++= *pos++; - if (!decimals) - goto end; - *to++='.'; - } - while (decimals--) - *to++= *pos++; - -end: - *to=0; - str_length=(uint32) (to-Ptr); - return FALSE; -#else -#ifdef HAVE_SNPRINTF - buff[sizeof(buff)-1]=0; // Safety - snprintf(buff,sizeof(buff)-1, "%.*f",(int) decimals,num); -#else - sprintf(buff,"%.*f",(int) decimals,num); -#endif - return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs, + len= my_fcvt(num, decimals, buff, NULL); + return copy(buff, (uint32) len, &my_charset_latin1, cs, &dummy_errors); -#endif } @@ -675,7 +608,8 @@ void String::qs_append(const char *str, uint32 len) void String::qs_append(double d) { char *buff = Ptr + str_length; - str_length+= my_sprintf(buff, (buff, "%.15g", d)); + str_length+= my_gcvt(d, MY_GCVT_ARG_DOUBLE, FLOATING_POINT_BUFFER - 1, buff, + NULL); } void String::qs_append(double *d) diff --git a/configure.in b/configure.in index 402280392ba..ff6b486defb 100644 --- a/configure.in +++ b/configure.in @@ -375,6 +375,21 @@ case "$target_os" in fi ;; esac + +# The following is required for portable results of floating point calculations +# on PowerPC. The same must also be done for IA-64, but this options is missing +# in the IA-64 gcc backend. + +if test "$GCC" = "yes" +then + case "$host_cpu" in + *ppc* | *powerpc*) + CFLAGS="$CFLAGS -mno-fused-madd" + CXXFLAGS="$CXXFLAGS -mno-fused-madd" + ;; + esac +fi + AC_SUBST(CC) AC_SUBST(CFLAGS) AC_SUBST(CXX) @@ -2236,7 +2251,7 @@ AC_FUNC_VPRINTF AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \ chsize cuserid fchmod fcntl \ - fconvert fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \ + fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \ getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ getpwuid getrlimit getrusage getwd index initgroups isnan \ localtime_r gethrtime gmtime_r \ diff --git a/include/m_string.h b/include/m_string.h index a6a36f32ca4..45801ff85b7 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -92,9 +92,6 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ extern char NEAR _dig_vec_upper[]; extern char NEAR _dig_vec_lower[]; -/* Defined in strtod.c */ -extern const double log_10[309]; - #ifdef BAD_STRING_COMPILER #define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1) #else @@ -199,8 +196,42 @@ extern char *strstr(const char *, const char *); extern int is_prefix(const char *, const char *); /* Conversion routines */ +typedef enum { + MY_GCVT_ARG_FLOAT, + MY_GCVT_ARG_DOUBLE +} my_gcvt_arg_type; + double my_strtod(const char *str, char **end, int *error); double my_atof(const char *nptr); +size_t my_fcvt(double x, int precision, char *to, my_bool *error); +size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, + my_bool *error); + +#define NOT_FIXED_DEC 31 + +/* + The longest string my_fcvt can return is 311 + "precision" bytes. + Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC + (+ 1 byte for the terminating '\0'). +*/ +#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC) + +/* + We want to use the 'e' format in some cases even if we have enough space + for the 'f' one just to mimic sprintf("%.15g") behavior for large integers, + and to improve it for numbers < 10^(-4). + That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require + it to be integer and be <= 10^DBL_DIG for the 'f' format to be used. + We don't lose precision, but make cases like "1e200" or "0.00001" look nicer. +*/ +#define MAX_DECPT_FOR_F_FORMAT DBL_DIG + +/* + The maximum possible field width for my_gcvt() conversion. + (DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or + MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used). +*/ +#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + max(5, MAX_DECPT_FOR_F_FORMAT)) \ extern char *llstr(longlong value,char *buff); extern char *ullstr(longlong value,char *buff); diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 84ad50e03e3..06c683bd27e 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -69,7 +69,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c ../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c ../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c - ../mysys/default.c errmsg.c ../mysys/errors.c + ../mysys/default.c strings/dtoa.c errmsg.c ../mysys/errors.c ../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c get_password.c ../strings/int2str.c ../strings/is_prefix.c libmysql.c ../mysys/list.c ../strings/llstr.c @@ -92,7 +92,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c ../strings/str_alloc.c ../strings/strcend.c ../strings/strcont.c ../strings/strend.c ../strings/strfill.c ../mysys/string.c ../strings/strinstr.c ../strings/strmake.c - ../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c + ../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index b626d3343ce..dbe801ecd17 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -35,7 +35,7 @@ target_sources = libmysql.c password.c \ get_password.c errmsg.c mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ - strmake.lo strend.lo strtod.lo \ + strmake.lo strend.lo \ strnlen.lo strfill.lo is_prefix.lo \ int2str.lo str2int.lo strinstr.lo strcont.lo \ strcend.lo bcmp.lo ctype-latin1.lo \ @@ -46,7 +46,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \ ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo \ ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo \ - ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo + ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo dtoa.lo mystringsextra= strto.c dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 6f5fcd187b7..ec7263e2dd8 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3372,12 +3372,13 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, param output buffer descriptor field column metadata value column data - width default number of significant digits used when converting - float/double to string + type either MY_GCVT_ARG_FLOAT or MY_GCVT_ARG_DOUBLE. + Affects the maximum number of significant digits + returned by my_gcvt(). */ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, - double value, int width) + double value, my_gcvt_arg_type type) { char *buffer= (char *)param->buffer; double val64 = (value < 0 ? -floor(-value) : floor(value)); @@ -3461,39 +3462,24 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, floating point -> string conversion nicely, honor all typecodes and param->offset possibly set in mysql_stmt_fetch_column */ - char buff[MAX_DOUBLE_STRING_REP_LENGTH]; - char *end; + char buff[FLOATING_POINT_BUFFER]; + size_t len; if (field->decimals >= NOT_FIXED_DEC) - { - /* - DBL_DIG below is to ensure that the server and client has the same - precisions. This will ensure that on the same machine you get the - same value as a string independent of the protocol you use. - */ - sprintf(buff, "%-*.*g", (int) min(sizeof(buff)-1, - param->buffer_length), - min(DBL_DIG, width), value); - end= strcend(buff, ' '); - *end= 0; - } + len= my_gcvt(value, type, + (int) min(sizeof(buff)-1, param->buffer_length), + buff, NULL); else - { - sprintf(buff, "%.*f", (int) field->decimals, value); - end= strend(buff); - } + len= my_fcvt(value, (int) field->decimals, buff, NULL); + if (field->flags & ZEROFILL_FLAG && len < field->length && + field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1) { - size_t length= end - buff; - if (field->flags & ZEROFILL_FLAG && length < field->length && - field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1) - { - bmove_upp((uchar*) buff + field->length, (uchar*) buff + length, - length); - bfill((char*) buff, field->length - length, '0'); - length= field->length; - } - fetch_string_with_conversion(param, buff, length); + bmove_upp((uchar*) buff + field->length, (uchar*) buff + len, + len); + bfill((char*) buff, field->length - len, '0'); + len= field->length; } + fetch_string_with_conversion(param, buff, len); break; } @@ -3538,7 +3524,7 @@ static void fetch_datetime_with_conversion(MYSQL_BIND *param, { ulonglong value= TIME_to_ulonglong(my_time); fetch_float_with_conversion(param, field, - ulonglong2double(value), DBL_DIG); + ulonglong2double(value), MY_GCVT_ARG_DOUBLE); break; } case MYSQL_TYPE_TINY: @@ -3632,7 +3618,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, { float value; float4get(value,*row); - fetch_float_with_conversion(param, field, value, FLT_DIG); + fetch_float_with_conversion(param, field, value, MY_GCVT_ARG_FLOAT); *row+= 4; break; } @@ -3640,7 +3626,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, { double value; float8get(value,*row); - fetch_float_with_conversion(param, field, value, DBL_DIG); + fetch_float_with_conversion(param, field, value, MY_GCVT_ARG_DOUBLE); *row+= 8; break; } diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result index 178c5716911..ad7bd374629 100644 --- a/mysql-test/r/archive_gis.result +++ b/mysql-test/r/archive_gis.result @@ -266,7 +266,7 @@ fid AsText(EndPoint(g)) 107 POINT(40 10) SELECT fid, GLength(g) FROM gis_line ORDER by fid; fid GLength(g) -105 24.142135623731 +105 24.14213562373095 106 40 107 30 SELECT fid, NumPoints(g) FROM gis_line ORDER by fid; @@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.4166666666667 25.4166666666667) +109 POINT(25.416666666666668 25.416666666666668) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon ORDER by fid; fid Area(g) @@ -326,8 +326,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; fid AsText(Centroid(g)) -117 POINT(55.5885277530424 17.426536064114) -118 POINT(55.5885277530424 17.426536064114) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; fid Area(g) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index c53de220b60..3e1ea824db5 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -342,11 +342,11 @@ INSERT INTO t1 SET f1 = -1.0e+30 ; INSERT INTO t1 SET f1 = +1.0e+30 ; SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1; double_val cast_val --1e+30 -9223372036854775808 -1e+30 9223372036854775807 +-1e30 -9223372036854775808 +1e30 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1e+30' -Warning 1292 Truncated incorrect INTEGER value: '1e+30' +Warning 1292 Truncated incorrect INTEGER value: '-1e30' +Warning 1292 Truncated incorrect INTEGER value: '1e30' DROP TABLE t1; select isnull(date(NULL)), isnull(cast(NULL as DATE)); isnull(date(NULL)) isnull(cast(NULL as DATE)) @@ -363,7 +363,7 @@ cast('1.2' as decimal(3,2)) 1.20 select 1e18 * cast('1.2' as decimal(3,2)); 1e18 * cast('1.2' as decimal(3,2)) -1.2e+18 +1.2e18 select cast(cast('1.2' as decimal(3,2)) as signed); cast(cast('1.2' as decimal(3,2)) as signed) 1 diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index b36f561578b..6838dcf944c 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -61,7 +61,7 @@ grp sum NULL NULL 1 7 2 20.25 -3 45.4831632475944 +3 45.48316324759439 create table t2 (grp int, a bigint unsigned, c char(10)); insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp; replace into t2 select grp, a, c from t1 limit 2,1; @@ -891,7 +891,7 @@ select 1e8 * sum(distinct df) from t1; 330000000 select 1e8 * min(df) from t1; 1e8 * min(df) -110000000 +110000000.00000001 create table t3 (ifl int); insert into t3 values(1), (2); select cast(min(ifl) as decimal(5,2)) from t3; @@ -1186,7 +1186,7 @@ std(s1/s2) 0.21325764 select std(o1/o2) from bug22555; std(o1/o2) -0.213257635866493 +0.2132576358664934 select std(e1/e2) from bug22555; std(e1/e2) 0.21325764 @@ -1209,13 +1209,13 @@ i count(*) std(e1/e2) 3 4 0.000000000000000000000000000000 select round(std(s1/s2), 17) from bug22555; round(std(s1/s2), 17) -0.21325763586649341 +0.21325763586649340 select std(o1/o2) from bug22555; std(o1/o2) -0.213257635866493 +0.2132576358664934 select round(std(e1/e2), 17) from bug22555; round(std(e1/e2), 17) -0.21325763586649341 +0.21325763586649340 set div_precision_increment=20; select i, count(*), std(s1/s2) from bug22555 group by i order by i; i count(*) std(s1/s2) @@ -1234,13 +1234,13 @@ i count(*) std(e1/e2) 3 4 0.000000000000000000000000000000 select round(std(s1/s2), 17) from bug22555; round(std(s1/s2), 17) -0.21325763586649341 +0.21325763586649340 select std(o1/o2) from bug22555; std(o1/o2) -0.213257635866493 +0.2132576358664934 select round(std(e1/e2), 17) from bug22555; round(std(e1/e2), 17) -0.21325763586649341 +0.21325763586649340 set @@div_precision_increment=@saved_div_precision_increment; drop table bug22555; create table bug22555 (s smallint, o double, e decimal); diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 063f4d37f4a..537b1db9781 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -44,7 +44,7 @@ Warnings: Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2) -10 10 NULL NULL NULL 2 NULL NULL +10 10.000000000000002 NULL NULL NULL 2 NULL NULL explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -52,7 +52,7 @@ Warnings: Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) -10 10 NULL NULL NULL +10 10.000000000000002 NULL NULL NULL explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -60,7 +60,7 @@ Warnings: Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) -3 3.90689059560852 NULL NULL NULL +3 3.9068905956085187 NULL NULL NULL explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -68,7 +68,7 @@ Warnings: Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` select log10(100),log10(18),log10(-4),log10(0),log10(NULL); log10(100) log10(18) log10(-4) log10(0) log10(NULL) -2 1.25527250510331 NULL NULL NULL +2 1.255272505103306 NULL NULL NULL explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -85,7 +85,7 @@ Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4 set @@rand_seed1=10000000,@@rand_seed2=1000000; select rand(999999),rand(); rand(999999) rand() -0.0142313651873091 0.028870999839968 +0.014231365187309091 0.028870999839968048 explain extended select rand(999999),rand(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -101,7 +101,7 @@ Warnings: Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)` select degrees(pi()),radians(360); degrees(pi()) radians(360) -180 6.28318530717959 +180 6.283185307179586 select format(atan(-2, 2), 6); format(atan(-2, 2), 6) -0.785398 @@ -119,7 +119,7 @@ ACOS(1.0) 0 SELECT ASIN(1.0); ASIN(1.0) -1.5707963267949 +1.5707963267948966 SELECT ACOS(0.2*5.0); ACOS(0.2*5.0) 0 @@ -128,10 +128,10 @@ ACOS(0.5*2.0) 0 SELECT ASIN(0.8+0.2); ASIN(0.8+0.2) -1.5707963267949 +1.5707963267948966 SELECT ASIN(1.2-0.2); ASIN(1.2-0.2) -1.5707963267949 +1.5707963267948966 select format(4.55, 1), format(4.551, 1); format(4.55, 1) format(4.551, 1) 4.6 4.6 @@ -368,7 +368,7 @@ mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2) 5 5 1 select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5); pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5) -2.13598703592091e+96 2.13598703592091e+96 -32 +2.13598703592091e96 2.13598703592091e96 -32 CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1)); INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0); SELECT a DIV 900 y FROM t1 GROUP BY y; @@ -437,10 +437,10 @@ a ROUND(a) 2.5 2 -2.9 -3 2.9 3 --1e+16 -10000000000000000 -1e+16 10000000000000000 --1e+16 -10000000000000002 -1e+16 10000000000000002 +-1e16 -10000000000000000 +1e16 10000000000000000 +-1.0000000000000002e16 -10000000000000002 +1.0000000000000002e16 10000000000000002 DROP TABLE t1; CREATE TABLE t1(f1 LONGTEXT) engine=myisam; INSERT INTO t1 VALUES ('a'); @@ -475,16 +475,16 @@ NULL CREATE OR REPLACE VIEW v1 AS SELECT NULL AS a; SELECT RAND(a) FROM v1; RAND(a) -0.155220427694936 +0.15522042769493574 DROP VIEW v1; SELECT RAND(a) FROM (SELECT NULL AS a) b; RAND(a) -0.155220427694936 +0.15522042769493574 CREATE TABLE t1 (i INT); INSERT INTO t1 VALUES (NULL); SELECT RAND(i) FROM t1; RAND(i) -0.155220427694936 +0.15522042769493574 DROP TABLE t1; # select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 64988f9de50..3d43cbbfd76 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1354,10 +1354,10 @@ cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2)) 20.06 select conv("18383815659218730760",10,10) + 0; conv("18383815659218730760",10,10) + 0 -1.83838156592187e+19 +1.838381565921873e19 select "18383815659218730760" + 0; "18383815659218730760" + 0 -1.83838156592187e+19 +1.838381565921873e19 CREATE TABLE t1 (code varchar(10)); INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13'); SELECT ASCII(code), code FROM t1 WHERE code='A12'; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 3e28227d542..60e24819fa5 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -258,7 +258,7 @@ fid AsText(EndPoint(g)) 107 POINT(40 10) SELECT fid, GLength(g) FROM gis_line; fid GLength(g) -105 24.142135623731 +105 24.14213562373095 106 40 107 30 SELECT fid, NumPoints(g) FROM gis_line; @@ -284,7 +284,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.4166666666667 25.4166666666667) +109 POINT(25.416666666666668 25.416666666666668) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon; fid Area(g) @@ -318,8 +318,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; fid AsText(Centroid(g)) -117 POINT(55.5885277530424 17.426536064114) -118 POINT(55.5885277530424 17.426536064114) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon; fid Area(g) @@ -651,11 +651,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85998; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) -85998 MULTIPOLYGON 0 POINT(115.318773152032 -36.2374728210215) +85998 MULTIPOLYGON 0 POINT(115.31877315203187 -36.23747282102153) select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85984; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) -85984 MULTIPOLYGON 0 POINT(-114.877871869233 36.3310176346905) +85984 MULTIPOLYGON 0 POINT(-114.87787186923313 36.33101763469059) drop table t1; create table t1 (fl geometry not null); insert into t1 values (1); diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result index c6c775afc9f..0ce1ebe56ad 100644 --- a/mysql-test/r/innodb_gis.result +++ b/mysql-test/r/innodb_gis.result @@ -266,7 +266,7 @@ fid AsText(EndPoint(g)) 107 POINT(40 10) SELECT fid, GLength(g) FROM gis_line ORDER by fid; fid GLength(g) -105 24.142135623731 +105 24.14213562373095 106 40 107 30 SELECT fid, NumPoints(g) FROM gis_line ORDER by fid; @@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.4166666666667 25.4166666666667) +109 POINT(25.416666666666668 25.416666666666668) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon ORDER by fid; fid Area(g) @@ -326,8 +326,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; fid AsText(Centroid(g)) -117 POINT(55.5885277530424 17.426536064114) -118 POINT(55.5885277530424 17.426536064114) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; fid Area(g) diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 36d2b9ef348..b322c5da73a 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -175,12 +175,12 @@ Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 4 original_value 1e+1111111111a -f_double 1.79769313486232e+308 -f_float 3.40282e+38 +f_double 1.7976931348623157e308 +f_float 3.40282e38 f_double_7_2 99999.99 f_float_4_3 9.999 -f_double_u 1.79769313486232e+308 -f_float_u 3.40282e+38 +f_double_u 1.7976931348623157e308 +f_float_u 3.40282e38 f_double_15_1_u 99999999999999.9 f_float_3_1_u 99.9 set @value= "-1e+1111111111a"; @@ -204,8 +204,8 @@ Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 5 original_value -1e+1111111111a -f_double -1.79769313486232e+308 -f_float -3.40282e+38 +f_double -1.7976931348623157e308 +f_float -3.40282e38 f_double_7_2 -99999.99 f_float_4_3 -9.999 f_double_u 0 @@ -227,13 +227,13 @@ Warning 1264 Out of range value for column 'f_double_15_1_u' at row 1 Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 6 -original_value 1e+111 -f_double 1e+111 -f_float 3.40282e+38 +original_value 1e111 +f_double 1e111 +f_float 3.40282e38 f_double_7_2 99999.99 f_float_4_3 9.999 -f_double_u 1e+111 -f_float_u 3.40282e+38 +f_double_u 1e111 +f_float_u 3.40282e38 f_double_15_1_u 99999999999999.9 f_float_3_1_u 99.9 set @value= -1e+111; @@ -248,9 +248,9 @@ Warning 1264 Out of range value for column 'f_double_15_1_u' at row 1 Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 7 -original_value -1e+111 -f_double -1e+111 -f_float -3.40282e+38 +original_value -1e111 +f_double -1e111 +f_float -3.40282e38 f_double_7_2 -99999.99 f_float_4_3 -9.999 f_double_u 0 @@ -524,42 +524,36 @@ INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175); INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0); INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); -Warnings: -Warning 1265 Data truncated for column 'c' at row 1 INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); Warnings: Warning 1265 Data truncated for column 'c' at row 1 INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); -Warnings: -Warning 1265 Data truncated for column 'c' at row 1 INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); -Warnings: -Warning 1265 Data truncated for column 'c' at row 1 SELECT * FROM t1; a b c 9.999999 10 10 -1.225e-05 1.2e-05 1e-0 -0.0001225 0.00012 NULL +0.00001225 1.22e-5 1e-5 +0.0001225 1.22e-4 NULL 0.1225 0.1225 NULL 0.1225877 0.12259 NULL 12.25 12.25 NULL 12.25 12.25 12.2 122500 122500 NULL -12250000000 1.2e+10 NULL -1.225e+15 1.2e+15 NULL +12250000000 1.22e10 NULL +1.225e15 1.22e15 NULL 5000000 5000000 NULL -1.25e+78 1.2e+78 NULL +1.25e78 1.25e78 NULL 1.25e-94 1.2e-94 NULL -1.25e+203 1e+203 NULL +1.25e203 1.2e203 NULL 1.25e-175 1e-175 NULL 1.225 NULL 1.23 1.37 NULL 1.37 --1.37 NULL -1.3 -0.00187 NULL 0.00 --0.0187 NULL -0.0 +-1.37 NULL -1.4 +0.00187 NULL 2e-3 +-0.0187 NULL 0 5000 NULL 5000 --5000 NULL -500 +-5000 NULL -5e3 DROP TABLE t1; CREATE TABLE t1 ( a char(20) NOT NULL, @@ -586,32 +580,30 @@ INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); -Warnings: -Warning 1265 Data truncated for column 'c' at row 1 INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); SELECT * FROM t1; a b c 9.999999 10 9.999 -1.225e-05 1.2e-05 1e-05 -0.0001225 0.00012 NULL +0.00001225 1.22e-5 1e-5 +0.0001225 1.22e-4 NULL 0.1225 0.1225 NULL 0.1225877 0.12259 NULL 12.25 12.25 NULL 12.25 12.25 12.25 122500 122500 NULL -12250000000 1.2e+10 NULL -1.225e+15 1.2e+15 NULL +12250000000 1.22e10 NULL +1.225e15 1.22e15 NULL 5000000 5000000 NULL -1.25e+78 1.2e+78 NULL +1.25e78 1.25e78 NULL 1.25e-94 1.2e-94 NULL -1.25e+203 1e+203 NULL +1.25e203 1.2e203 NULL 1.25e-175 1e-175 NULL 1.225 NULL 1.225 1.37 NULL 1.37 -1.37 NULL -1.37 0.00187 NULL 0.002 --0.0187 NULL -0.01 +-0.0187 NULL -0.02 5000 NULL 5000 -5000 NULL -5000 DROP TABLE t1; diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 1e488b320d7..5e25132880f 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -251,15 +251,15 @@ CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE); INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100); SELECT * FROM t1; c1 c2 c3 c4 -10 1970-02-01 01:02:03 1.1e-100 1.1e+100 +10 1970-02-01 01:02:03 1.1e-100 1.1e100 SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1; --10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e+100- +-10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e100- EOF TRUNCATE t1; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-'; SELECT * FROM t1; c1 c2 c3 c4 -10 1970-02-01 01:02:03 1.1e-100 1.1e+100 +10 1970-02-01 01:02:03 1.1e-100 1.1e100 DROP TABLE t1; # -- diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 13d36fab2f1..4724a111837 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -55,7 +55,7 @@ CREATE TABLE `t1` ( `a` double DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (RES); +INSERT INTO `t1` VALUES (-1.7976931348623157e308); DROP TABLE t1; # # Bug#3361 mysqldump quotes DECIMAL values inconsistently diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 7e703de0876..467bb7c5cb8 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -522,7 +522,7 @@ select conv(255 AS p1, 10 AS p2, 16 AS p3); ERROR 42000: Incorrect parameters in the call to native function 'conv' select atan(10); atan(10) -1.47112767430373 +1.4711276743037347 select atan(10 AS p1); ERROR 42000: Incorrect parameters in the call to native function 'atan' select atan(10 p1); @@ -533,7 +533,7 @@ select atan(10 "p1"); ERROR 42000: Incorrect parameters in the call to native function 'atan' select atan(10, 20); atan(10, 20) -0.463647609000806 +0.4636476090008061 select atan(10 AS p1, 20); ERROR 42000: Incorrect parameters in the call to native function 'atan' select atan(10 p1, 20); diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index c51863b73f7..4f9444c1542 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -2585,10 +2585,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; @@ -2608,10 +2608,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; @@ -2631,10 +2631,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= '-9223372036854775808' ; @@ -2654,10 +2654,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= 1.11111111111111111111e+50 ; @@ -2679,10 +2679,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; @@ -2704,10 +2704,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; @@ -2729,10 +2729,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; set @arg00= '-1.11111111111111111111e+50' ; @@ -2754,10 +2754,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; test_sequence @@ -2822,10 +2822,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +54 5 54 54 54 54 54 54 54 54 54 54 +55 6 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL @@ -3039,7 +3039,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 2670451f24e..772a7462342 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -2568,10 +2568,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; @@ -2591,10 +2591,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; @@ -2614,10 +2614,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= '-9223372036854775808' ; @@ -2637,10 +2637,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= 1.11111111111111111111e+50 ; @@ -2662,10 +2662,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; @@ -2687,10 +2687,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; @@ -2712,10 +2712,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; set @arg00= '-1.11111111111111111111e+50' ; @@ -2737,10 +2737,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; test_sequence @@ -2805,10 +2805,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +54 5 54 54 54 54 54 54 54 54 54 54 +55 6 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL @@ -3022,7 +3022,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 4372c470b2d..84bf7a6fa00 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -2569,10 +2569,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; @@ -2592,10 +2592,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; @@ -2615,10 +2615,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= '-9223372036854775808' ; @@ -2638,10 +2638,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= 1.11111111111111111111e+50 ; @@ -2663,10 +2663,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; @@ -2688,10 +2688,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; @@ -2713,10 +2713,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; set @arg00= '-1.11111111111111111111e+50' ; @@ -2738,10 +2738,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; test_sequence @@ -2807,7 +2807,7 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 54 5 54 54 54 54 54 54 54 54 54 54 -55 5 55 55 55 55 55 55 55 55 55 55 +55 6 55 55 55 55 55 55 55 55 55 55 56 6 56 56 56 56 56 56 56 56 56 56 57 6 57 57 57 57 57 57 57 57 57 57 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL @@ -3023,7 +3023,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 35a43f7c032..61d2822fd5b 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -2505,10 +2505,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; @@ -2528,10 +2528,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; @@ -2551,10 +2551,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= '-9223372036854775808' ; @@ -2574,10 +2574,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= 1.11111111111111111111e+50 ; @@ -2599,10 +2599,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; @@ -2624,10 +2624,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; @@ -2649,10 +2649,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; set @arg00= '-1.11111111111111111111e+50' ; @@ -2674,10 +2674,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; test_sequence @@ -2742,10 +2742,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +54 5 54 54 54 54 54 54 54 54 54 54 +55 6 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL @@ -2959,7 +2959,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL @@ -5527,10 +5527,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; @@ -5550,10 +5550,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; @@ -5573,10 +5573,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= '-9223372036854775808' ; @@ -5596,10 +5596,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= 1.11111111111111111111e+50 ; @@ -5621,10 +5621,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; @@ -5646,10 +5646,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; @@ -5671,10 +5671,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; set @arg00= '-1.11111111111111111111e+50' ; @@ -5696,10 +5696,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; test_sequence @@ -5764,10 +5764,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +54 5 54 54 54 54 54 54 54 54 54 54 +55 6 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL @@ -5981,7 +5981,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index ff2dd49e725..41dd44fc4d0 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2784,26 +2784,26 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away select max(key1) from t1 where key1 <= 0.6158; max(key1) -0.615800023078918 +0.6158000230789185 select max(key2) from t2 where key2 <= 1.6158; max(key2) -1.61580002307892 +1.6158000230789185 select min(key1) from t1 where key1 >= 0.3762; min(key1) -0.376199990510941 +0.37619999051094055 select min(key2) from t2 where key2 >= 1.3762; min(key2) -1.37619996070862 +1.3761999607086182 select max(key1), min(key2) from t1, t2 where key1 <= 0.6158 and key2 >= 1.3762; max(key1) min(key2) -0.615800023078918 1.37619996070862 +0.6158000230789185 1.3761999607086182 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; max(key1) -0.615800023078918 +0.6158000230789185 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; min(key1) -0.376199990510941 +0.37619999051094055 DROP TABLE t1,t2; CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); INSERT INTO t1 VALUES (10); diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index ac118d0bab2..b4af25efc1b 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -579,7 +579,7 @@ return 2.7182818284590452354| set @e = e()| select e(), @e| e() @e -2.71828182845905 2.71828182845905 +2.718281828459045 2.718281828459045 drop function if exists inc| create function inc(i int) returns int return i+1| @@ -616,23 +616,23 @@ create function fun(d double, i int, u int unsigned) returns double return mul(inc(i), fac(u)) / e()| select fun(2.3, 3, 5)| fun(2.3, 3, 5) -176.582131762292 +176.58213176229233 insert into t2 values (append("xxx", "yyy"), mul(4,3), e())| insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))| select * from t2 where s = append("a", "b")| s i d -ab 24 1324.36598821719 +ab 24 1324.3659882171924 select * from t2 where i = mul(4,3) or i = mul(mul(3,4),2) order by i| s i d -xxxyyy 12 2.71828182845905 -ab 24 1324.36598821719 +xxxyyy 12 2.718281828459045 +ab 24 1324.3659882171924 select * from t2 where d = e()| s i d -xxxyyy 12 2.71828182845905 +xxxyyy 12 2.718281828459045 select * from t2 order by i| s i d -xxxyyy 12 2.71828182845905 -ab 24 1324.36598821719 +xxxyyy 12 2.718281828459045 +ab 24 1324.3659882171924 delete from t2| drop function e| drop function inc| @@ -5972,9 +5972,9 @@ CREATE TABLE t3 (f1 INT, f2 FLOAT)| INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| SUM(f2) bug25373(f1) -6.30000007152557 1 +6.300000071525574 1 15 2 -21.3000000715256 NULL +21.300000071525574 NULL DROP FUNCTION bug25373| DROP TABLE t3| DROP DATABASE IF EXISTS mysqltest1| diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 897c9072203..bdb7576f95e 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -873,14 +873,14 @@ Warning 1264 Out of range value for column 'col2' at row 1 SELECT * FROM t1; col1 col2 -1.1e-37 0 -3.4e+38 3.4e+38 +3.4e38 3.4e38 -1.1e-37 0 -3.4e+38 3.4e+38 +3.4e38 3.4e38 0 NULL 2 NULL NULL NULL -3.40282e+38 0 -3.40282e+38 0 +3.40282e38 0 +3.40282e38 0 DROP TABLE t1; CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED); INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308); @@ -922,14 +922,14 @@ SELECT * FROM t1; col1 col2 -2.2e-307 0 1e-303 0 -NULL 1.7e+308 +NULL 1.7e308 -2.2e-307 0 -2e-307 0 -NULL 1.7e+308 +NULL 1.7e308 0 NULL 2 NULL NULL NULL -1.79769313486232e+308 0 +1.7976931348623157e308 0 DROP TABLE t1; CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6)); INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello '); diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 67898b7f335..d131fa2b4d5 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -796,6 +796,18 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1; ROUND(qty,3) dps ROUND(qty,dps) 1.133 3 1.133000 DROP TABLE t1; +create table t1 (c1 decimal(10,6)); +insert into t1 (c1) values (9.99e-4); +insert into t1 (c1) values (9.98e-4); +insert into t1 (c1) values (0.000999); +insert into t1 (c1) values (cast(9.99e-4 as decimal(10,6))); +select * from t1; +c1 +0.000999 +0.000998 +0.000999 +0.000999 +drop table t1; SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%'; % 0.012345687012345687012345687012345687012345687012345687012345687012345687000000000 diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index a3a13bb0435..546e281ee67 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -2,9 +2,9 @@ drop table if exists t1,t2; SELECT 10,10.0,10.,.1e+2,100.0e-1; 10 10.0 10. .1e+2 100.0e-1 10 10.0 10 10 10 -SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; -6e-05 -6e-05 --6e-05 -6e-05+1.000000 -6e-05 -6e-05 6e-05 0.99994 +SELECT 6e-16, -6e-16, --6e-16, -6e-16+1.000000; +6e-16 -6e-16 --6e-16 -6e-16+1.000000 +6e-16 -6e-16 6e-16 0.9999999999999994 SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; 1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1 10 10 10 10 10 10 0.1 0.1 0.1 @@ -31,16 +31,16 @@ select * from t1; f1 f2 10 10 100000 100000 -1.23457e+09 1234567890 -1e+10 10000000000 -1e+15 1e+15 -1e+20 1e+20 -3.40282e+38 1e+50 -3.40282e+38 1e+150 +1234570000 1234567890 +10000000000 10000000000 +1e15 1e15 +1e20 1e20 +3.40282e38 1e50 +3.40282e38 1e150 -10 -10 -1e-05 1e-05 -1e-10 1e-10 -1e-15 1e-15 +0.00001 0.00001 +0.0000000001 0.0000000001 +0.000000000000001 0.000000000000001 1e-20 1e-20 0 1e-50 0 1e-150 @@ -87,7 +87,7 @@ col create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1; select * from t2; col1 col2 col3 col4 -140.36 121.00000 121 3.47850542618522e-07 +140.36 121.00000 121 0.00000034785054261852176 show create table t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -201,9 +201,9 @@ insert into t1 values (2e5),(2e6),(2e-4),(2e-5); select * from t1; c 200000 -2e+06 +2e6 0.0002 -2e-05 +2e-5 drop table t1; CREATE TABLE t1 ( reckey int unsigned NOT NULL, @@ -267,7 +267,7 @@ select 1e-308, 1.00000001e-300, 100000000e-300; 1e-308 1.00000001e-300 1e-292 select 10e307; 10e307 -1e+308 +1e308 create table t1(a int, b double(8, 2)); insert into t1 values (1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75), @@ -369,12 +369,12 @@ Warning 1264 Out of range value for column 'f1' at row 1 Warning 1264 Out of range value for column 'f1' at row 2 select f1 + 0e0 from t1; f1 + 0e0 -1e+199 --1e+199 -1e+200 --1e+200 -1e+200 --1e+200 +1e199 +-1e199 +1e200 +-1e200 +1e200 +-1e200 drop table t1; create table t1 (f1 float(30, 0)); insert into t1 values (1e29), (-1e29); @@ -385,12 +385,36 @@ Warning 1264 Out of range value for column 'f1' at row 1 Warning 1264 Out of range value for column 'f1' at row 2 select f1 + 0e0 from t1; f1 + 0e0 -1.00000001504747e+29 --1.00000001504747e+29 -1.00000001504747e+30 --1.00000001504747e+30 -1.00000001504747e+30 --1.00000001504747e+30 +1.0000000150474662e29 +-1.0000000150474662e29 +1.0000000150474662e30 +-1.0000000150474662e30 +1.0000000150474662e30 +-1.0000000150474662e30 +drop table t1; +create table t1 (c char(6)); +insert into t1 values (2e6),(2e-5); +select * from t1; +c +2e6 +2e-5 +drop table t1; +CREATE TABLE d1 (d DOUBLE); +INSERT INTO d1 VALUES (1.7976931348623157E+308); +SELECT * FROM d1; +d +1.7976931348623157e308 +INSERT INTO d1 VALUES (1.79769313486232e+308); +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +SELECT * FROM d1; +d +1.7976931348623157e308 +DROP TABLE d1; +create table t1 (a char(20)); +insert into t1 values (1.225e-05); +select a+0 from t1; +a+0 +0.00001225 drop table t1; create table t1(d double, u bigint unsigned); insert into t1(d) values (9.22337203685479e18), @@ -405,6 +429,6 @@ CREATE TABLE t1 (f1 DOUBLE); INSERT INTO t1 VALUES(-1.79769313486231e+308); SELECT f1 FROM t1; f1 --1.79769313486231e+308 +-1.79769313486231e308 DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 172b343e003..00526597a32 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -917,7 +917,7 @@ cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(30,15)) 0.000000000100000 select ln(14000) c1, convert(ln(14000),decimal(5,3)) c2, cast(ln(14000) as decimal(5,3)) c3; c1 c2 c3 -9.5468126085974 9.547 9.547 +9.546812608597396 9.547 9.547 select convert(ln(14000),decimal(2,3)) c1; ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column ''). select cast(ln(14000) as decimal(2,3)) c1; @@ -1141,17 +1141,17 @@ my_float my_double my_varchar 1.17549e-18 1.175494345e-18 1.175494345e-18 1.17549e-17 1.175494345e-17 1.175494345e-17 1.17549e-16 1.175494345e-16 1.175494345e-16 -1.17549e-15 1.175494345e-15 1.175494345e-15 -1.17549e-14 1.175494345e-14 1.175494345e-14 -1.17549e-13 1.175494345e-13 1.175494345e-13 -1.17549e-12 1.175494345e-12 1.175494345e-12 -1.17549e-11 1.175494345e-11 1.175494345e-11 -1.17549e-10 1.175494345e-10 1.175494345e-10 -1.17549e-09 1.175494345e-09 1.175494345e-9 -1.17549e-08 1.175494345e-08 1.175494345e-8 -1.17549e-07 1.175494345e-07 1.175494345e-7 -1.17549e-06 1.175494345e-06 1.175494345e-6 -1.17549e-05 1.175494345e-05 1.175494345e-5 +0.00000000000000117549 0.000000000000001175494345 1.175494345e-15 +0.0000000000000117549 0.00000000000001175494345 1.175494345e-14 +0.000000000000117549 0.0000000000001175494345 1.175494345e-13 +0.00000000000117549 0.000000000001175494345 1.175494345e-12 +0.0000000000117549 0.00000000001175494345 1.175494345e-11 +0.000000000117549 0.0000000001175494345 1.175494345e-10 +0.00000000117549 0.000000001175494345 1.175494345e-9 +0.0000000117549 0.00000001175494345 1.175494345e-8 +0.000000117549 0.0000001175494345 1.175494345e-7 +0.00000117549 0.000001175494345 1.175494345e-6 +0.0000117549 0.00001175494345 1.175494345e-5 0.000117549 0.0001175494345 1.175494345e-4 0.00117549 0.001175494345 1.175494345e-3 0.0117549 0.01175494345 1.175494345e-2 @@ -1175,21 +1175,21 @@ CAST(my_float AS DECIMAL(65,30)) my_float 0.000000000000000001175494374380 1.17549e-18 0.000000000000000011754943743802 1.17549e-17 0.000000000000000117549432474939 1.17549e-16 -0.000000000000001175494324749389 1.17549e-15 -0.000000000000011754943671010360 1.17549e-14 -0.000000000000117549429933840000 1.17549e-13 -0.000000000001175494380653563000 1.17549e-12 -0.000000000011754943372854760000 1.17549e-11 -0.000000000117549428524377200000 1.17549e-10 -0.000000001175494368510499000000 1.17549e-09 -0.000000011754943685104990000000 1.17549e-08 -0.000000117549433298336200000000 1.17549e-07 -0.000001175494389826781000000000 1.17549e-06 -0.000011754943443520460000000000 1.17549e-05 +0.000000000000001175494324749389 0.00000000000000117549 +0.000000000000011754943671010362 0.0000000000000117549 +0.000000000000117549429933840040 0.000000000000117549 +0.000000000001175494380653563400 0.00000000000117549 +0.000000000011754943372854765000 0.0000000000117549 +0.000000000117549428524377220000 0.000000000117549 +0.000000001175494368510499000000 0.00000000117549 +0.000000011754943685104990000000 0.0000000117549 +0.000000117549433298336230000000 0.000000117549 +0.000001175494389826781100000000 0.00000117549 +0.000011754943443520460000000000 0.0000117549 0.000117549432616215200000000000 0.000117549 -0.001175494398921728000000000000 0.00117549 -0.011754943057894710000000000000 0.0117549 -0.117549434304237400000000000000 0.117549 +0.001175494398921728100000000000 0.00117549 +0.011754943057894707000000000000 0.0117549 +0.117549434304237370000000000000 0.117549 SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1; CAST(my_double AS DECIMAL(65,30)) my_double 0.000000000000000000000000000000 1.175494345e-32 @@ -1209,17 +1209,17 @@ CAST(my_double AS DECIMAL(65,30)) my_double 0.000000000000000001175494345000 1.175494345e-18 0.000000000000000011754943450000 1.175494345e-17 0.000000000000000117549434500000 1.175494345e-16 -0.000000000000001175494345000000 1.175494345e-15 -0.000000000000011754943450000000 1.175494345e-14 -0.000000000000117549434500000000 1.175494345e-13 -0.000000000001175494345000000000 1.175494345e-12 -0.000000000011754943450000000000 1.175494345e-11 -0.000000000117549434500000000000 1.175494345e-10 -0.000000001175494345000000000000 1.175494345e-09 -0.000000011754943450000000000000 1.175494345e-08 -0.000000117549434500000000000000 1.175494345e-07 -0.000001175494345000000000000000 1.175494345e-06 -0.000011754943450000000000000000 1.175494345e-05 +0.000000000000001175494345000000 0.000000000000001175494345 +0.000000000000011754943450000000 0.00000000000001175494345 +0.000000000000117549434500000000 0.0000000000001175494345 +0.000000000001175494345000000000 0.000000000001175494345 +0.000000000011754943450000000000 0.00000000001175494345 +0.000000000117549434500000000000 0.0000000001175494345 +0.000000001175494345000000000000 0.000000001175494345 +0.000000011754943450000000000000 0.00000001175494345 +0.000000117549434500000000000000 0.0000001175494345 +0.000001175494345000000000000000 0.000001175494345 +0.000011754943450000000000000000 0.00001175494345 0.000117549434500000000000000000 0.0001175494345 0.001175494345000000000000000000 0.001175494345 0.011754943450000000000000000000 0.01175494345 @@ -1278,21 +1278,21 @@ my_decimal my_float 0.000000000000000001175494374380 1.17549e-18 0.000000000000000011754943743802 1.17549e-17 0.000000000000000117549432474939 1.17549e-16 -0.000000000000001175494324749389 1.17549e-15 -0.000000000000011754943671010360 1.17549e-14 -0.000000000000117549429933840000 1.17549e-13 -0.000000000001175494380653563000 1.17549e-12 -0.000000000011754943372854760000 1.17549e-11 -0.000000000117549428524377200000 1.17549e-10 -0.000000001175494368510499000000 1.17549e-09 -0.000000011754943685104990000000 1.17549e-08 -0.000000117549433298336200000000 1.17549e-07 -0.000001175494389826781000000000 1.17549e-06 -0.000011754943443520460000000000 1.17549e-05 +0.000000000000001175494324749389 0.00000000000000117549 +0.000000000000011754943671010362 0.0000000000000117549 +0.000000000000117549429933840040 0.000000000000117549 +0.000000000001175494380653563400 0.00000000000117549 +0.000000000011754943372854765000 0.0000000000117549 +0.000000000117549428524377220000 0.000000000117549 +0.000000001175494368510499000000 0.00000000117549 +0.000000011754943685104990000000 0.0000000117549 +0.000000117549433298336230000000 0.000000117549 +0.000001175494389826781100000000 0.00000117549 +0.000011754943443520460000000000 0.0000117549 0.000117549432616215200000000000 0.000117549 -0.001175494398921728000000000000 0.00117549 -0.011754943057894710000000000000 0.0117549 -0.117549434304237400000000000000 0.117549 +0.001175494398921728100000000000 0.00117549 +0.011754943057894707000000000000 0.0117549 +0.117549434304237370000000000000 0.117549 UPDATE t1 SET my_decimal = my_double; SELECT my_decimal, my_double FROM t1; my_decimal my_double @@ -1313,17 +1313,17 @@ my_decimal my_double 0.000000000000000001175494345000 1.175494345e-18 0.000000000000000011754943450000 1.175494345e-17 0.000000000000000117549434500000 1.175494345e-16 -0.000000000000001175494345000000 1.175494345e-15 -0.000000000000011754943450000000 1.175494345e-14 -0.000000000000117549434500000000 1.175494345e-13 -0.000000000001175494345000000000 1.175494345e-12 -0.000000000011754943450000000000 1.175494345e-11 -0.000000000117549434500000000000 1.175494345e-10 -0.000000001175494345000000000000 1.175494345e-09 -0.000000011754943450000000000000 1.175494345e-08 -0.000000117549434500000000000000 1.175494345e-07 -0.000001175494345000000000000000 1.175494345e-06 -0.000011754943450000000000000000 1.175494345e-05 +0.000000000000001175494345000000 0.000000000000001175494345 +0.000000000000011754943450000000 0.00000000000001175494345 +0.000000000000117549434500000000 0.0000000000001175494345 +0.000000000001175494345000000000 0.000000000001175494345 +0.000000000011754943450000000000 0.00000000001175494345 +0.000000000117549434500000000000 0.0000000001175494345 +0.000000001175494345000000000000 0.000000001175494345 +0.000000011754943450000000000000 0.00000001175494345 +0.000000117549434500000000000000 0.0000001175494345 +0.000001175494345000000000000000 0.000001175494345 +0.000011754943450000000000000000 0.00001175494345 0.000117549434500000000000000000 0.0001175494345 0.001175494345000000000000000000 0.001175494345 0.011754943450000000000000000000 0.01175494345 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index f98872d93b3..95e374cc384 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -57,7 +57,7 @@ select @`select`,@not_used; set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL; select @test_int,@test_double,@test_string,@test_string2,@select; @test_int @test_double @test_string @test_string2 @select -10 1e-10 abcdeghi abcdefghij NULL +10 0.0000000001 abcdeghi abcdefghij NULL set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello"; select @test_int,@test_double,@test_string,@test_string2; @test_int @test_double @test_string @test_string2 diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index b10c542f644..a54db7240a4 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2590,7 +2590,7 @@ CREATE VIEW v1 AS SELECT SQRT(a) my_sqrt FROM t1; SELECT my_sqrt FROM v1 ORDER BY my_sqrt; my_sqrt 1 -1.4142135623731 +1.4142135623730951 DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (id int PRIMARY KEY); diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data index 2df8080956ac091920355e6310cfd339511bc35c..267039d757ea887cdbf54ef2f81c05f3b906a662 100644 GIT binary patch delta 16 YcmdmUfoabLrVYgrjO#a-M4a#k07ZZY-T(jq delta 16 YcmdmUfoabLrVYgrj2kwWM4a#k07Zre-v9sr diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data index 2c6f93e93b605caee9da8b605800b99d1fa5a935..067fc6b716d8f856f105d430e38b0baa038a3091 100644 GIT binary patch delta 16 XcmbQz%si!;c>_-@_-@ #include -#ifdef HAVE_FCONVERT -#include -#endif // Maximum allowed exponent value for converting string to decimal #define MAX_EXPONENT 1024 @@ -50,7 +47,7 @@ template class List_iterator; uchar Field_null::null[1]={1}; const char field_separator=','; -#define DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE 320 +#define DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE FLOATING_POINT_BUFFER #define LONGLONG_TO_STRING_CONVERSION_BUFFER_SIZE 128 #define DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE 128 #define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \ @@ -2304,13 +2301,7 @@ int Field_decimal::store(double nr) char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; fyllchar = zerofill ? (char) '0' : (char) ' '; -#ifdef HAVE_SNPRINTF - buff[sizeof(buff)-1]=0; // Safety - snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr); - length= strlen(buff); -#else - length= my_sprintf(buff,(buff,"%.*f",dec,nr)); -#endif + length= my_fcvt(nr, dec, buff, NULL); if (length > field_length) { @@ -2723,17 +2714,6 @@ int Field_new_decimal::store(double nr) err= double2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, nr, &decimal_value); - /* - TODO: fix following when double2my_decimal when double2decimal - will return E_DEC_TRUNCATED always correctly - */ - if (!err) - { - double nr2; - my_decimal2double(E_DEC_FATAL_ERROR, &decimal_value, &nr2); - if (nr2 != nr) - err= E_DEC_TRUNCATED; - } if (err) { if (check_overflow(err)) @@ -4231,67 +4211,20 @@ String *Field_float::val_str(String *val_buffer, uint to_length=max(field_length,70); val_buffer->alloc(to_length); char *to=(char*) val_buffer->ptr(); + size_t len; if (dec >= NOT_FIXED_DEC) - { - sprintf(to,"%-*.*g",(int) field_length,FLT_DIG,nr); - to=strcend(to,' '); - *to=0; - } + len= my_gcvt(nr, MY_GCVT_ARG_FLOAT, to_length - 1, to, NULL); else { -#ifdef HAVE_FCONVERT - char buff[70],*pos=buff; - int decpt,sign,tmp_dec=dec; - - (void) sfconvert(&nr,tmp_dec,&decpt,&sign,buff); - if (sign) - { - *to++='-'; - } - if (decpt < 0) - { /* val_buffer is < 0 */ - *to++='0'; - if (!tmp_dec) - goto end; - *to++='.'; - if (-decpt > tmp_dec) - decpt= - (int) tmp_dec; - tmp_dec=(uint) ((int) tmp_dec+decpt); - while (decpt++ < 0) - *to++='0'; - } - else if (decpt == 0) - { - *to++= '0'; - if (!tmp_dec) - goto end; - *to++='.'; - } - else - { - while (decpt-- > 0) - *to++= *pos++; - if (!tmp_dec) - goto end; - *to++='.'; - } - while (tmp_dec--) - *to++= *pos++; -#else -#ifdef HAVE_SNPRINTF - to[to_length-1]=0; // Safety - snprintf(to,to_length-1,"%.*f",dec,nr); - to=strend(to); -#else - to+= my_sprintf(to,(to,"%.*f",dec,nr)); -#endif -#endif + /* + We are safe here because the buffer length is >= 70, and + fabs(float) < 10^39, dec < NOT_FIXED_DEC. So the resulting string + will be not longer than 69 chars + terminating '\0'. + */ + len= my_fcvt(nr, dec, to, NULL); } -#ifdef HAVE_FCONVERT - end: -#endif - val_buffer->length((uint) (to-val_buffer->ptr())); + val_buffer->length((uint) len); if (zerofill) prepend_zeros(val_buffer); return val_buffer; @@ -4479,8 +4412,12 @@ int Field_real::truncate(double *nr, double max_value) max_value*= log_10[order]; max_value-= 1.0 / log_10[dec]; - double tmp= rint((res - floor(res)) * log_10[dec]) / log_10[dec]; - res= floor(res) + tmp; + /* Check for infinity so we don't get NaN in calculations */ + if (!my_isinf(res)) + { + double tmp= rint((res - floor(res)) * log_10[dec]) / log_10[dec]; + res= floor(res) + tmp; + } } if (res < -max_value) @@ -4590,68 +4527,14 @@ String *Field_double::val_str(String *val_buffer, uint to_length=max(field_length, DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE); val_buffer->alloc(to_length); char *to=(char*) val_buffer->ptr(); + size_t len; if (dec >= NOT_FIXED_DEC) - { - sprintf(to,"%-*.*g",(int) field_length,DBL_DIG,nr); - to=strcend(to,' '); - } + len= my_gcvt(nr, MY_GCVT_ARG_DOUBLE, to_length - 1, to, NULL); else - { -#ifdef HAVE_FCONVERT - char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; - char *pos= buff; - int decpt,sign,tmp_dec=dec; + len= my_fcvt(nr, dec, to, NULL); - (void) fconvert(nr,tmp_dec,&decpt,&sign,buff); - if (sign) - { - *to++='-'; - } - if (decpt < 0) - { /* val_buffer is < 0 */ - *to++='0'; - if (!tmp_dec) - goto end; - *to++='.'; - if (-decpt > tmp_dec) - decpt= - (int) tmp_dec; - tmp_dec=(uint) ((int) tmp_dec+decpt); - while (decpt++ < 0) - *to++='0'; - } - else if (decpt == 0) - { - *to++= '0'; - if (!tmp_dec) - goto end; - *to++='.'; - } - else - { - while (decpt-- > 0) - *to++= *pos++; - if (!tmp_dec) - goto end; - *to++='.'; - } - while (tmp_dec--) - *to++= *pos++; -#else -#ifdef HAVE_SNPRINTF - to[to_length-1]=0; // Safety - snprintf(to,to_length-1,"%.*f",dec,nr); - to=strend(to); -#else - to+= my_sprintf(to,(to,"%.*f",dec,nr)); -#endif -#endif - } -#ifdef HAVE_FCONVERT - end: -#endif - - val_buffer->length((uint) (to-val_buffer->ptr())); + val_buffer->length((uint) len); if (zerofill) prepend_zeros(val_buffer); return val_buffer; @@ -6448,84 +6331,18 @@ int Field_str::store(double nr) { ASSERT_COLUMN_MARKED_FOR_WRITE; char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; - uint length; uint local_char_length= field_length / charset()->mbmaxlen; - double anr= fabs(nr); - bool fractional= (anr != floor(anr)); - int neg= (nr < 0.0) ? 1 : 0; - uint max_length; - int exp; - uint digits; - uint i; + size_t length; + my_bool error; - /* Calculate the exponent from the 'e'-format conversion */ - if (anr < 1.0 && anr > 0) + length= my_gcvt(nr, MY_GCVT_ARG_DOUBLE, local_char_length, buff, &error); + if (error) { - for (exp= 0; anr < 1e-100; exp-= 100, anr*= 1e100) ; - for (; anr < 1e-10; exp-= 10, anr*= 1e10) ; - for (i= 1; anr < 1 / log_10[i]; exp--, i++) ; - exp--; + if (table->in_use->abort_on_warning) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1); + else + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); } - else - { - for (exp= 0; anr > 1e100; exp+= 100, anr/= 1e100) ; - for (; anr > 1e10; exp+= 10, anr/= 1e10) ; - for (i= 1; anr > log_10[i]; exp++, i++) ; - } - - max_length= local_char_length - neg; - - /* - Since in sprintf("%g") precision means the number of significant digits, - calculate the maximum number of significant digits if the 'f'-format - would be used (+1 for decimal point if the number has a fractional part). - */ - digits= max(1, (int) max_length - fractional); - /* - If the exponent is negative, decrease digits by the number of leading zeros - after the decimal point that do not count as significant digits. - */ - if (exp < 0) - digits= max(1, (int) digits + exp); - /* - 'e'-format is used only if the exponent is less than -4 or greater than or - equal to the precision. In this case we need to adjust the number of - significant digits to take "e+NN" + decimal point into account (hence -5). - We also have to reserve one additional character if abs(exp) >= 100. - */ - if (exp >= (int) digits || exp < -4) - digits= max(1, (int) (max_length - 5 - (exp >= 100 || exp <= -100))); - - /* Limit precision to DBL_DIG to avoid garbage past significant digits */ - set_if_smaller(digits, DBL_DIG); - - length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr)); - -#ifdef __WIN__ - /* - Windows always zero-pads the exponent to 3 digits, we want to remove the - leading 0 to match the sprintf() output on other platforms. - */ - if ((exp >= (int) digits || exp < -4) && exp > -100 && exp < 100) - { - DBUG_ASSERT(length >= 6); /* 1e+NNN */ - uint tmp= length - 3; - buff[tmp]= buff[tmp + 1]; - tmp++; - buff[tmp]= buff[tmp + 1]; - length--; - } -#endif - - /* - +1 below is because "precision" in %g above means the - max. number of significant digits, not the output width. - Thus the width can be larger than number of significant digits by 1 - (for decimal point) - the test for local_char_length < 5 is for extreme cases, - like inserting 500.0 in char(1) - */ - DBUG_ASSERT(local_char_length < 5 || length <= local_char_length+1); return store(buff, length, charset()); } @@ -7601,7 +7418,7 @@ oom_error: int Field_blob::store(double nr) { CHARSET_INFO *cs=charset(); - value.set_real(nr, 2, cs); + value.set_real(nr, NOT_FIXED_DEC, cs); return Field_blob::store(value.ptr(),(uint) value.length(), cs); } diff --git a/sql/item.cc b/sql/item.cc index f4b2e549667..8416f53d77f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5259,9 +5259,7 @@ int Item_null::save_safe_in_field(Field *field) int Item::save_in_field(Field *field, bool no_conversions) { int error; - if (result_type() == STRING_RESULT || - (result_type() == REAL_RESULT && - field->result_type() == STRING_RESULT)) + if (result_type() == STRING_RESULT) { String *result; CHARSET_INFO *cs= collation.collation; @@ -5280,6 +5278,15 @@ int Item::save_in_field(Field *field, bool no_conversions) error=field->store(result->ptr(),result->length(),cs); str_value.set_quick(0, 0, cs); } + else if (result_type() == REAL_RESULT && + field->result_type() == STRING_RESULT) + { + double nr= val_real(); + if (null_value) + return set_field_to_null_with_conversions(field, no_conversions); + field->set_notnull(); + error= field->store(nr); + } else if (result_type() == REAL_RESULT) { double nr= val_real(); diff --git a/sql/log_event.cc b/sql/log_event.cc index 9cfa6cf1540..8985d396b3a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5355,11 +5355,11 @@ void User_var_log_event::pack_info(Protocol* protocol) case REAL_RESULT: double real_val; float8get(real_val, val); - if (!(buf= (char*) my_malloc(val_offset + FLOATING_POINT_BUFFER, + if (!(buf= (char*) my_malloc(val_offset + MY_GCVT_MAX_FIELD_WIDTH + 1, MYF(MY_WME)))) return; - event_len+= my_sprintf(buf + val_offset, - (buf + val_offset, "%.14g", real_val)); + event_len+= my_gcvt(real_val, MY_GCVT_ARG_DOUBLE, MY_GCVT_MAX_FIELD_WIDTH, + buf + val_offset, NULL); break; case INT_RESULT: if (!(buf= (char*) my_malloc(val_offset + 22, MYF(MY_WME)))) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3ddaf114673..d4cf1bd2c63 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1939,6 +1939,7 @@ extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file; extern char default_logfile_name[FN_REFLEN]; extern char log_error_file[FN_REFLEN], *opt_tc_log_file; +extern const double log_10[309]; extern ulonglong log_10_int[20]; extern ulonglong keybuff_size; extern ulonglong thd_startup_options; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 826e8a6c980..fe7f85f82d2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -212,7 +212,36 @@ inline void setup_fpu() /* Set FPU rounding mode to "round-to-nearest" */ fesetround(FE_TONEAREST); #endif /* HAVE_FESETROUND */ - + + /* + x86 (32-bit) requires FPU precision to be explicitly set to 64 bit for + portable results of floating point operations + */ +#if defined(__i386__) +#if defined(_WIN32) +#if !defined(_WIN64) + _control87(_PC_53, MCW_PC); +#endif /* !_WIN64 */ +#else /* !_WIN32 */ +#if !defined(HAVE_FPU_CONTROL_H) +#define fpu_control_t unsigned int +#define _FPU_EXTENDED 0x300 +#define _FPU_DOUBLE 0x200 +#if defined(__GNUC__) +#define _FPU_GETCW(cw) __asm__ __volatile__("fnstcw %0" : "=m" (*&cw)) +#define _FPU_SETCW(cw) __asm__ __volatile__("fldcw %0" : : "m" (*&cw)) +#else /* !__GNUC__ */ +#define _FPU_GETCW(cw) (cw= 0) +#define _FPU_SETCW(cw) +#endif /* __GNUC__ */ +#endif /* !HAVE_FPU_CONTROL_H */ + fpu_control_t cw; + _FPU_GETCW(cw); + cw= (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE; + _FPU_SETCW(cw); +#endif /* _WIN32 && */ +#endif /* __i386__ */ + #if defined(__sgi) && defined(HAVE_SYS_FPU_H) /* Enable denormalized DOUBLE values support for IRIX */ union fpc_csr n; @@ -575,6 +604,40 @@ ulong expire_logs_days = 0; ulong rpl_recovery_rank=0; const char *log_output_str= "FILE"; +const double log_10[] = { + 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009, + 1e010, 1e011, 1e012, 1e013, 1e014, 1e015, 1e016, 1e017, 1e018, 1e019, + 1e020, 1e021, 1e022, 1e023, 1e024, 1e025, 1e026, 1e027, 1e028, 1e029, + 1e030, 1e031, 1e032, 1e033, 1e034, 1e035, 1e036, 1e037, 1e038, 1e039, + 1e040, 1e041, 1e042, 1e043, 1e044, 1e045, 1e046, 1e047, 1e048, 1e049, + 1e050, 1e051, 1e052, 1e053, 1e054, 1e055, 1e056, 1e057, 1e058, 1e059, + 1e060, 1e061, 1e062, 1e063, 1e064, 1e065, 1e066, 1e067, 1e068, 1e069, + 1e070, 1e071, 1e072, 1e073, 1e074, 1e075, 1e076, 1e077, 1e078, 1e079, + 1e080, 1e081, 1e082, 1e083, 1e084, 1e085, 1e086, 1e087, 1e088, 1e089, + 1e090, 1e091, 1e092, 1e093, 1e094, 1e095, 1e096, 1e097, 1e098, 1e099, + 1e100, 1e101, 1e102, 1e103, 1e104, 1e105, 1e106, 1e107, 1e108, 1e109, + 1e110, 1e111, 1e112, 1e113, 1e114, 1e115, 1e116, 1e117, 1e118, 1e119, + 1e120, 1e121, 1e122, 1e123, 1e124, 1e125, 1e126, 1e127, 1e128, 1e129, + 1e130, 1e131, 1e132, 1e133, 1e134, 1e135, 1e136, 1e137, 1e138, 1e139, + 1e140, 1e141, 1e142, 1e143, 1e144, 1e145, 1e146, 1e147, 1e148, 1e149, + 1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159, + 1e160, 1e161, 1e162, 1e163, 1e164, 1e165, 1e166, 1e167, 1e168, 1e169, + 1e170, 1e171, 1e172, 1e173, 1e174, 1e175, 1e176, 1e177, 1e178, 1e179, + 1e180, 1e181, 1e182, 1e183, 1e184, 1e185, 1e186, 1e187, 1e188, 1e189, + 1e190, 1e191, 1e192, 1e193, 1e194, 1e195, 1e196, 1e197, 1e198, 1e199, + 1e200, 1e201, 1e202, 1e203, 1e204, 1e205, 1e206, 1e207, 1e208, 1e209, + 1e210, 1e211, 1e212, 1e213, 1e214, 1e215, 1e216, 1e217, 1e218, 1e219, + 1e220, 1e221, 1e222, 1e223, 1e224, 1e225, 1e226, 1e227, 1e228, 1e229, + 1e230, 1e231, 1e232, 1e233, 1e234, 1e235, 1e236, 1e237, 1e238, 1e239, + 1e240, 1e241, 1e242, 1e243, 1e244, 1e245, 1e246, 1e247, 1e248, 1e249, + 1e250, 1e251, 1e252, 1e253, 1e254, 1e255, 1e256, 1e257, 1e258, 1e259, + 1e260, 1e261, 1e262, 1e263, 1e264, 1e265, 1e266, 1e267, 1e268, 1e269, + 1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279, + 1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289, + 1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299, + 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308 +}; + time_t server_start_time, flush_status_time; char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30]; diff --git a/sql/spatial.cc b/sql/spatial.cc index 9114c81514d..671b8544b8a 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -17,28 +17,7 @@ #ifdef HAVE_SPATIAL -/* - exponential notation : - 1 sign - 1 number before the decimal point - 1 decimal point - 14 number of significant digits (see String::qs_append(double)) - 1 'e' sign - 1 exponent sign - 3 exponent digits - == - 22 - - "f" notation : - 1 optional 0 - 1 sign - 14 number significant digits (see String::qs_append(double) ) - 1 decimal point - == - 17 -*/ - -#define MAX_DIGITS_IN_DOUBLE 22 +#define MAX_DIGITS_IN_DOUBLE MY_GCVT_MAX_FIELD_WIDTH /***************************** Gis_class_info *******************************/ diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bf92717e79d..4774a91a9bf 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2166,7 +2166,8 @@ static bool show_status_array(THD *thd, const char *wild, value= ((char *) status_var + (ulong) value); /* fall through */ case SHOW_DOUBLE: - end= buff + my_sprintf(buff, (buff, "%f", *(double*) value)); + /* 6 is the default precision for '%f' in sprintf() */ + end= buff + my_fcvt(*(double *) value, 6, buff, NULL); break; case SHOW_LONG_STATUS: value= ((char *) status_var + (ulong) value); diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 40040ab0934..e4e51aba622 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -24,10 +24,6 @@ #include #include #include -#ifdef HAVE_FCONVERT -#include -#endif - /* The following extern declarations are ok as these are interface functions required by the string function @@ -107,82 +103,19 @@ bool String::set_int(longlong num, bool unsigned_flag, CHARSET_INFO *cs) bool String::set_real(double num,uint decimals, CHARSET_INFO *cs) { - char buff[331]; + char buff[FLOATING_POINT_BUFFER]; uint dummy_errors; + size_t len; str_charset=cs; if (decimals >= NOT_FIXED_DEC) { - uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME + len= my_gcvt(num, MY_GCVT_ARG_DOUBLE, sizeof(buff) - 1, buff, NULL); return copy(buff, len, &my_charset_latin1, cs, &dummy_errors); } -#ifdef HAVE_FCONVERT - int decpt,sign; - char *pos,*to; - - (void) fconvert(num,(int) decimals,&decpt,&sign,buff+1); - if (!my_isdigit(&my_charset_latin1, buff[1])) - { // Nan or Inf - pos=buff+1; - if (sign) - { - buff[0]='-'; - pos=buff; - } - uint dummy_errors; - return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs, &dummy_errors); - } - if (alloc((uint32) ((uint32) decpt+3+decimals))) - return TRUE; - to=Ptr; - if (sign) - *to++='-'; - - pos=buff+1; - if (decpt < 0) - { /* value is < 0 */ - *to++='0'; - if (!decimals) - goto end; - *to++='.'; - if ((uint32) -decpt > decimals) - decpt= - (int) decimals; - decimals=(uint32) ((int) decimals+decpt); - while (decpt++ < 0) - *to++='0'; - } - else if (decpt == 0) - { - *to++= '0'; - if (!decimals) - goto end; - *to++='.'; - } - else - { - while (decpt-- > 0) - *to++= *pos++; - if (!decimals) - goto end; - *to++='.'; - } - while (decimals--) - *to++= *pos++; - -end: - *to=0; - str_length=(uint32) (to-Ptr); - return FALSE; -#else -#ifdef HAVE_SNPRINTF - buff[sizeof(buff)-1]=0; // Safety - snprintf(buff,sizeof(buff)-1, "%.*f",(int) decimals,num); -#else - sprintf(buff,"%.*f",(int) decimals,num); -#endif - return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs, + len= my_fcvt(num, decimals, buff, NULL); + return copy(buff, (uint32) len, &my_charset_latin1, cs, &dummy_errors); -#endif } @@ -661,7 +594,8 @@ void String::qs_append(const char *str, uint32 len) void String::qs_append(double d) { char *buff = Ptr + str_length; - str_length+= my_sprintf(buff, (buff, "%.15g", d)); + str_length+= my_gcvt(d, MY_GCVT_ARG_DOUBLE, FLOATING_POINT_BUFFER - 1, buff, + NULL); } void String::qs_append(double *d) diff --git a/sql/unireg.h b/sql/unireg.h index 80c6ad23907..b6f81f48987 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -213,7 +213,6 @@ */ #define BIN_LOG_HEADER_SIZE 4 -#define FLOATING_POINT_BUFFER 331 #define DEFAULT_KEY_CACHE_NAME "default" diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 294a129fc1b..572ca076a41 100755 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -18,10 +18,10 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c - ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c + ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c r_strinstr.c str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c - strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c + strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c my_strchr.c strcont.c strinstr.c strnlen.c) IF(NOT SOURCE_SUBLIBS) diff --git a/strings/Makefile.am b/strings/Makefile.am index 4c34a923d81..8bfd1f27bca 100644 --- a/strings/Makefile.am +++ b/strings/Makefile.am @@ -30,19 +30,19 @@ pkglib_LIBRARIES = libmystrings.a # Exact one of ASSEMBLER_X if ASSEMBLER_x86 ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s -CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c +CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c dtoa.c else if ASSEMBLER_sparc32 # These file MUST all be on the same line!! Otherwise automake # generats a very broken makefile ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s -CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c +CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c else #no assembler ASRCS = # These file MUST all be on the same line!! Otherwise automake # generats a very broken makefile -CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c +CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c endif endif diff --git a/strings/decimal.c b/strings/decimal.c index 282e7cae8ab..42dc33e5ac6 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -137,12 +137,6 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={ 900000000, 990000000, 999000000, 999900000, 999990000, 999999000, 999999900, 999999990 }; -static double scaler10[]= { - 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90 -}; -static double scaler1[]= { - 1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9 -}; #ifdef HAVE_purify #define sanity(d) DBUG_ASSERT((d)->len > 0) @@ -947,33 +941,25 @@ fatal_error: to - result will be stored there RETURN VALUE - E_DEC_OK + E_DEC_OK/E_DEC_OVERFLOW/E_DEC_TRUNCATED */ int decimal2double(decimal_t *from, double *to) { - double result= 0.0; - int i, exp= 0; - dec1 *buf= from->buf; + char strbuf[FLOATING_POINT_BUFFER], *end; + int len= sizeof(strbuf); + int rc, error; - for (i= from->intg; i > 0; i-= DIG_PER_DEC1) - result= result * DIG_BASE + *buf++; - - for (i= from->frac; i > 0; i-= DIG_PER_DEC1) { - result= result * DIG_BASE + *buf++; - exp+= DIG_PER_DEC1; - } - - DBUG_PRINT("info", ("interm.: %f %d %f", result, exp, - scaler10[exp / 10] * scaler1[exp % 10])); - - result/= scaler10[exp / 10] * scaler1[exp % 10]; - - *to= from->sign ? -result : result; + rc = decimal2string(from, strbuf, &len, 0, 0, 0); + end= strbuf + len; + + DBUG_PRINT("info", ("interm.: %s", strbuf)); + *to= my_strtod(strbuf, &end, &error); + DBUG_PRINT("info", ("result: %f (%lx)", *to, *(ulong *)to)); - return E_DEC_OK; + return (rc != E_DEC_OK) ? rc : (error ? E_DEC_OVERFLOW : E_DEC_OK); } /* @@ -990,13 +976,10 @@ int decimal2double(decimal_t *from, double *to) int double2decimal(double from, decimal_t *to) { - /* TODO: fix it, when we'll have dtoa */ - char buff[400], *end; - int length, res; + char buff[FLOATING_POINT_BUFFER], *end; + int res; DBUG_ENTER("double2decimal"); - length= my_sprintf(buff, (buff, "%.16G", from)); - DBUG_PRINT("info",("from: %g from_as_str: %s", from, buff)); - end= buff+length; + end= buff + my_gcvt(from, MY_GCVT_ARG_DOUBLE, sizeof(buff) - 1, buff, NULL); res= string2decimal(buff, to, &end); DBUG_PRINT("exit", ("res: %d", res)); DBUG_RETURN(res); diff --git a/strings/dtoa.c b/strings/dtoa.c new file mode 100644 index 00000000000..88e0d9272a8 --- /dev/null +++ b/strings/dtoa.c @@ -0,0 +1,2780 @@ +/* Copyright (C) 2007 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library 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 file incorporates work covered by the following copyright and + permission notice: + + The author of this software is David M. Gay. + + Copyright (c) 1991, 2000, 2001 by Lucent Technologies. + + Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + + ***************************************************************/ + +#include /* for EOVERFLOW on Windows */ +#include +#include /* for memcpy and NOT_FIXED_DEC */ + +/** + Appears to suffice to not call malloc() in most cases. + @todo + see if it is possible to get rid of malloc(). + this constant is sufficient to avoid malloc() on all inputs I have tried. +*/ +#define DTOA_BUFF_SIZE (420 * sizeof(void *)) + +/* Magic value returned by dtoa() to indicate overflow */ +#define DTOA_OVERFLOW 9999 + +static double my_strtod_int(const char *, char **, int *, char *, size_t); +static char *dtoa(double, int, int, int *, int *, char **, char *, size_t); +static void dtoa_free(char *, char *, size_t); + +/** + @brief + Converts a given floating point number to a zero-terminated string + representation using the 'f' format. + + @details + This function is a wrapper around dtoa() to do the same as + sprintf(to, "%-.*f", precision, x), though the conversion is usually more + precise. The only difference is in handling [-,+]infinity and nan values, + in which case we print '0\0' to the output string and indicate an overflow. + + @param x the input floating point number. + @param precision the number of digits after the decimal point. + All properties of sprintf() apply: + - if the number of significant digits after the decimal + point is less than precision, the resulting string is + right-padded with zeros + - if the precision is 0, no decimal point appears + - if a decimal point appears, at least one digit appears + before it + @param to pointer to the output buffer. The longest string which + my_fcvt() can return is FLOATING_POINT_BUFFER bytes + (including the terminating '\0'). + @param error if not NULL, points to a location where the status of + conversion is stored upon return. + FALSE successful conversion + TRUE the input number is [-,+]infinity or nan. + The output string in this case is always '0'. + @return number of written characters (excluding terminating '\0') +*/ + +size_t my_fcvt(double x, int precision, char *to, my_bool *error) +{ + int decpt, sign, len, i; + char *res, *src, *end, *dst= to; + char buf[DTOA_BUFF_SIZE]; + DBUG_ASSERT(precision >= 0 && precision < NOT_FIXED_DEC && to != NULL); + + res= dtoa(x, 5, precision, &decpt, &sign, &end, buf, sizeof(buf)); + + if (decpt == DTOA_OVERFLOW) + { + dtoa_free(res, buf, sizeof(buf)); + *to++= '0'; + *to= '\0'; + if (error != NULL) + *error= TRUE; + return 1; + } + + src= res; + len= end - src; + + if (sign) + *dst++= '-'; + + if (decpt <= 0) + { + *dst++= '0'; + *dst++= '.'; + for (i= decpt; i < 0; i++) + *dst++= '0'; + } + + for (i= 1; i <= len; i++) + { + *dst++= *src++; + if (i == decpt && i < len) + *dst++= '.'; + } + while (i++ <= decpt) + *dst++= '0'; + + if (precision > 0) + { + if (len <= decpt) + *dst++= '.'; + + for (i= precision - max(0, (len - decpt)); i > 0; i--) + *dst++= '0'; + } + + *dst= '\0'; + if (error != NULL) + *error= FALSE; + + dtoa_free(res, buf, sizeof(buf)); + + return dst - to; +} + +/** + @brief + Converts a given floating point number to a zero-terminated string + representation with a given field width using the 'e' format + (aka scientific notation) or the 'f' one. + + @details + The format is chosen automatically to provide the most number of significant + digits (and thus, precision) with a given field width. In many cases, the + result is similar to that of sprintf(to, "%g", x) with a few notable + differences: + - the conversion is usually more precise than C library functions. + - there is no 'precision' argument. instead, we specify the number of + characters available for conversion (i.e. a field width). + - the result never exceeds the specified field width. If the field is too + short to contain even a rounded decimal representation, my_gcvt() + indicates overflow and truncates the output string to the specified width. + - float-type arguments are handled differently than double ones. For a + float input number (i.e. when the 'type' argument is MY_GCVT_ARG_FLOAT) + we deliberately limit the precision of conversion by FLT_DIG digits to + avoid garbage past the significant digits. + - unlike sprintf(), in cases where the 'e' format is preferred, we don't + zero-pad the exponent to save space for significant digits. The '+' sign + for a positive exponent does not appear for the same reason. + + @param x the input floating point number. + @param type is either MY_GCVT_ARG_FLOAT or MY_GCVT_ARG_DOUBLE. + Specifies the type of the input number (see notes above). + @param width field width in characters. The minimal field width to + hold any number representation (albeit rounded) is 7 + characters ("-Ne-NNN"). + @param to pointer to the output buffer. The result is always + zero-terminated, and the longest returned string is thus + 'width + 1' bytes. + @param error if not NULL, points to a location where the status of + conversion is stored upon return. + FALSE successful conversion + TRUE the input number is [-,+]infinity or nan. + The output string in this case is always '0'. + @return number of written characters (excluding terminating '\0') + + @todo + Check if it is possible and makes sense to do our own rounding on top of + dtoa() instead of calling dtoa() twice in (rare) cases when the resulting + string representation does not fit in the specified field width and we want + to re-round the input number with fewer significant digits. Examples: + + my_gcvt(-9e-3, ..., 4, ...); + my_gcvt(-9e-3, ..., 2, ...); + my_gcvt(1.87e-3, ..., 4, ...); + my_gcvt(55, ..., 1, ...); + + We do our best to minimize such cases by: + + - passing to dtoa() the field width as the number of significant digits + + - removing the sign of the number early (and decreasing the width before + passing it to dtoa()) + + - choosing the proper format to preserve the most number of significant + digits. +*/ + +size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, + my_bool *error) +{ + int decpt, sign, len, exp_len; + char *res, *src, *end, *dst= to, *dend= dst + width; + char buf[DTOA_BUFF_SIZE]; + my_bool have_space, force_e_format; + DBUG_ASSERT(width > 0 && to != NULL); + + /* We want to remove '-' from equations early */ + if (x < 0.) + width--; + + res= dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? width : min(width, FLT_DIG), + &decpt, &sign, &end, buf, sizeof(buf)); + if (decpt == DTOA_OVERFLOW) + { + dtoa_free(res, buf, sizeof(buf)); + *to++= '0'; + *to= '\0'; + if (error != NULL) + *error= TRUE; + return 1; + } + + if (error != NULL) + *error= FALSE; + + src= res; + len= end - res; + + /* + Number of digits in the exponent from the 'e' conversion. + The sign of the exponent is taken into account separetely, we don't need + to count it here. + */ + exp_len= 1 + (decpt >= 101 || decpt <= -99) + (decpt >= 11 || decpt <= -9); + + /* + Do we have enough space for all digits in the 'f' format? + Let 'len' be the number of significant digits returned by dtoa, + and F be the length of the resulting decimal representation. + Consider the following cases: + 1. decpt <= 0, i.e. we have "0.NNN" => F = len - decpt + 2 + 2. 0 < decpt < len, i.e. we have "NNN.NNN" => F = len + 1 + 3. len <= decpt, i.e. we have "NNN00" => F = decpt + */ + have_space= (decpt <= 0 ? len - decpt + 2 : + decpt > 0 && decpt < len ? len + 1 : + decpt) <= width; + /* + The following is true when no significant digits can be placed with the + specified field width using the 'f' format, and the 'e' format + will not be truncated. + */ + force_e_format= (decpt <= 0 && width <= 2 - decpt && width >= 3 + exp_len); + /* + Assume that we don't have enough space to place all significant digits in + the 'f' format. We have to choose between the 'e' format and the 'f' one + to keep as many significant digits as possible. + Let E and F be the lengths of decimal representaion in the 'e' and 'f' + formats, respectively. We want to use the 'f' format if, and only if F <= E. + Consider the following cases: + 1. decpt <= 0. + F = len - decpt + 2 (see above) + E = len + (len > 1) + 1 + 1 (decpt <= -99) + (decpt <= -9) + 1 + ("N.NNe-MMM") + (F <= E) <=> (len == 1 && decpt >= -1) || (len > 1 && decpt >= -2) + We also need to ensure that if the 'f' format is chosen, + the field width allows us to place at least one significant digit + (i.e. width > 2 - decpt). If not, we prefer the 'e' format. + 2. 0 < decpt < len + F = len + 1 (see above) + E = len + 1 + 1 + ... ("N.NNeMMM") + F is always less than E. + 3. len <= decpt <= width + In this case we have enough space to represent the number in the 'f' + format, so we prefer it with some exceptions. + 4. width < decpt + The number cannot be represented in the 'f' format at all, always use + the 'e' 'one. + */ + if ((have_space || + /* + Not enough space, let's see if the 'f' format provides the most number + of significant digits. + */ + ((decpt <= width && (decpt >= -1 || (decpt == -2 && + (len > 1 || !force_e_format)))) && + !force_e_format)) && + + /* + Use the 'e' format in some cases even if we have enough space for the + 'f' one. See comment for MAX_DECPT_FOR_F_FORMAT. + */ + (!have_space || (decpt >= -MAX_DECPT_FOR_F_FORMAT + 1 && + (decpt <= MAX_DECPT_FOR_F_FORMAT || len > decpt)))) + { + /* 'f' format */ + int i; + + width-= (decpt < len) + (decpt <= 0 ? 1 - decpt : 0); + + /* Do we have to truncate any digits? */ + if (width < len) + { + if (width < decpt) + { + if (error != NULL) + *error= TRUE; + width= decpt; + } + + /* + We want to truncate (len - width) least significant digits after the + decimal point. For this we are calling dtoa with mode=5, passing the + number of significant digits = (len-decpt) - (len-width) = width-decpt + */ + dtoa_free(res, buf, sizeof(buf)); + res= dtoa(x, 5, width - decpt, &decpt, &sign, &end, buf, sizeof(buf)); + src= res; + len= end - res; + } + + if (len == 0) + { + /* Underflow. Just print '0' and exit */ + *dst++= '0'; + goto end; + } + + /* + At this point we are sure we have enough space to put all digits + returned by dtoa + */ + if (sign && dst < dend) + *dst++= '-'; + if (decpt <= 0) + { + if (dst < dend) + *dst++= '0'; + if (len > 0 && dst < dend) + *dst++= '.'; + for (; decpt < 0 && dst < dend; decpt++) + *dst++= '0'; + } + + for (i= 1; i <= len && dst < dend; i++) + { + *dst++= *src++; + if (i == decpt && i < len && dst < dend) + *dst++= '.'; + } + while (i++ <= decpt && dst < dend) + *dst++= '0'; + } + else + { + /* 'e' format */ + int decpt_sign= 0; + + if (--decpt < 0) + { + decpt= -decpt; + width--; + decpt_sign= 1; + } + width-= 1 + exp_len; /* eNNN */ + + if (len > 1) + width--; + + if (width <= 0) + { + /* Overflow */ + if (error != NULL) + *error= TRUE; + width= 0; + } + + /* Do we have to truncate any digits? */ + if (width < len) + { + /* Yes, re-convert with a smaller width */ + dtoa_free(res, buf, sizeof(buf)); + res= dtoa(x, 4, width, &decpt, &sign, &end, buf, sizeof(buf)); + src= res; + len= end - res; + if (--decpt < 0) + decpt= -decpt; + } + /* + At this point we are sure we have enough space to put all digits + returned by dtoa + */ + if (sign && dst < dend) + *dst++= '-'; + if (dst < dend) + *dst++= *src++; + if (len > 1 && dst < dend) + { + *dst++= '.'; + while (src < end && dst < dend) + *dst++= *src++; + } + if (dst < dend) + *dst++= 'e'; + if (decpt_sign && dst < dend) + *dst++= '-'; + + if (decpt >= 100 && dst < dend) + { + *dst++= decpt / 100 + '0'; + decpt%= 100; + if (dst < dend) + *dst++= decpt / 10 + '0'; + } + else if (decpt >= 10 && dst < dend) + *dst++= decpt / 10 + '0'; + if (dst < dend) + *dst++= decpt % 10 + '0'; + + } + +end: + dtoa_free(res, buf, sizeof(buf)); + *dst= '\0'; + + return dst - to; +} + +/** + @brief + Converts string to double (string does not have to be zero-terminated) + + @details + This is a wrapper around dtoa's version of strtod(). + + @param str input string + @param end address of a pointer to the first character after the input + string. Upon return the pointer is set to point to the first + rejected character. + @param error Upon return is set to EOVERFLOW in case of underflow or + overflow. + + @return The resulting double value. In case of underflow, 0.0 is + returned. In case overflow, signed DBL_MAX is returned. +*/ + +double my_strtod(const char *str, char **end, int *error) +{ + char buf[DTOA_BUFF_SIZE]; + double res; + DBUG_ASSERT(str != NULL && end != NULL && *end != NULL && error != NULL); + + res= my_strtod_int(str, end, error, buf, sizeof(buf)); + return (*error == 0) ? res : (res < 0 ? -DBL_MAX : DBL_MAX); +} + + +double my_atof(const char *nptr) +{ + int error; + const char *end= nptr+65535; /* Should be enough */ + return (my_strtod(nptr, (char**) &end, &error)); +} + + +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +/* + Original copy of the software is located at http://www.netlib.org/fp/dtoa.c + It was adjusted to serve MySQL server needs: + * strtod() was modified to not expect a zero-terminated string. + It now honors 'se' (end of string) argument as the input parameter, + not just as the output one. + * in dtoa(), in case of overflow/underflow/NaN result string now contains "0"; + decpt is set to DTOA_OVERFLOW to indicate overflow. + * support for VAX, IBM mainframe and 16-bit hardware removed + * we always assume that 64-bit integer type is available + * support for Kernigan-Ritchie style headers (pre-ANSI compilers) + removed + * all gcc warnings ironed out + * we always assume multithreaded environment, so we had to change + memory allocation procedures to use stack in most cases; + malloc is used as the last resort. + * pow5mult rewritten to use pre-calculated pow5 list instead of + the one generated on the fly. +*/ + + +/* + On a machine with IEEE extended-precision registers, it is + necessary to specify double-precision (53-bit) rounding precision + before invoking strtod or dtoa. If the machine uses (the equivalent + of) Intel 80x87 arithmetic, the call + _control87(PC_53, MCW_PC); + does this with many compilers. Whether this or another call is + appropriate depends on the compiler; for this to work, it may be + necessary to #include "float.h" or another system-dependent header + file. +*/ + +/* + #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 + and dtoa should round accordingly. + #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 + and Honor_FLT_ROUNDS is not #defined. + + TODO: check if we can get rid of the above two +*/ + +typedef int32 Long; +typedef uint32 ULong; +typedef int64 LLong; +typedef uint64 ULLong; + +typedef union { double d; ULong L[2]; } U; + +#if defined(WORDS_BIGENDIAN) || (defined(__FLOAT_WORD_ORDER) && \ + (__FLOAT_WORD_ORDER == __BIG_ENDIAN)) +#define word0(x) ((U*)&x)->L[0] +#define word1(x) ((U*)&x)->L[1] +#else +#define word0(x) ((U*)&x)->L[1] +#define word1(x) ((U*)&x)->L[0] +#endif + +#define dval(x) ((U*)&x)->d + +/* #define P DBL_MANT_DIG */ +/* Ten_pmax= floor(P*log(2)/log(5)) */ +/* Bletch= (highest power of 2 < DBL_MAX_10_EXP) / 16 */ +/* Quick_max= floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ +/* Int_max= floor(P*log(FLT_RADIX)/log(10) - 1) */ + +#define Exp_shift 20 +#define Exp_shift1 20 +#define Exp_msk1 0x100000 +#define Exp_mask 0x7ff00000 +#define P 53 +#define Bias 1023 +#define Emin (-1022) +#define Exp_1 0x3ff00000 +#define Exp_11 0x3ff00000 +#define Ebits 11 +#define Frac_mask 0xfffff +#define Frac_mask1 0xfffff +#define Ten_pmax 22 +#define Bletch 0x10 +#define Bndry_mask 0xfffff +#define Bndry_mask1 0xfffff +#define LSB 1 +#define Sign_bit 0x80000000 +#define Log2P 1 +#define Tiny1 1 +#define Quick_max 14 +#define Int_max 14 + +#ifndef Flt_Rounds +#ifdef FLT_ROUNDS +#define Flt_Rounds FLT_ROUNDS +#else +#define Flt_Rounds 1 +#endif +#endif /*Flt_Rounds*/ + +#ifdef Honor_FLT_ROUNDS +#define Rounding rounding +#undef Check_FLT_ROUNDS +#define Check_FLT_ROUNDS +#else +#define Rounding Flt_Rounds +#endif + +#define rounded_product(a,b) a*= b +#define rounded_quotient(a,b) a/= b + +#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) +#define Big1 0xffffffff +#define FFFFFFFF 0xffffffffUL + +/* This is tested to be enough for dtoa */ + +#define Kmax 15 + +#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ + 2*sizeof(int) + y->wds*sizeof(ULong)) + +/* Arbitrary-length integer */ + +typedef struct Bigint +{ + union { + ULong *x; /* points right after this Bigint object */ + struct Bigint *next; /* to maintain free lists */ + } p; + int k; /* 2^k = maxwds */ + int maxwds; /* maximum length in 32-bit words */ + int sign; /* not zero if number is negative */ + int wds; /* current length in 32-bit words */ +} Bigint; + + +/* A simple stack-memory based allocator for Bigints */ + +typedef struct Stack_alloc +{ + char *begin; + char *free; + char *end; + /* + Having list of free blocks lets us reduce maximum required amount + of memory from ~4000 bytes to < 1680 (tested on x86). + */ + Bigint *freelist[Kmax+1]; +} Stack_alloc; + + +/* + Try to allocate object on stack, and resort to malloc if all + stack memory is used. Ensure allocated objects to be aligned by the pointer + size in order to not break the alignment rules when storing a pointer to a + Bigint. +*/ + +static Bigint *Balloc(int k, Stack_alloc *alloc) +{ + Bigint *rv; + if (k <= Kmax && alloc->freelist[k]) + { + rv= alloc->freelist[k]; + alloc->freelist[k]= rv->p.next; + } + else + { + int x, len; + + x= 1 << k; + len= MY_ALIGN(sizeof(Bigint) + x * sizeof(ULong), SIZEOF_CHARP); + + if (alloc->free + len <= alloc->end) + { + rv= (Bigint*) alloc->free; + alloc->free+= len; + } + else + rv= (Bigint*) malloc(len); + + rv->k= k; + rv->maxwds= x; + } + rv->sign= rv->wds= 0; + rv->p.x= (ULong*) (rv + 1); + return rv; +} + + +/* + If object was allocated on stack, try putting it to the free + list. Otherwise call free(). +*/ + +static void Bfree(Bigint *v, Stack_alloc *alloc) +{ + char *gptr= (char*) v; /* generic pointer */ + if (gptr < alloc->begin || gptr >= alloc->end) + free(gptr); + else if (v->k <= Kmax) + { + /* + Maintain free lists only for stack objects: this way we don't + have to bother with freeing lists in the end of dtoa; + heap should not be used normally anyway. + */ + v->p.next= alloc->freelist[v->k]; + alloc->freelist[v->k]= v; + } +} + + +/* + This is to place return value of dtoa in: tries to use stack + as well, but passes by free lists management and just aligns len by + the pointer size in order to not break the alignment rules when storing a + pointer to a Bigint. +*/ + +static char *dtoa_alloc(int i, Stack_alloc *alloc) +{ + char *rv; + int aligned_size= MY_ALIGN(i, SIZEOF_CHARP); + if (alloc->free + aligned_size <= alloc->end) + { + rv= alloc->free; + alloc->free+= aligned_size; + } + else + rv= malloc(i); + return rv; +} + + +/* + dtoa_free() must be used to free values s returned by dtoa() + This is the counterpart of dtoa_alloc() +*/ + +static void dtoa_free(char *gptr, char *buf, size_t buf_size) +{ + if (gptr < buf || gptr >= buf + buf_size) + free(gptr); +} + + +/* Bigint arithmetic functions */ + +/* Multiply by m and add a */ + +static Bigint *multadd(Bigint *b, int m, int a, Stack_alloc *alloc) +{ + int i, wds; + ULong *x; + ULLong carry, y; + Bigint *b1; + + wds= b->wds; + x= b->p.x; + i= 0; + carry= a; + do + { + y= *x * (ULLong)m + carry; + carry= y >> 32; + *x++= (ULong)(y & FFFFFFFF); + } + while (++i < wds); + if (carry) + { + if (wds >= b->maxwds) + { + b1= Balloc(b->k+1, alloc); + Bcopy(b1, b); + Bfree(b, alloc); + b= b1; + } + b->p.x[wds++]= (ULong) carry; + b->wds= wds; + } + return b; +} + + +static Bigint *s2b(const char *s, int nd0, int nd, ULong y9, Stack_alloc *alloc) +{ + Bigint *b; + int i, k; + Long x, y; + + x= (nd + 8) / 9; + for (k= 0, y= 1; x > y; y <<= 1, k++) ; + b= Balloc(k, alloc); + b->p.x[0]= y9; + b->wds= 1; + + i= 9; + if (9 < nd0) + { + s+= 9; + do + b= multadd(b, 10, *s++ - '0', alloc); + while (++i < nd0); + s++; + } + else + s+= 10; + for(; i < nd; i++) + b= multadd(b, 10, *s++ - '0', alloc); + return b; +} + + +static int hi0bits(register ULong x) +{ + register int k= 0; + + if (!(x & 0xffff0000)) + { + k= 16; + x<<= 16; + } + if (!(x & 0xff000000)) + { + k+= 8; + x<<= 8; + } + if (!(x & 0xf0000000)) + { + k+= 4; + x<<= 4; + } + if (!(x & 0xc0000000)) + { + k+= 2; + x<<= 2; + } + if (!(x & 0x80000000)) + { + k++; + if (!(x & 0x40000000)) + return 32; + } + return k; +} + + +static int lo0bits(ULong *y) +{ + register int k; + register ULong x= *y; + + if (x & 7) + { + if (x & 1) + return 0; + if (x & 2) + { + *y= x >> 1; + return 1; + } + *y= x >> 2; + return 2; + } + k= 0; + if (!(x & 0xffff)) + { + k= 16; + x>>= 16; + } + if (!(x & 0xff)) + { + k+= 8; + x>>= 8; + } + if (!(x & 0xf)) + { + k+= 4; + x>>= 4; + } + if (!(x & 0x3)) + { + k+= 2; + x>>= 2; + } + if (!(x & 1)) + { + k++; + x>>= 1; + if (!x) + return 32; + } + *y= x; + return k; +} + + +/* Convert integer to Bigint number */ + +static Bigint *i2b(int i, Stack_alloc *alloc) +{ + Bigint *b; + + b= Balloc(1, alloc); + b->p.x[0]= i; + b->wds= 1; + return b; +} + + +/* Multiply two Bigint numbers */ + +static Bigint *mult(Bigint *a, Bigint *b, Stack_alloc *alloc) +{ + Bigint *c; + int k, wa, wb, wc; + ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; + ULong y; + ULLong carry, z; + + if (a->wds < b->wds) + { + c= a; + a= b; + b= c; + } + k= a->k; + wa= a->wds; + wb= b->wds; + wc= wa + wb; + if (wc > a->maxwds) + k++; + c= Balloc(k, alloc); + for (x= c->p.x, xa= x + wc; x < xa; x++) + *x= 0; + xa= a->p.x; + xae= xa + wa; + xb= b->p.x; + xbe= xb + wb; + xc0= c->p.x; + for (; xb < xbe; xc0++) + { + if ((y= *xb++)) + { + x= xa; + xc= xc0; + carry= 0; + do + { + z= *x++ * (ULLong)y + *xc + carry; + carry= z >> 32; + *xc++= (ULong) (z & FFFFFFFF); + } + while (x < xae); + *xc= (ULong) carry; + } + } + for (xc0= c->p.x, xc= xc0 + wc; wc > 0 && !*--xc; --wc) ; + c->wds= wc; + return c; +} + + +/* + Precalculated array of powers of 5: tested to be enough for + vasting majority of dtoa_r cases. +*/ + +static ULong powers5[]= +{ + 625UL, + + 390625UL, + + 2264035265UL, 35UL, + + 2242703233UL, 762134875UL, 1262UL, + + 3211403009UL, 1849224548UL, 3668416493UL, 3913284084UL, 1593091UL, + + 781532673UL, 64985353UL, 253049085UL, 594863151UL, 3553621484UL, + 3288652808UL, 3167596762UL, 2788392729UL, 3911132675UL, 590UL, + + 2553183233UL, 3201533787UL, 3638140786UL, 303378311UL, 1809731782UL, + 3477761648UL, 3583367183UL, 649228654UL, 2915460784UL, 487929380UL, + 1011012442UL, 1677677582UL, 3428152256UL, 1710878487UL, 1438394610UL, + 2161952759UL, 4100910556UL, 1608314830UL, 349175UL +}; + + +static Bigint p5_a[]= +{ + /* { x } - k - maxwds - sign - wds */ + { { powers5 }, 1, 1, 0, 1 }, + { { powers5 + 1 }, 1, 1, 0, 1 }, + { { powers5 + 2 }, 1, 2, 0, 2 }, + { { powers5 + 4 }, 2, 3, 0, 3 }, + { { powers5 + 7 }, 3, 5, 0, 5 }, + { { powers5 + 12 }, 4, 10, 0, 10 }, + { { powers5 + 22 }, 5, 19, 0, 19 } +}; + +#define P5A_MAX (sizeof(p5_a)/sizeof(*p5_a) - 1) + +static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc) +{ + Bigint *b1, *p5, *p51; + int i; + static int p05[3]= { 5, 25, 125 }; + + if ((i= k & 3)) + b= multadd(b, p05[i-1], 0, alloc); + + if (!(k>>= 2)) + return b; + p5= p5_a; + for (;;) + { + if (k & 1) + { + b1= mult(b, p5, alloc); + Bfree(b, alloc); + b= b1; + } + if (!(k>>= 1)) + break; + /* Calculate next power of 5 */ + if (p5 < p5_a + P5A_MAX) + ++p5; + else if (p5 == p5_a + P5A_MAX) + p5= mult(p5, p5, alloc); + else + { + p51= mult(p5, p5, alloc); + Bfree(p5, alloc); + p5= p51; + } + } + return b; +} + + +static Bigint *lshift(Bigint *b, int k, Stack_alloc *alloc) +{ + int i, k1, n, n1; + Bigint *b1; + ULong *x, *x1, *xe, z; + + n= k >> 5; + k1= b->k; + n1= n + b->wds + 1; + for (i= b->maxwds; n1 > i; i<<= 1) + k1++; + b1= Balloc(k1, alloc); + x1= b1->p.x; + for (i= 0; i < n; i++) + *x1++= 0; + x= b->p.x; + xe= x + b->wds; + if (k&= 0x1f) + { + k1= 32 - k; + z= 0; + do + { + *x1++= *x << k | z; + z= *x++ >> k1; + } + while (x < xe); + if ((*x1= z)) + ++n1; + } + else + do + *x1++= *x++; + while (x < xe); + b1->wds= n1 - 1; + Bfree(b, alloc); + return b1; +} + + +static int cmp(Bigint *a, Bigint *b) +{ + ULong *xa, *xa0, *xb, *xb0; + int i, j; + + i= a->wds; + j= b->wds; + if (i-= j) + return i; + xa0= a->p.x; + xa= xa0 + j; + xb0= b->p.x; + xb= xb0 + j; + for (;;) + { + if (*--xa != *--xb) + return *xa < *xb ? -1 : 1; + if (xa <= xa0) + break; + } + return 0; +} + + +static Bigint *diff(Bigint *a, Bigint *b, Stack_alloc *alloc) +{ + Bigint *c; + int i, wa, wb; + ULong *xa, *xae, *xb, *xbe, *xc; + ULLong borrow, y; + + i= cmp(a,b); + if (!i) + { + c= Balloc(0, alloc); + c->wds= 1; + c->p.x[0]= 0; + return c; + } + if (i < 0) + { + c= a; + a= b; + b= c; + i= 1; + } + else + i= 0; + c= Balloc(a->k, alloc); + c->sign= i; + wa= a->wds; + xa= a->p.x; + xae= xa + wa; + wb= b->wds; + xb= b->p.x; + xbe= xb + wb; + xc= c->p.x; + borrow= 0; + do + { + y= (ULLong)*xa++ - *xb++ - borrow; + borrow= y >> 32 & (ULong)1; + *xc++= (ULong) (y & FFFFFFFF); + } + while (xb < xbe); + while (xa < xae) + { + y= *xa++ - borrow; + borrow= y >> 32 & (ULong)1; + *xc++= (ULong) (y & FFFFFFFF); + } + while (!*--xc) + wa--; + c->wds= wa; + return c; +} + + +static double ulp(double x) +{ + register Long L; + double a; + + L= (word0(x) & Exp_mask) - (P - 1)*Exp_msk1; + word0(a) = L; + word1(a) = 0; + return dval(a); +} + + +static double b2d(Bigint *a, int *e) +{ + ULong *xa, *xa0, w, y, z; + int k; + double d; +#define d0 word0(d) +#define d1 word1(d) + + xa0= a->p.x; + xa= xa0 + a->wds; + y= *--xa; + k= hi0bits(y); + *e= 32 - k; + if (k < Ebits) + { + d0= Exp_1 | y >> (Ebits - k); + w= xa > xa0 ? *--xa : 0; + d1= y << ((32-Ebits) + k) | w >> (Ebits - k); + goto ret_d; + } + z= xa > xa0 ? *--xa : 0; + if (k-= Ebits) + { + d0= Exp_1 | y << k | z >> (32 - k); + y= xa > xa0 ? *--xa : 0; + d1= z << k | y >> (32 - k); + } + else + { + d0= Exp_1 | y; + d1= z; + } + ret_d: +#undef d0 +#undef d1 + return dval(d); +} + + +static Bigint *d2b(double d, int *e, int *bits, Stack_alloc *alloc) +{ + Bigint *b; + int de, k; + ULong *x, y, z; + int i; +#define d0 word0(d) +#define d1 word1(d) + + b= Balloc(1, alloc); + x= b->p.x; + + z= d0 & Frac_mask; + d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ + if ((de= (int)(d0 >> Exp_shift))) + z|= Exp_msk1; + if ((y= d1)) + { + if ((k= lo0bits(&y))) + { + x[0]= y | z << (32 - k); + z>>= k; + } + else + x[0]= y; + i= b->wds= (x[1]= z) ? 2 : 1; + } + else + { + k= lo0bits(&z); + x[0]= z; + i= b->wds= 1; + k+= 32; + } + if (de) + { + *e= de - Bias - (P-1) + k; + *bits= P - k; + } + else + { + *e= de - Bias - (P-1) + 1 + k; + *bits= 32*i - hi0bits(x[i-1]); + } + return b; +#undef d0 +#undef d1 +} + + +static double ratio(Bigint *a, Bigint *b) +{ + double da, db; + int k, ka, kb; + + dval(da)= b2d(a, &ka); + dval(db)= b2d(b, &kb); + k= ka - kb + 32*(a->wds - b->wds); + if (k > 0) + word0(da)+= k*Exp_msk1; + else + { + k= -k; + word0(db)+= k*Exp_msk1; + } + return dval(da) / dval(db); +} + +static const double tens[] = +{ + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + 1e20, 1e21, 1e22 +}; + +static const double bigtens[]= { 1e16, 1e32, 1e64, 1e128, 1e256 }; +static const double tinytens[]= +{ 1e-16, 1e-32, 1e-64, 1e-128, + 9007199254740992.*9007199254740992.e-256 /* = 2^106 * 1e-53 */ +}; +/* + The factor of 2^53 in tinytens[4] helps us avoid setting the underflow + flag unnecessarily. It leads to a song and dance at the end of strtod. +*/ +#define Scale_Bit 0x10 +#define n_bigtens 5 + +/* + strtod for IEEE--arithmetic machines. + + This strtod returns a nearest machine number to the input decimal + string (or sets errno to EOVERFLOW). Ties are broken by the IEEE round-even + rule. + + Inspired loosely by William D. Clinger's paper "How to Read Floating + Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. + + Modifications: + + 1. We only require IEEE (not IEEE double-extended). + 2. We get by with floating-point arithmetic in a case that + Clinger missed -- when we're computing d * 10^n + for a small integer d and the integer n is not too + much larger than 22 (the maximum integer k for which + we can represent 10^k exactly), we may be able to + compute (d*10^k) * 10^(e-k) with just one roundoff. + 3. Rather than a bit-at-a-time adjustment of the binary + result in the hard case, we use floating-point + arithmetic to determine the adjustment to within + one bit; only in really hard cases do we need to + compute a second residual. + 4. Because of 3., we don't need a large table of powers of 10 + for ten-to-e (just some small tables, e.g. of 10^k + for 0 <= k <= 22). +*/ + +static double my_strtod_int(const char *s00, char **se, int *error, char *buf, size_t buf_size) +{ + int scale; + int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, + e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; + const char *s, *s0, *s1, *end = *se; + double aadj, aadj1, adj, rv, rv0; + Long L; + ULong y, z; + Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; +#ifdef SET_INEXACT + int inexact, oldinexact; +#endif +#ifdef Honor_FLT_ROUNDS + int rounding; +#endif + Stack_alloc alloc; + LINT_INIT(c); + + *error= 0; + + alloc.begin= alloc.free= buf; + alloc.end= buf + buf_size; + memset(alloc.freelist, 0, sizeof(alloc.freelist)); + + sign= nz0= nz= 0; + dval(rv)= 0.; + for (s= s00; s < end; s++) + switch (*s) { + case '-': + sign= 1; + /* no break */ + case '+': + s++; + goto break2; + case '\t': + case '\n': + case '\v': + case '\f': + case '\r': + case ' ': + continue; + default: + goto break2; + } + break2: + if (s >= end) + goto ret0; + + if (*s == '0') + { + nz0= 1; + while (++s < end && *s == '0') ; + if (s >= end) + goto ret; + } + s0= s; + y= z= 0; + for (nd= nf= 0; s < end && (c= *s) >= '0' && c <= '9'; nd++, s++) + if (nd < 9) + y= 10*y + c - '0'; + else if (nd < 16) + z= 10*z + c - '0'; + nd0= nd; + if (s < end - 1 && c == '.') + { + c= *++s; + if (!nd) + { + for (; s < end && c == '0'; c= *++s) + nz++; + if (s < end && c > '0' && c <= '9') + { + s0= s; + nf+= nz; + nz= 0; + goto have_dig; + } + goto dig_done; + } + for (; s < end && c >= '0' && c <= '9'; c = *++s) + { + have_dig: + nz++; + if (c-= '0') + { + nf+= nz; + for (i= 1; i < nz; i++) + if (nd++ < 9) + y*= 10; + else if (nd <= DBL_DIG + 1) + z*= 10; + if (nd++ < 9) + y= 10*y + c; + else if (nd <= DBL_DIG + 1) + z= 10*z + c; + nz= 0; + } + } + } + dig_done: + e= 0; + if (s < end && (c == 'e' || c == 'E')) + { + if (!nd && !nz && !nz0) + goto ret0; + s00= s; + esign= 0; + if (++s < end) + switch (c= *s) { + case '-': + esign= 1; + case '+': + c= *++s; + } + if (s < end && c >= '0' && c <= '9') + { + while (s < end && c == '0') + c= *++s; + if (s < end && c > '0' && c <= '9') { + L= c - '0'; + s1= s; + while (++s < end && (c= *s) >= '0' && c <= '9') + L= 10*L + c - '0'; + if (s - s1 > 8 || L > 19999) + /* Avoid confusion from exponents + * so large that e might overflow. + */ + e= 19999; /* safe for 16 bit ints */ + else + e= (int)L; + if (esign) + e= -e; + } + else + e= 0; + } + else + s= s00; + } + if (!nd) + { + if (!nz && !nz0) + { + ret0: + s= s00; + sign= 0; + } + goto ret; + } + e1= e -= nf; + + /* + Now we have nd0 digits, starting at s0, followed by a + decimal point, followed by nd-nd0 digits. The number we're + after is the integer represented by those digits times + 10**e + */ + + if (!nd0) + nd0= nd; + k= nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; + dval(rv)= y; + if (k > 9) + { +#ifdef SET_INEXACT + if (k > DBL_DIG) + oldinexact = get_inexact(); +#endif + dval(rv)= tens[k - 9] * dval(rv) + z; + } + bd0= 0; + if (nd <= DBL_DIG +#ifndef Honor_FLT_ROUNDS + && Flt_Rounds == 1 +#endif + ) + { + if (!e) + goto ret; + if (e > 0) + { + if (e <= Ten_pmax) + { +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) + { + rv= -rv; + sign= 0; + } +#endif + /* rv = */ rounded_product(dval(rv), tens[e]); + goto ret; + } + i= DBL_DIG - nd; + if (e <= Ten_pmax + i) + { + /* + A fancier test would sometimes let us do + this for larger i values. + */ +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) + { + rv= -rv; + sign= 0; + } +#endif + e-= i; + dval(rv)*= tens[i]; + /* rv = */ rounded_product(dval(rv), tens[e]); + goto ret; + } + } +#ifndef Inaccurate_Divide + else if (e >= -Ten_pmax) + { +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) + { + rv= -rv; + sign= 0; + } +#endif + /* rv = */ rounded_quotient(dval(rv), tens[-e]); + goto ret; + } +#endif + } + e1+= nd - k; + +#ifdef SET_INEXACT + inexact= 1; + if (k <= DBL_DIG) + oldinexact= get_inexact(); +#endif + scale= 0; +#ifdef Honor_FLT_ROUNDS + if ((rounding= Flt_Rounds) >= 2) + { + if (sign) + rounding= rounding == 2 ? 0 : 2; + else + if (rounding != 2) + rounding= 0; + } +#endif + + /* Get starting approximation = rv * 10**e1 */ + + if (e1 > 0) + { + if ((i= e1 & 15)) + dval(rv)*= tens[i]; + if (e1&= ~15) + { + if (e1 > DBL_MAX_10_EXP) + { + ovfl: + *error= EOVERFLOW; + /* Can't trust HUGE_VAL */ +#ifdef Honor_FLT_ROUNDS + switch (rounding) + { + case 0: /* toward 0 */ + case 3: /* toward -infinity */ + word0(rv)= Big0; + word1(rv)= Big1; + break; + default: + word0(rv)= Exp_mask; + word1(rv)= 0; + } +#else /*Honor_FLT_ROUNDS*/ + word0(rv)= Exp_mask; + word1(rv)= 0; +#endif /*Honor_FLT_ROUNDS*/ +#ifdef SET_INEXACT + /* set overflow bit */ + dval(rv0)= 1e300; + dval(rv0)*= dval(rv0); +#endif + if (bd0) + goto retfree; + goto ret; + } + e1>>= 4; + for(j= 0; e1 > 1; j++, e1>>= 1) + if (e1 & 1) + dval(rv)*= bigtens[j]; + /* The last multiplication could overflow. */ + word0(rv)-= P*Exp_msk1; + dval(rv)*= bigtens[j]; + if ((z= word0(rv) & Exp_mask) > Exp_msk1 * (DBL_MAX_EXP + Bias - P)) + goto ovfl; + if (z > Exp_msk1 * (DBL_MAX_EXP + Bias - 1 - P)) + { + /* set to largest number (Can't trust DBL_MAX) */ + word0(rv)= Big0; + word1(rv)= Big1; + } + else + word0(rv)+= P*Exp_msk1; + } + } + else if (e1 < 0) + { + e1= -e1; + if ((i= e1 & 15)) + dval(rv)/= tens[i]; + if ((e1>>= 4)) + { + if (e1 >= 1 << n_bigtens) + goto undfl; + if (e1 & Scale_Bit) + scale= 2 * P; + for(j= 0; e1 > 0; j++, e1>>= 1) + if (e1 & 1) + dval(rv)*= tinytens[j]; + if (scale && (j = 2 * P + 1 - ((word0(rv) & Exp_mask) >> Exp_shift)) > 0) + { + /* scaled rv is denormal; zap j low bits */ + if (j >= 32) + { + word1(rv)= 0; + if (j >= 53) + word0(rv)= (P + 2) * Exp_msk1; + else + word0(rv)&= 0xffffffff << (j - 32); + } + else + word1(rv)&= 0xffffffff << j; + } + if (!dval(rv)) + { + undfl: + dval(rv)= 0.; + if (bd0) + goto retfree; + goto ret; + } + } + } + + /* Now the hard part -- adjusting rv to the correct value.*/ + + /* Put digits into bd: true value = bd * 10^e */ + + bd0= s2b(s0, nd0, nd, y, &alloc); + + for(;;) + { + bd= Balloc(bd0->k, &alloc); + Bcopy(bd, bd0); + bb= d2b(dval(rv), &bbe, &bbbits, &alloc); /* rv = bb * 2^bbe */ + bs= i2b(1, &alloc); + + if (e >= 0) + { + bb2= bb5= 0; + bd2= bd5= e; + } + else + { + bb2= bb5= -e; + bd2= bd5= 0; + } + if (bbe >= 0) + bb2+= bbe; + else + bd2-= bbe; + bs2= bb2; +#ifdef Honor_FLT_ROUNDS + if (rounding != 1) + bs2++; +#endif + j= bbe - scale; + i= j + bbbits - 1; /* logb(rv) */ + if (i < Emin) /* denormal */ + j+= P - Emin; + else + j= P + 1 - bbbits; + bb2+= j; + bd2+= j; + bd2+= scale; + i= bb2 < bd2 ? bb2 : bd2; + if (i > bs2) + i= bs2; + if (i > 0) + { + bb2-= i; + bd2-= i; + bs2-= i; + } + if (bb5 > 0) + { + bs= pow5mult(bs, bb5, &alloc); + bb1= mult(bs, bb, &alloc); + Bfree(bb, &alloc); + bb= bb1; + } + if (bb2 > 0) + bb= lshift(bb, bb2, &alloc); + if (bd5 > 0) + bd= pow5mult(bd, bd5, &alloc); + if (bd2 > 0) + bd= lshift(bd, bd2, &alloc); + if (bs2 > 0) + bs= lshift(bs, bs2, &alloc); + delta= diff(bb, bd, &alloc); + dsign= delta->sign; + delta->sign= 0; + i= cmp(delta, bs); +#ifdef Honor_FLT_ROUNDS + if (rounding != 1) + { + if (i < 0) + { + /* Error is less than an ulp */ + if (!delta->x[0] && delta->wds <= 1) + { + /* exact */ +#ifdef SET_INEXACT + inexact= 0; +#endif + break; + } + if (rounding) + { + if (dsign) + { + adj= 1.; + goto apply_adj; + } + } + else if (!dsign) + { + adj= -1.; + if (!word1(rv) && !(word0(rv) & Frac_mask)) + { + y= word0(rv) & Exp_mask; + if (!scale || y > 2*P*Exp_msk1) + { + delta= lshift(delta,Log2P); + if (cmp(delta, bs) <= 0) + adj= -0.5; + } + } + apply_adj: + if (scale && (y= word0(rv) & Exp_mask) <= 2 * P * Exp_msk1) + word0(adj)+= (2 * P + 1) * Exp_msk1 - y; + dval(rv)+= adj * ulp(dval(rv)); + } + break; + } + adj= ratio(delta, bs); + if (adj < 1.) + adj= 1.; + if (adj <= 0x7ffffffe) + { + /* adj = rounding ? ceil(adj) : floor(adj); */ + y= adj; + if (y != adj) + { + if (!((rounding >> 1) ^ dsign)) + y++; + adj= y; + } + } + if (scale && (y= word0(rv) & Exp_mask) <= 2 * P * Exp_msk1) + word0(adj)+= (2 * P + 1) * Exp_msk1 - y; + adj*= ulp(dval(rv)); + if (dsign) + dval(rv)+= adj; + else + dval(rv)-= adj; + goto cont; + } +#endif /*Honor_FLT_ROUNDS*/ + + if (i < 0) + { + /* + Error is less than half an ulp -- check for special case of mantissa + a power of two. + */ + if (dsign || word1(rv) || word0(rv) & Bndry_mask || + (word0(rv) & Exp_mask) <= (2 * P + 1) * Exp_msk1) + { +#ifdef SET_INEXACT + if (!delta->x[0] && delta->wds <= 1) + inexact= 0; +#endif + break; + } + if (!delta->p.x[0] && delta->wds <= 1) + { + /* exact result */ +#ifdef SET_INEXACT + inexact= 0; +#endif + break; + } + delta= lshift(delta, Log2P, &alloc); + if (cmp(delta, bs) > 0) + goto drop_down; + break; + } + if (i == 0) + { + /* exactly half-way between */ + if (dsign) + { + if ((word0(rv) & Bndry_mask1) == Bndry_mask1 && + word1(rv) == + ((scale && (y = word0(rv) & Exp_mask) <= 2 * P * Exp_msk1) ? + (0xffffffff & (0xffffffff << (2*P+1-(y>>Exp_shift)))) : + 0xffffffff)) + { + /*boundary case -- increment exponent*/ + word0(rv)= (word0(rv) & Exp_mask) + Exp_msk1; + word1(rv) = 0; + dsign = 0; + break; + } + } + else if (!(word0(rv) & Bndry_mask) && !word1(rv)) + { + drop_down: + /* boundary case -- decrement exponent */ + if (scale) + { + L= word0(rv) & Exp_mask; + if (L <= (2 *P + 1) * Exp_msk1) + { + if (L > (P + 2) * Exp_msk1) + /* round even ==> accept rv */ + break; + /* rv = smallest denormal */ + goto undfl; + } + } + L= (word0(rv) & Exp_mask) - Exp_msk1; + word0(rv)= L | Bndry_mask1; + word1(rv)= 0xffffffff; + break; + } + if (!(word1(rv) & LSB)) + break; + if (dsign) + dval(rv)+= ulp(dval(rv)); + else + { + dval(rv)-= ulp(dval(rv)); + if (!dval(rv)) + goto undfl; + } + dsign= 1 - dsign; + break; + } + if ((aadj= ratio(delta, bs)) <= 2.) + { + if (dsign) + aadj= aadj1= 1.; + else if (word1(rv) || word0(rv) & Bndry_mask) + { + if (word1(rv) == Tiny1 && !word0(rv)) + goto undfl; + aadj= 1.; + aadj1= -1.; + } + else + { + /* special case -- power of FLT_RADIX to be rounded down... */ + if (aadj < 2. / FLT_RADIX) + aadj= 1. / FLT_RADIX; + else + aadj*= 0.5; + aadj1= -aadj; + } + } + else + { + aadj*= 0.5; + aadj1= dsign ? aadj : -aadj; +#ifdef Check_FLT_ROUNDS + switch (Rounding) + { + case 2: /* towards +infinity */ + aadj1-= 0.5; + break; + case 0: /* towards 0 */ + case 3: /* towards -infinity */ + aadj1+= 0.5; + } +#else + if (Flt_Rounds == 0) + aadj1+= 0.5; +#endif /*Check_FLT_ROUNDS*/ + } + y= word0(rv) & Exp_mask; + + /* Check for overflow */ + + if (y == Exp_msk1 * (DBL_MAX_EXP + Bias - 1)) + { + dval(rv0)= dval(rv); + word0(rv)-= P * Exp_msk1; + adj= aadj1 * ulp(dval(rv)); + dval(rv)+= adj; + if ((word0(rv) & Exp_mask) >= Exp_msk1 * (DBL_MAX_EXP + Bias - P)) + { + if (word0(rv0) == Big0 && word1(rv0) == Big1) + goto ovfl; + word0(rv)= Big0; + word1(rv)= Big1; + goto cont; + } + else + word0(rv)+= P * Exp_msk1; + } + else + { + if (scale && y <= 2 * P * Exp_msk1) + { + if (aadj <= 0x7fffffff) + { + if ((z= (ULong) aadj) <= 0) + z= 1; + aadj= z; + aadj1= dsign ? aadj : -aadj; + } + word0(aadj1)+= (2 * P + 1) * Exp_msk1 - y; + } + adj = aadj1 * ulp(dval(rv)); + dval(rv) += adj; + } + z= word0(rv) & Exp_mask; +#ifndef SET_INEXACT + if (!scale) + if (y == z) + { + /* Can we stop now? */ + L= (Long)aadj; + aadj-= L; + /* The tolerances below are conservative. */ + if (dsign || word1(rv) || word0(rv) & Bndry_mask) + { + if (aadj < .4999999 || aadj > .5000001) + break; + } + else if (aadj < .4999999 / FLT_RADIX) + break; + } +#endif + cont: + Bfree(bb, &alloc); + Bfree(bd, &alloc); + Bfree(bs, &alloc); + Bfree(delta, &alloc); + } +#ifdef SET_INEXACT + if (inexact) + { + if (!oldinexact) + { + word0(rv0)= Exp_1 + (70 << Exp_shift); + word1(rv0)= 0; + dval(rv0)+= 1.; + } + } + else if (!oldinexact) + clear_inexact(); +#endif + if (scale) + { + word0(rv0)= Exp_1 - 2 * P * Exp_msk1; + word1(rv0)= 0; + dval(rv)*= dval(rv0); + } +#ifdef SET_INEXACT + if (inexact && !(word0(rv) & Exp_mask)) + { + /* set underflow bit */ + dval(rv0)= 1e-300; + dval(rv0)*= dval(rv0); + } +#endif + retfree: + Bfree(bb, &alloc); + Bfree(bd, &alloc); + Bfree(bs, &alloc); + Bfree(bd0, &alloc); + Bfree(delta, &alloc); + ret: + *se= (char *)s; + return sign ? -dval(rv) : dval(rv); +} + + +static int quorem(Bigint *b, Bigint *S) +{ + int n; + ULong *bx, *bxe, q, *sx, *sxe; + ULLong borrow, carry, y, ys; + + n= S->wds; + if (b->wds < n) + return 0; + sx= S->p.x; + sxe= sx + --n; + bx= b->p.x; + bxe= bx + n; + q= *bxe / (*sxe + 1); /* ensure q <= true quotient */ + if (q) + { + borrow= 0; + carry= 0; + do + { + ys= *sx++ * (ULLong)q + carry; + carry= ys >> 32; + y= *bx - (ys & FFFFFFFF) - borrow; + borrow= y >> 32 & (ULong)1; + *bx++= (ULong) (y & FFFFFFFF); + } + while (sx <= sxe); + if (!*bxe) + { + bx= b->p.x; + while (--bxe > bx && !*bxe) + --n; + b->wds= n; + } + } + if (cmp(b, S) >= 0) + { + q++; + borrow= 0; + carry= 0; + bx= b->p.x; + sx= S->p.x; + do + { + ys= *sx++ + carry; + carry= ys >> 32; + y= *bx - (ys & FFFFFFFF) - borrow; + borrow= y >> 32 & (ULong)1; + *bx++= (ULong) (y & FFFFFFFF); + } + while (sx <= sxe); + bx= b->p.x; + bxe= bx + n; + if (!*bxe) + { + while (--bxe > bx && !*bxe) + --n; + b->wds= n; + } + } + return q; +} + + +/* + dtoa for IEEE arithmetic (dmg): convert double to ASCII string. + + Inspired by "How to Print Floating-Point Numbers Accurately" by + Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. + + Modifications: + 1. Rather than iterating, we use a simple numeric overestimate + to determine k= floor(log10(d)). We scale relevant + quantities using O(log2(k)) rather than O(k) multiplications. + 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't + try to generate digits strictly left to right. Instead, we + compute with fewer bits and propagate the carry if necessary + when rounding the final digit up. This is often faster. + 3. Under the assumption that input will be rounded nearest, + mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. + That is, we allow equality in stopping tests when the + round-nearest rule will give the same floating-point value + as would satisfaction of the stopping test with strict + inequality. + 4. We remove common factors of powers of 2 from relevant + quantities. + 5. When converting floating-point integers less than 1e16, + we use floating-point arithmetic rather than resorting + to multiple-precision integers. + 6. When asked to produce fewer than 15 digits, we first try + to get by with floating-point arithmetic; we resort to + multiple-precision integer arithmetic only if we cannot + guarantee that the floating-point calculation has given + the correctly rounded result. For k requested digits and + "uniformly" distributed input, the probability is + something like 10^(k-15) that we must resort to the Long + calculation. + */ + +static char *dtoa(double d, int mode, int ndigits, int *decpt, int *sign, + char **rve, char *buf, size_t buf_size) +{ + /* + Arguments ndigits, decpt, sign are similar to those + of ecvt and fcvt; trailing zeros are suppressed from + the returned string. If not null, *rve is set to point + to the end of the return value. If d is +-Infinity or NaN, + then *decpt is set to DTOA_OVERFLOW. + + mode: + 0 ==> shortest string that yields d when read in + and rounded to nearest. + 1 ==> like 0, but with Steele & White stopping rule; + e.g. with IEEE P754 arithmetic , mode 0 gives + 1e23 whereas mode 1 gives 9.999999999999999e22. + 2 ==> max(1,ndigits) significant digits. This gives a + return value similar to that of ecvt, except + that trailing zeros are suppressed. + 3 ==> through ndigits past the decimal point. This + gives a return value similar to that from fcvt, + except that trailing zeros are suppressed, and + ndigits can be negative. + 4,5 ==> similar to 2 and 3, respectively, but (in + round-nearest mode) with the tests of mode 0 to + possibly return a shorter string that rounds to d. + With IEEE arithmetic and compilation with + -DHonor_FLT_ROUNDS, modes 4 and 5 behave the same + as modes 2 and 3 when FLT_ROUNDS != 1. + 6-9 ==> Debugging modes similar to mode - 4: don't try + fast floating-point estimate (if applicable). + + Values of mode other than 0-9 are treated as mode 0. + + Sufficient space is allocated to the return value + to hold the suppressed trailing zeros. + */ + + int bbits, b2, b5, be, dig, i, ieps, UNINIT_VAR(ilim), ilim0, + UNINIT_VAR(ilim1), j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, + spec_case, try_quick; + Long L; + int denorm; + ULong x; + Bigint *b, *b1, *delta, *mlo, *mhi, *S; + double d2, ds, eps; + char *s, *s0; +#ifdef Honor_FLT_ROUNDS + int rounding; +#endif + Stack_alloc alloc; + + alloc.begin= alloc.free= buf; + alloc.end= buf + buf_size; + memset(alloc.freelist, 0, sizeof(alloc.freelist)); + + if (word0(d) & Sign_bit) + { + /* set sign for everything, including 0's and NaNs */ + *sign= 1; + word0(d) &= ~Sign_bit; /* clear sign bit */ + } + else + *sign= 0; + + /* If infinity, set decpt to DTOA_OVERFLOW, if 0 set it to 1 */ + if (((word0(d) & Exp_mask) == Exp_mask && (*decpt= DTOA_OVERFLOW)) || + (!dval(d) && (*decpt= 1))) + { + /* Infinity, NaN, 0 */ + char *res= (char*) dtoa_alloc(2, &alloc); + res[0]= '0'; + res[1]= '\0'; + if (rve) + *rve= res + 1; + return res; + } + +#ifdef Honor_FLT_ROUNDS + if ((rounding= Flt_Rounds) >= 2) + { + if (*sign) + rounding= rounding == 2 ? 0 : 2; + else + if (rounding != 2) + rounding= 0; + } +#endif + + b= d2b(dval(d), &be, &bbits, &alloc); + if ((i= (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) + { + dval(d2)= dval(d); + word0(d2) &= Frac_mask1; + word0(d2) |= Exp_11; + + /* + log(x) ~=~ log(1.5) + (x-1.5)/1.5 + log10(x) = log(x) / log(10) + ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) + log10(d)= (i-Bias)*log(2)/log(10) + log10(d2) + + This suggests computing an approximation k to log10(d) by + + k= (i - Bias)*0.301029995663981 + + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); + + We want k to be too large rather than too small. + The error in the first-order Taylor series approximation + is in our favor, so we just round up the constant enough + to compensate for any error in the multiplication of + (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, + and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, + adding 1e-13 to the constant term more than suffices. + Hence we adjust the constant term to 0.1760912590558. + (We could get a more accurate k by invoking log10, + but this is probably not worthwhile.) + */ + + i-= Bias; + denorm= 0; + } + else + { + /* d is denormalized */ + + i= bbits + be + (Bias + (P-1) - 1); + x= i > 32 ? word0(d) << (64 - i) | word1(d) >> (i - 32) + : word1(d) << (32 - i); + dval(d2)= x; + word0(d2)-= 31*Exp_msk1; /* adjust exponent */ + i-= (Bias + (P-1) - 1) + 1; + denorm= 1; + } + ds= (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; + k= (int)ds; + if (ds < 0. && ds != k) + k--; /* want k= floor(ds) */ + k_check= 1; + if (k >= 0 && k <= Ten_pmax) + { + if (dval(d) < tens[k]) + k--; + k_check= 0; + } + j= bbits - i - 1; + if (j >= 0) + { + b2= 0; + s2= j; + } + else + { + b2= -j; + s2= 0; + } + if (k >= 0) + { + b5= 0; + s5= k; + s2+= k; + } + else + { + b2-= k; + b5= -k; + s5= 0; + } + if (mode < 0 || mode > 9) + mode= 0; + +#ifdef Check_FLT_ROUNDS + try_quick= Rounding == 1; +#else + try_quick= 1; +#endif + + if (mode > 5) + { + mode-= 4; + try_quick= 0; + } + leftright= 1; + switch (mode) { + case 0: + case 1: + ilim= ilim1= -1; + i= 18; + ndigits= 0; + break; + case 2: + leftright= 0; + /* no break */ + case 4: + if (ndigits <= 0) + ndigits= 1; + ilim= ilim1= i= ndigits; + break; + case 3: + leftright= 0; + /* no break */ + case 5: + i= ndigits + k + 1; + ilim= i; + ilim1= i - 1; + if (i <= 0) + i= 1; + } + s= s0= dtoa_alloc(i, &alloc); + +#ifdef Honor_FLT_ROUNDS + if (mode > 1 && rounding != 1) + leftright= 0; +#endif + + if (ilim >= 0 && ilim <= Quick_max && try_quick) + { + /* Try to get by with floating-point arithmetic. */ + i= 0; + dval(d2)= dval(d); + k0= k; + ilim0= ilim; + ieps= 2; /* conservative */ + if (k > 0) + { + ds= tens[k&0xf]; + j= k >> 4; + if (j & Bletch) + { + /* prevent overflows */ + j&= Bletch - 1; + dval(d)/= bigtens[n_bigtens-1]; + ieps++; + } + for (; j; j>>= 1, i++) + { + if (j & 1) + { + ieps++; + ds*= bigtens[i]; + } + } + dval(d)/= ds; + } + else if ((j1= -k)) + { + dval(d)*= tens[j1 & 0xf]; + for (j= j1 >> 4; j; j>>= 1, i++) + { + if (j & 1) + { + ieps++; + dval(d)*= bigtens[i]; + } + } + } + if (k_check && dval(d) < 1. && ilim > 0) + { + if (ilim1 <= 0) + goto fast_failed; + ilim= ilim1; + k--; + dval(d)*= 10.; + ieps++; + } + dval(eps)= ieps*dval(d) + 7.; + word0(eps)-= (P-1)*Exp_msk1; + if (ilim == 0) + { + S= mhi= 0; + dval(d)-= 5.; + if (dval(d) > dval(eps)) + goto one_digit; + if (dval(d) < -dval(eps)) + goto no_digits; + goto fast_failed; + } + if (leftright) + { + /* Use Steele & White method of only generating digits needed. */ + dval(eps)= 0.5/tens[ilim-1] - dval(eps); + for (i= 0;;) + { + L= (Long) dval(d); + dval(d)-= L; + *s++= '0' + (int)L; + if (dval(d) < dval(eps)) + goto ret1; + if (1. - dval(d) < dval(eps)) + goto bump_up; + if (++i >= ilim) + break; + dval(eps)*= 10.; + dval(d)*= 10.; + } + } + else + { + /* Generate ilim digits, then fix them up. */ + dval(eps)*= tens[ilim-1]; + for (i= 1;; i++, dval(d)*= 10.) + { + L= (Long)(dval(d)); + if (!(dval(d)-= L)) + ilim= i; + *s++= '0' + (int)L; + if (i == ilim) + { + if (dval(d) > 0.5 + dval(eps)) + goto bump_up; + else if (dval(d) < 0.5 - dval(eps)) + { + while (*--s == '0'); + s++; + goto ret1; + } + break; + } + } + } + fast_failed: + s= s0; + dval(d)= dval(d2); + k= k0; + ilim= ilim0; + } + + /* Do we have a "small" integer? */ + + if (be >= 0 && k <= Int_max) + { + /* Yes. */ + ds= tens[k]; + if (ndigits < 0 && ilim <= 0) + { + S= mhi= 0; + if (ilim < 0 || dval(d) <= 5*ds) + goto no_digits; + goto one_digit; + } + for (i= 1;; i++, dval(d)*= 10.) + { + L= (Long)(dval(d) / ds); + dval(d)-= L*ds; +#ifdef Check_FLT_ROUNDS + /* If FLT_ROUNDS == 2, L will usually be high by 1 */ + if (dval(d) < 0) + { + L--; + dval(d)+= ds; + } +#endif + *s++= '0' + (int)L; + if (!dval(d)) + { + break; + } + if (i == ilim) + { +#ifdef Honor_FLT_ROUNDS + if (mode > 1) + { + switch (rounding) { + case 0: goto ret1; + case 2: goto bump_up; + } + } +#endif + dval(d)+= dval(d); + if (dval(d) > ds || (dval(d) == ds && L & 1)) + { +bump_up: + while (*--s == '9') + if (s == s0) + { + k++; + *s= '0'; + break; + } + ++*s++; + } + break; + } + } + goto ret1; + } + + m2= b2; + m5= b5; + mhi= mlo= 0; + if (leftright) + { + i = denorm ? be + (Bias + (P-1) - 1 + 1) : 1 + P - bbits; + b2+= i; + s2+= i; + mhi= i2b(1, &alloc); + } + if (m2 > 0 && s2 > 0) + { + i= m2 < s2 ? m2 : s2; + b2-= i; + m2-= i; + s2-= i; + } + if (b5 > 0) + { + if (leftright) + { + if (m5 > 0) + { + mhi= pow5mult(mhi, m5, &alloc); + b1= mult(mhi, b, &alloc); + Bfree(b, &alloc); + b= b1; + } + if ((j= b5 - m5)) + b= pow5mult(b, j, &alloc); + } + else + b= pow5mult(b, b5, &alloc); + } + S= i2b(1, &alloc); + if (s5 > 0) + S= pow5mult(S, s5, &alloc); + + /* Check for special case that d is a normalized power of 2. */ + + spec_case= 0; + if ((mode < 2 || leftright) +#ifdef Honor_FLT_ROUNDS + && rounding == 1 +#endif + ) + { + if (!word1(d) && !(word0(d) & Bndry_mask) && + word0(d) & (Exp_mask & ~Exp_msk1) + ) + { + /* The special case */ + b2+= Log2P; + s2+= Log2P; + spec_case= 1; + } + } + + /* + Arrange for convenient computation of quotients: + shift left if necessary so divisor has 4 leading 0 bits. + + Perhaps we should just compute leading 28 bits of S once + a nd for all and pass them and a shift to quorem, so it + can do shifts and ors to compute the numerator for q. + */ + if ((i= ((s5 ? 32 - hi0bits(S->p.x[S->wds-1]) : 1) + s2) & 0x1f)) + i= 32 - i; + if (i > 4) + { + i-= 4; + b2+= i; + m2+= i; + s2+= i; + } + else if (i < 4) + { + i+= 28; + b2+= i; + m2+= i; + s2+= i; + } + if (b2 > 0) + b= lshift(b, b2, &alloc); + if (s2 > 0) + S= lshift(S, s2, &alloc); + if (k_check) + { + if (cmp(b,S) < 0) + { + k--; + /* we botched the k estimate */ + b= multadd(b, 10, 0, &alloc); + if (leftright) + mhi= multadd(mhi, 10, 0, &alloc); + ilim= ilim1; + } + } + if (ilim <= 0 && (mode == 3 || mode == 5)) + { + if (ilim < 0 || cmp(b,S= multadd(S,5,0, &alloc)) <= 0) + { + /* no digits, fcvt style */ +no_digits: + k= -1 - ndigits; + goto ret; + } +one_digit: + *s++= '1'; + k++; + goto ret; + } + if (leftright) + { + if (m2 > 0) + mhi= lshift(mhi, m2, &alloc); + + /* + Compute mlo -- check for special case that d is a normalized power of 2. + */ + + mlo= mhi; + if (spec_case) + { + mhi= Balloc(mhi->k, &alloc); + Bcopy(mhi, mlo); + mhi= lshift(mhi, Log2P, &alloc); + } + + for (i= 1;;i++) + { + dig= quorem(b,S) + '0'; + /* Do we yet have the shortest decimal string that will round to d? */ + j= cmp(b, mlo); + delta= diff(S, mhi, &alloc); + j1= delta->sign ? 1 : cmp(b, delta); + Bfree(delta, &alloc); + if (j1 == 0 && mode != 1 && !(word1(d) & 1) +#ifdef Honor_FLT_ROUNDS + && rounding >= 1 +#endif + ) + { + if (dig == '9') + goto round_9_up; + if (j > 0) + dig++; + *s++= dig; + goto ret; + } + if (j < 0 || (j == 0 && mode != 1 && !(word1(d) & 1))) + { + if (!b->p.x[0] && b->wds <= 1) + { + goto accept_dig; + } +#ifdef Honor_FLT_ROUNDS + if (mode > 1) + switch (rounding) { + case 0: goto accept_dig; + case 2: goto keep_dig; + } +#endif /*Honor_FLT_ROUNDS*/ + if (j1 > 0) + { + b= lshift(b, 1, &alloc); + j1= cmp(b, S); + if ((j1 > 0 || (j1 == 0 && dig & 1)) + && dig++ == '9') + goto round_9_up; + } +accept_dig: + *s++= dig; + goto ret; + } + if (j1 > 0) + { +#ifdef Honor_FLT_ROUNDS + if (!rounding) + goto accept_dig; +#endif + if (dig == '9') + { /* possible if i == 1 */ +round_9_up: + *s++= '9'; + goto roundoff; + } + *s++= dig + 1; + goto ret; + } +#ifdef Honor_FLT_ROUNDS +keep_dig: +#endif + *s++= dig; + if (i == ilim) + break; + b= multadd(b, 10, 0, &alloc); + if (mlo == mhi) + mlo= mhi= multadd(mhi, 10, 0, &alloc); + else + { + mlo= multadd(mlo, 10, 0, &alloc); + mhi= multadd(mhi, 10, 0, &alloc); + } + } + } + else + for (i= 1;; i++) + { + *s++= dig= quorem(b,S) + '0'; + if (!b->p.x[0] && b->wds <= 1) + { + goto ret; + } + if (i >= ilim) + break; + b= multadd(b, 10, 0, &alloc); + } + + /* Round off last digit */ + +#ifdef Honor_FLT_ROUNDS + switch (rounding) { + case 0: goto trimzeros; + case 2: goto roundoff; + } +#endif + b= lshift(b, 1, &alloc); + j= cmp(b, S); + if (j > 0 || (j == 0 && dig & 1)) + { +roundoff: + while (*--s == '9') + if (s == s0) + { + k++; + *s++= '1'; + goto ret; + } + ++*s++; + } + else + { +#ifdef Honor_FLT_ROUNDS +trimzeros: +#endif + while (*--s == '0'); + s++; + } +ret: + Bfree(S, &alloc); + if (mhi) + { + if (mlo && mlo != mhi) + Bfree(mlo, &alloc); + Bfree(mhi, &alloc); + } +ret1: + Bfree(b, &alloc); + *s= 0; + *decpt= k + 1; + if (rve) + *rve= s; + return s0; +} diff --git a/strings/strtod.c b/strings/strtod.c deleted file mode 100644 index 4c9cf931cb3..00000000000 --- a/strings/strtod.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - An alternative implementation of "strtod()" that is both - simplier, and thread-safe. - - Original code from mit-threads as bundled with MySQL 3.23 - - SQL:2003 specifies a number as - - ::= [ ] - - ::= - - | - - ::= - [ [ ] ] - | - - ::= E - - ::= - - ::= - - So do we. - - */ - -#include "my_base.h" /* Includes errno.h + EOVERFLOW */ -#include "m_ctype.h" -#ifdef HAVE_IEEEFP_H -#include -#endif - -#define MAX_DBL_EXP 308 -#define MAX_RESULT_FOR_MAX_EXP 1.7976931348623157 - -const double log_10[] = { - 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009, - 1e010, 1e011, 1e012, 1e013, 1e014, 1e015, 1e016, 1e017, 1e018, 1e019, - 1e020, 1e021, 1e022, 1e023, 1e024, 1e025, 1e026, 1e027, 1e028, 1e029, - 1e030, 1e031, 1e032, 1e033, 1e034, 1e035, 1e036, 1e037, 1e038, 1e039, - 1e040, 1e041, 1e042, 1e043, 1e044, 1e045, 1e046, 1e047, 1e048, 1e049, - 1e050, 1e051, 1e052, 1e053, 1e054, 1e055, 1e056, 1e057, 1e058, 1e059, - 1e060, 1e061, 1e062, 1e063, 1e064, 1e065, 1e066, 1e067, 1e068, 1e069, - 1e070, 1e071, 1e072, 1e073, 1e074, 1e075, 1e076, 1e077, 1e078, 1e079, - 1e080, 1e081, 1e082, 1e083, 1e084, 1e085, 1e086, 1e087, 1e088, 1e089, - 1e090, 1e091, 1e092, 1e093, 1e094, 1e095, 1e096, 1e097, 1e098, 1e099, - 1e100, 1e101, 1e102, 1e103, 1e104, 1e105, 1e106, 1e107, 1e108, 1e109, - 1e110, 1e111, 1e112, 1e113, 1e114, 1e115, 1e116, 1e117, 1e118, 1e119, - 1e120, 1e121, 1e122, 1e123, 1e124, 1e125, 1e126, 1e127, 1e128, 1e129, - 1e130, 1e131, 1e132, 1e133, 1e134, 1e135, 1e136, 1e137, 1e138, 1e139, - 1e140, 1e141, 1e142, 1e143, 1e144, 1e145, 1e146, 1e147, 1e148, 1e149, - 1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159, - 1e160, 1e161, 1e162, 1e163, 1e164, 1e165, 1e166, 1e167, 1e168, 1e169, - 1e170, 1e171, 1e172, 1e173, 1e174, 1e175, 1e176, 1e177, 1e178, 1e179, - 1e180, 1e181, 1e182, 1e183, 1e184, 1e185, 1e186, 1e187, 1e188, 1e189, - 1e190, 1e191, 1e192, 1e193, 1e194, 1e195, 1e196, 1e197, 1e198, 1e199, - 1e200, 1e201, 1e202, 1e203, 1e204, 1e205, 1e206, 1e207, 1e208, 1e209, - 1e210, 1e211, 1e212, 1e213, 1e214, 1e215, 1e216, 1e217, 1e218, 1e219, - 1e220, 1e221, 1e222, 1e223, 1e224, 1e225, 1e226, 1e227, 1e228, 1e229, - 1e230, 1e231, 1e232, 1e233, 1e234, 1e235, 1e236, 1e237, 1e238, 1e239, - 1e240, 1e241, 1e242, 1e243, 1e244, 1e245, 1e246, 1e247, 1e248, 1e249, - 1e250, 1e251, 1e252, 1e253, 1e254, 1e255, 1e256, 1e257, 1e258, 1e259, - 1e260, 1e261, 1e262, 1e263, 1e264, 1e265, 1e266, 1e267, 1e268, 1e269, - 1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279, - 1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289, - 1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299, - 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308 -}; - -/* - Convert string to double (string doesn't have to be null terminated) - - SYNOPSIS - my_strtod() - str String to convert - end_ptr Pointer to pointer that points to end of string - Will be updated to point to end of double. - error Will contain error number in case of error (else 0) - - RETURN - value of str as double -*/ - -double my_strtod(const char *str, char **end_ptr, int *error) -{ - double result= 0.0; - uint negative= 0, neg_exp= 0; - size_t ndigits, dec_digits= 0; - int exponent= 0, digits_after_dec_point= 0, tmp_exp, step; - const char *old_str, *end= *end_ptr, *start_of_number; - char next_char; - my_bool overflow=0; - double scaler= 1.0; - - *error= 0; - if (str >= end) - goto done; - - while (my_isspace(&my_charset_latin1, *str)) - { - if (++str == end) - goto done; - } - - start_of_number= str; - if ((negative= (*str == '-')) || *str=='+') - { - if (++str == end) - goto done; /* Could be changed to error */ - } - - /* Skip pre-zero for easier calculation of overflows */ - while (*str == '0') - { - if (++str == end) - goto done; - start_of_number= 0; /* Found digit */ - } - - old_str= str; - while ((next_char= *str) >= '0' && next_char <= '9') - { - result= result*10.0 + (next_char - '0'); - scaler= scaler*10.0; - if (++str == end) - { - next_char= 0; /* Found end of string */ - break; - } - start_of_number= 0; /* Found digit */ - } - ndigits= (size_t) (str-old_str); - - if (next_char == '.' && str < end-1) - { - /* - Continue to add numbers after decimal point to the result, as if there - was no decimal point. We will later (in the exponent handling) shift - the number down with the required number of fractions. We do it this - way to be able to get maximum precision for numbers like 123.45E+02, - which are normal for some ODBC applications. - */ - old_str= ++str; - while (my_isdigit(&my_charset_latin1, (next_char= *str))) - { - result= result*10.0 + (next_char - '0'); - digits_after_dec_point++; - scaler= scaler*10.0; - if (++str == end) - { - next_char= 0; - break; - } - } - /* If we found just '+.' or '.' then point at first character */ - if (!(dec_digits= (size_t) (str-old_str)) && start_of_number) - str= start_of_number; /* Point at '+' or '.' */ - } - if ((next_char == 'e' || next_char == 'E') && - dec_digits + ndigits != 0 && str < end-1) - { - const char *old_str2= str++; - - if ((neg_exp= (*str == '-')) || *str == '+') - str++; - - if (str == end || !my_isdigit(&my_charset_latin1, *str)) - str= old_str2; - else - { - do - { - if (exponent < 9999) /* prot. against exp overfl. */ - exponent= exponent*10 + (*str - '0'); - str++; - } while (str < end && my_isdigit(&my_charset_latin1, *str)); - } - } - tmp_exp= (neg_exp ? exponent + digits_after_dec_point : - exponent - digits_after_dec_point); - if (tmp_exp) - { - int order; - /* - Check for underflow/overflow. - order is such an integer number that f = C * 10 ^ order, - where f is the resulting floating point number and 1 <= C < 10. - Here we compute the modulus - */ - order= exponent + (neg_exp ? -1 : 1) * (ndigits - 1); - if (order < 0) - order= -order; - if (order >= MAX_DBL_EXP && !neg_exp && result) - { - double c; - /* Compute modulus of C (see comment above) */ - c= result / scaler * 10.0; - if (order > MAX_DBL_EXP || c > MAX_RESULT_FOR_MAX_EXP) - { - overflow= 1; - goto done; - } - } - - exponent= tmp_exp; - if (exponent < 0) - { - exponent= -exponent; - neg_exp= 1; /* neg_exp was 0 before */ - } - step= array_elements(log_10) - 1; - for (; exponent > step; exponent-= step) - result= neg_exp ? result / log_10[step] : result * log_10[step]; - result= neg_exp ? result / log_10[exponent] : result * log_10[exponent]; - } - -done: - *end_ptr= (char*) str; /* end of number */ - - if (overflow || my_isinf(result)) - { - result= DBL_MAX; - *error= EOVERFLOW; - } - - return negative ? -result : result; -} - -double my_atof(const char *nptr) -{ - int error; - const char *end= nptr+65535; /* Should be enough */ - return (my_strtod(nptr, (char**) &end, &error)); -} From 4f3e6f7a6aa981bba537b20f0bca02e6a3a26612 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 22 Dec 2009 21:10:31 +0300 Subject: [PATCH 42/86] Fixed a Windows build failure --- libmysql/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 06c683bd27e..d49ba74d89f 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -69,7 +69,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c ../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c ../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c - ../mysys/default.c strings/dtoa.c errmsg.c ../mysys/errors.c + ../mysys/default.c ../strings/dtoa.c errmsg.c ../mysys/errors.c ../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c get_password.c ../strings/int2str.c ../strings/is_prefix.c libmysql.c ../mysys/list.c ../strings/llstr.c From c9855862f75866e0749d9dffb9345f61550492c4 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 22 Dec 2009 23:55:56 +0300 Subject: [PATCH 43/86] Fixed more PB2 test failures introduced by backporting WL#2934. --- .../suite/funcs_1/r/innodb_func_view.result | 144 +++++++++--------- .../suite/funcs_1/r/innodb_views.result | 12 +- .../suite/funcs_1/r/memory_func_view.result | 144 +++++++++--------- .../suite/funcs_1/r/memory_views.result | 12 +- .../suite/funcs_1/r/myisam_func_view.result | 144 +++++++++--------- .../suite/funcs_1/r/myisam_views.result | 12 +- .../suite/funcs_1/r/ndb_func_view.result | 144 +++++++++--------- mysql-test/suite/funcs_1/r/ndb_views.result | 12 +- mysql-test/suite/funcs_1/r/storedproc.result | 11 +- 9 files changed, 316 insertions(+), 319 deletions(-) diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result index b19252e4dd7..e788dfd9fc1 100644 --- a/mysql-test/suite/funcs_1/r/innodb_func_view.result +++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result @@ -910,13 +910,13 @@ SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double), my_double, id FROM t WHERE select_id = 151 OR select_id IS NULL order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -925,13 +925,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 151 OR select_id IS NULL) order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -1354,8 +1354,8 @@ my_double, id FROM t1_values WHERE select_id = 133 OR select_id IS NULL order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -1366,8 +1366,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 133 OR select_id IS NULL) order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -1682,8 +1682,8 @@ WHERE select_id = 121 OR select_id IS NULL order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; @@ -1696,8 +1696,8 @@ WHERE select_id = 121 OR select_id IS NULL) order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 DROP VIEW v1; @@ -2014,8 +2014,8 @@ my_double, id FROM t1_values WHERE select_id = 109 OR select_id IS NULL order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 SHOW CREATE VIEW v1; @@ -2026,8 +2026,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 109 OR select_id IS NULL) order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 DROP VIEW v1; @@ -2562,13 +2562,13 @@ my_double, id FROM t1_values WHERE select_id = 89 OR select_id IS NULL order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2577,13 +2577,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 89 OR select_id IS NULL) order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -2930,13 +2930,13 @@ my_double, id FROM t1_values WHERE select_id = 77 OR select_id IS NULL order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2945,13 +2945,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 77 OR select_id IS NULL) order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -3288,8 +3288,8 @@ my_double, id FROM t1_values WHERE select_id = 65 OR select_id IS NULL order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3306,8 +3306,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 65 OR select_id IS NULL) order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3680,14 +3680,14 @@ my_double, id FROM t1_values WHERE select_id = 53 OR select_id IS NULL order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3696,14 +3696,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 53 OR select_id IS NULL) order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' DROP VIEW v1; @@ -4042,14 +4042,14 @@ my_double, id FROM t1_values WHERE select_id = 42 OR select_id IS NULL order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4061,14 +4061,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 42 OR select_id IS NULL) order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4416,14 +4416,14 @@ my_double, id FROM t1_values WHERE select_id = 31 OR select_id IS NULL order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' SHOW CREATE VIEW v1; @@ -4434,14 +4434,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 31 OR select_id IS NULL) order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' DROP VIEW v1; @@ -4776,8 +4776,8 @@ my_double, id FROM t1_values WHERE select_id = 20 OR select_id IS NULL order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -4788,8 +4788,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 20 OR select_id IS NULL) order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -5088,8 +5088,8 @@ my_double, id FROM t1_values WHERE select_id = 8 OR select_id IS NULL order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -5100,8 +5100,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 8 OR select_id IS NULL) order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index 9511aa973e5..b4bce0b0d1b 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -22824,7 +22824,7 @@ f1 f2 ABC 3 SELECT * FROM v1 order by 2; f1 my_sqrt -ABC 1.73205080756888 +ABC 1.7320508075688772 ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30); INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF'; DESCRIBE t1; @@ -22842,7 +22842,7 @@ ABC DEF SELECT * FROM v1 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -22865,7 +22865,7 @@ my_sqrt double YES NULL SELECT * FROM v2 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -22876,7 +22876,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v1; Warnings: @@ -22885,7 +22885,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v2; Warnings: @@ -22894,7 +22894,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t1; DROP TABLE t2; DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result index eb3d326808f..3b1f1b03728 100644 --- a/mysql-test/suite/funcs_1/r/memory_func_view.result +++ b/mysql-test/suite/funcs_1/r/memory_func_view.result @@ -911,13 +911,13 @@ SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double), my_double, id FROM t WHERE select_id = 151 OR select_id IS NULL order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -926,13 +926,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 151 OR select_id IS NULL) order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -1355,8 +1355,8 @@ my_double, id FROM t1_values WHERE select_id = 133 OR select_id IS NULL order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -1367,8 +1367,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 133 OR select_id IS NULL) order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -1683,8 +1683,8 @@ WHERE select_id = 121 OR select_id IS NULL order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; @@ -1697,8 +1697,8 @@ WHERE select_id = 121 OR select_id IS NULL) order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 DROP VIEW v1; @@ -2015,8 +2015,8 @@ my_double, id FROM t1_values WHERE select_id = 109 OR select_id IS NULL order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 SHOW CREATE VIEW v1; @@ -2027,8 +2027,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 109 OR select_id IS NULL) order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 DROP VIEW v1; @@ -2563,13 +2563,13 @@ my_double, id FROM t1_values WHERE select_id = 89 OR select_id IS NULL order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2578,13 +2578,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 89 OR select_id IS NULL) order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -2931,13 +2931,13 @@ my_double, id FROM t1_values WHERE select_id = 77 OR select_id IS NULL order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2946,13 +2946,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 77 OR select_id IS NULL) order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -3289,8 +3289,8 @@ my_double, id FROM t1_values WHERE select_id = 65 OR select_id IS NULL order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3307,8 +3307,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 65 OR select_id IS NULL) order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3681,14 +3681,14 @@ my_double, id FROM t1_values WHERE select_id = 53 OR select_id IS NULL order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3697,14 +3697,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 53 OR select_id IS NULL) order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' DROP VIEW v1; @@ -4043,14 +4043,14 @@ my_double, id FROM t1_values WHERE select_id = 42 OR select_id IS NULL order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4062,14 +4062,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 42 OR select_id IS NULL) order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4417,14 +4417,14 @@ my_double, id FROM t1_values WHERE select_id = 31 OR select_id IS NULL order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' SHOW CREATE VIEW v1; @@ -4435,14 +4435,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 31 OR select_id IS NULL) order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' DROP VIEW v1; @@ -4777,8 +4777,8 @@ my_double, id FROM t1_values WHERE select_id = 20 OR select_id IS NULL order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -4789,8 +4789,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 20 OR select_id IS NULL) order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -5089,8 +5089,8 @@ my_double, id FROM t1_values WHERE select_id = 8 OR select_id IS NULL order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -5101,8 +5101,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 8 OR select_id IS NULL) order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index 7f3a0efb8b8..2f7342088f8 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -22826,7 +22826,7 @@ f1 f2 ABC 3 SELECT * FROM v1 order by 2; f1 my_sqrt -ABC 1.73205080756888 +ABC 1.7320508075688772 ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30); INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF'; DESCRIBE t1; @@ -22844,7 +22844,7 @@ ABC DEF SELECT * FROM v1 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -22867,7 +22867,7 @@ my_sqrt double YES NULL SELECT * FROM v2 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -22878,7 +22878,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v1; Warnings: @@ -22887,7 +22887,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v2; Warnings: @@ -22896,7 +22896,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t1; DROP TABLE t2; DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result index eb3d326808f..3b1f1b03728 100644 --- a/mysql-test/suite/funcs_1/r/myisam_func_view.result +++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result @@ -911,13 +911,13 @@ SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double), my_double, id FROM t WHERE select_id = 151 OR select_id IS NULL order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -926,13 +926,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 151 OR select_id IS NULL) order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -1355,8 +1355,8 @@ my_double, id FROM t1_values WHERE select_id = 133 OR select_id IS NULL order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -1367,8 +1367,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 133 OR select_id IS NULL) order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -1683,8 +1683,8 @@ WHERE select_id = 121 OR select_id IS NULL order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; @@ -1697,8 +1697,8 @@ WHERE select_id = 121 OR select_id IS NULL) order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 DROP VIEW v1; @@ -2015,8 +2015,8 @@ my_double, id FROM t1_values WHERE select_id = 109 OR select_id IS NULL order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 SHOW CREATE VIEW v1; @@ -2027,8 +2027,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 109 OR select_id IS NULL) order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 DROP VIEW v1; @@ -2563,13 +2563,13 @@ my_double, id FROM t1_values WHERE select_id = 89 OR select_id IS NULL order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2578,13 +2578,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 89 OR select_id IS NULL) order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -2931,13 +2931,13 @@ my_double, id FROM t1_values WHERE select_id = 77 OR select_id IS NULL order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2946,13 +2946,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 77 OR select_id IS NULL) order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -3289,8 +3289,8 @@ my_double, id FROM t1_values WHERE select_id = 65 OR select_id IS NULL order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3307,8 +3307,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 65 OR select_id IS NULL) order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3681,14 +3681,14 @@ my_double, id FROM t1_values WHERE select_id = 53 OR select_id IS NULL order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3697,14 +3697,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 53 OR select_id IS NULL) order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' DROP VIEW v1; @@ -4043,14 +4043,14 @@ my_double, id FROM t1_values WHERE select_id = 42 OR select_id IS NULL order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4062,14 +4062,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 42 OR select_id IS NULL) order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4417,14 +4417,14 @@ my_double, id FROM t1_values WHERE select_id = 31 OR select_id IS NULL order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' SHOW CREATE VIEW v1; @@ -4435,14 +4435,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 31 OR select_id IS NULL) order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' DROP VIEW v1; @@ -4777,8 +4777,8 @@ my_double, id FROM t1_values WHERE select_id = 20 OR select_id IS NULL order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -4789,8 +4789,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 20 OR select_id IS NULL) order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -5089,8 +5089,8 @@ my_double, id FROM t1_values WHERE select_id = 8 OR select_id IS NULL order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -5101,8 +5101,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 8 OR select_id IS NULL) order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views.result index 65ad319d642..b77ea8a4bd9 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views.result +++ b/mysql-test/suite/funcs_1/r/myisam_views.result @@ -24528,7 +24528,7 @@ f1 f2 ABC 3 SELECT * FROM v1 order by 2; f1 my_sqrt -ABC 1.73205080756888 +ABC 1.7320508075688772 ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30); INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF'; DESCRIBE t1; @@ -24546,7 +24546,7 @@ ABC DEF SELECT * FROM v1 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -24569,7 +24569,7 @@ my_sqrt double YES NULL SELECT * FROM v2 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -24580,7 +24580,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v1; Warnings: @@ -24589,7 +24589,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v2; Warnings: @@ -24598,7 +24598,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t1; DROP TABLE t2; DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/ndb_func_view.result b/mysql-test/suite/funcs_1/r/ndb_func_view.result index b19252e4dd7..e788dfd9fc1 100644 --- a/mysql-test/suite/funcs_1/r/ndb_func_view.result +++ b/mysql-test/suite/funcs_1/r/ndb_func_view.result @@ -910,13 +910,13 @@ SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double), my_double, id FROM t WHERE select_id = 151 OR select_id IS NULL order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -925,13 +925,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 151 OR select_id IS NULL) order by id; LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id NULL NULL 1 - -1.7976931348623e+308 2 -AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e+308 3 + -1.7976931348623e308 2 +AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -1354,8 +1354,8 @@ my_double, id FROM t1_values WHERE select_id = 133 OR select_id IS NULL order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -1366,8 +1366,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 133 OR select_id IS NULL) order by id; IFNULL(my_double,'IS_NULL') my_double id IS_NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -1682,8 +1682,8 @@ WHERE select_id = 121 OR select_id IS NULL order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 SHOW CREATE VIEW v1; @@ -1696,8 +1696,8 @@ WHERE select_id = 121 OR select_id IS NULL) order by id; IF(my_double IS NULL, 'IS NULL', 'IS NOT NULL') my_double id IS NULL NULL 1 -IS NOT NULL -1.7976931348623e+308 2 -IS NOT NULL 1.7976931348623e+308 3 +IS NOT NULL -1.7976931348623e308 2 +IS NOT NULL 1.7976931348623e308 3 IS NOT NULL 0 4 IS NOT NULL -1 5 DROP VIEW v1; @@ -2014,8 +2014,8 @@ my_double, id FROM t1_values WHERE select_id = 109 OR select_id IS NULL order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 SHOW CREATE VIEW v1; @@ -2026,8 +2026,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 109 OR select_id IS NULL) order by id; IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id IS NOT TRUE NULL 1 -IS TRUE -1.7976931348623e+308 2 -IS TRUE 1.7976931348623e+308 3 +IS TRUE -1.7976931348623e308 2 +IS TRUE 1.7976931348623e308 3 IS NOT TRUE 0 4 IS TRUE -1 5 DROP VIEW v1; @@ -2562,13 +2562,13 @@ my_double, id FROM t1_values WHERE select_id = 89 OR select_id IS NULL order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2577,13 +2577,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 89 OR select_id IS NULL) order by id; CAST(my_double AS UNSIGNED INTEGER) my_double id NULL NULL 1 -9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -2930,13 +2930,13 @@ my_double, id FROM t1_values WHERE select_id = 77 OR select_id IS NULL order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2945,13 +2945,13 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 77 OR select_id IS NULL) order by id; CAST(my_double AS SIGNED INTEGER) my_double id NULL NULL 1 --9223372036854775808 -1.7976931348623e+308 2 -9223372036854775807 1.7976931348623e+308 3 +-9223372036854775808 -1.7976931348623e308 2 +9223372036854775807 1.7976931348623e308 3 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' DROP VIEW v1; @@ -3288,8 +3288,8 @@ my_double, id FROM t1_values WHERE select_id = 65 OR select_id IS NULL order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3306,8 +3306,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 65 OR select_id IS NULL) order by id; CAST(my_double AS DECIMAL(37,2)) my_double id NULL NULL 1 --99999999999999999999999999999999999.99 -1.7976931348623e+308 2 -99999999999999999999999999999999999.99 1.7976931348623e+308 3 +-99999999999999999999999999999999999.99 -1.7976931348623e308 2 +99999999999999999999999999999999999.99 1.7976931348623e308 3 0.00 0 4 -1.00 -1 5 -3333.33 -3333.3333 30 @@ -3680,14 +3680,14 @@ my_double, id FROM t1_values WHERE select_id = 53 OR select_id IS NULL order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3696,14 +3696,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 53 OR select_id IS NULL) order by id; CAST(my_double AS TIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 00:00:00 0 4 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Truncated incorrect time value: '-1.7976931348623e308' +Warning 1292 Truncated incorrect time value: '1.7976931348623e308' DROP VIEW v1; @@ -4042,14 +4042,14 @@ my_double, id FROM t1_values WHERE select_id = 42 OR select_id IS NULL order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4061,14 +4061,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 42 OR select_id IS NULL) order by id; CAST(my_double AS DATETIME) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' Warning 1292 Incorrect datetime value: '200506271758' @@ -4416,14 +4416,14 @@ my_double, id FROM t1_values WHERE select_id = 31 OR select_id IS NULL order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' SHOW CREATE VIEW v1; @@ -4434,14 +4434,14 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 31 OR select_id IS NULL) order by id; CAST(my_double AS DATE) my_double id NULL NULL 1 -NULL -1.7976931348623e+308 2 -NULL 1.7976931348623e+308 3 +NULL -1.7976931348623e308 2 +NULL 1.7976931348623e308 3 NULL 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e308' +Warning 1292 Incorrect datetime value: '1.7976931348623e308' Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '-1' DROP VIEW v1; @@ -4776,8 +4776,8 @@ my_double, id FROM t1_values WHERE select_id = 20 OR select_id IS NULL order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -4788,8 +4788,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 20 OR select_id IS NULL) order by id; CAST(my_double AS CHAR) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; @@ -5088,8 +5088,8 @@ my_double, id FROM t1_values WHERE select_id = 8 OR select_id IS NULL order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 SHOW CREATE VIEW v1; @@ -5100,8 +5100,8 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 8 OR select_id IS NULL) order by id; CAST(my_double AS BINARY) my_double id NULL NULL 1 --1.7976931348623e+308 -1.7976931348623e+308 2 -1.7976931348623e+308 1.7976931348623e+308 3 +-1.7976931348623e308 -1.7976931348623e308 2 +1.7976931348623e308 1.7976931348623e308 3 0 0 4 -1 -1 5 DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result index 79020adbc50..10cb7613f47 100644 --- a/mysql-test/suite/funcs_1/r/ndb_views.result +++ b/mysql-test/suite/funcs_1/r/ndb_views.result @@ -22824,7 +22824,7 @@ f1 f2 ABC 3 SELECT * FROM v1 order by 2; f1 my_sqrt -ABC 1.73205080756888 +ABC 1.7320508075688772 ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30); INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF'; DESCRIBE t1; @@ -22842,7 +22842,7 @@ ABC DEF SELECT * FROM v1 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -22865,7 +22865,7 @@ my_sqrt double YES NULL SELECT * FROM v2 order by 2; f1 my_sqrt ABC 0 -ABC 1.73205080756888 +ABC 1.7320508075688772 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'DEF' Warning 1292 Truncated incorrect DOUBLE value: 'DEF' @@ -22876,7 +22876,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v1; Warnings: @@ -22885,7 +22885,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t2; CREATE TABLE t2 AS SELECT * FROM v2; Warnings: @@ -22894,7 +22894,7 @@ SELECT * FROM t2 order by 2; f1 ABC my_sqrt 0 f1 ABC -my_sqrt 1.73205080756888 +my_sqrt 1.7320508075688772 DROP TABLE t1; DROP TABLE t2; DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index cda55e92ac8..f08c52322f3 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -182,12 +182,9 @@ db_storedproc func_1 FUNCTION root@localhost INVOKER this i UPDATE t1_aux SET f1 = NULL; SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux; UPDATE t1_aux SET f1 = 1.7976931348623157493578e+308; -ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing SELECT f1 INTO @v1_tab FROM t1_aux; CALL sproc_1(1.7976931348623157493578e+308, @v1_proc); -ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing SET @v1_func = func_1(1.7976931348623157493578e+308); -ERROR 22007: Illegal double '1.7976931348623157493578e+308' value found during parsing UPDATE t1_aux SET f1 = NULL; SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux; UPDATE t1_aux SET f1 = 0.1234567890987654321e+100; @@ -17092,7 +17089,7 @@ return f1; END// SELECT fn77(1.1); fn77(1.1) -1.1 +1.0999999999999996 DROP FUNCTION IF EXISTS fn78; CREATE FUNCTION fn78( f1 real unsigned) returns real unsigned BEGIN @@ -18256,7 +18253,7 @@ SELECT f1; END// CALL sp77(1.1); f1 -1.1 +1.0999999999999996 DROP PROCEDURE IF EXISTS sp78; CREATE PROCEDURE sp78( f1 real unsigned) BEGIN @@ -19457,9 +19454,9 @@ SELECT var1, var2, var3, var4, var5, var6, var7, var8; END// CALL spexecute24(); f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 -1.1 1.1 11.1 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 +1.0999999999999996 1.0999999999999996 11.1 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 var1 var2 var3 var4 var5 var6 var7 var8 -1.1 11.1 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 +1.0999999999999996 11.1 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 DROP PROCEDURE spexecute24; DROP PROCEDURE sp24; DROP PROCEDURE IF EXISTS sp25; From b8db5f5c7466f4ca4365d0f0bcbc382fc45a9a47 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 23 Dec 2009 08:52:18 +0300 Subject: [PATCH 44/86] Fixed more PB2 test failures introduced by backporting WL#2934. --- mysql-test/r/mysqlbinlog_row_innodb.result | 32 +++++++++++----------- mysql-test/r/mysqlbinlog_row_myisam.result | 32 +++++++++++----------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/r/mysqlbinlog_row_innodb.result index cf59d23bcf1..3eb4774ae4e 100644 --- a/mysql-test/r/mysqlbinlog_row_innodb.result +++ b/mysql-test/r/mysqlbinlog_row_innodb.result @@ -495,10 +495,10 @@ c15 0000000000 c16 -9223372036854775808 c17 0 c18 00000000000000000000 -c19 -3.40282e+38 +c19 -3.40282e38 c20 1.17549e-38 c21 000000000000 -c22 -1.7976931348623e+308 +c22 -1.7976931348623e308 c23 2.2250738585072e-308 c24 0000000000000000000000 c25 -9999999999 @@ -574,12 +574,12 @@ c15 4294967295 c16 9223372036854775807 c17 18446744073709551615 c18 18446744073709551615 -c19 3.40282e+38 -c20 3.40282e+38 -c21 03.40282e+38 -c22 1.7976931348623e+308 -c23 1.7976931348623e+308 -c24 001.7976931348623e+308 +c19 3.40282e38 +c20 3.40282e38 +c21 003.40282e38 +c22 1.7976931348623e308 +c23 1.7976931348623e308 +c24 0001.7976931348623e308 c25 9999999999 c26 9999999999 c27 9999999999 @@ -1557,12 +1557,12 @@ c15 4294967295 c16 9223372036854775807 c17 18446744073709551615 c18 18446744073709551615 -c19 3.40282e+38 -c20 3.40282e+38 -c21 03.40282e+38 -c22 1.7976931348623e+308 -c23 1.7976931348623e+308 -c24 001.7976931348623e+308 +c19 3.40282e38 +c20 3.40282e38 +c21 003.40282e38 +c22 1.7976931348623e308 +c23 1.7976931348623e308 +c24 0001.7976931348623e308 c25 9999999999 c26 9999999999 c27 9999999999 @@ -1636,10 +1636,10 @@ c15 0000000000 c16 -9223372036854775808 c17 0 c18 00000000000000000000 -c19 -3.40282e+38 +c19 -3.40282e38 c20 1.17549e-38 c21 000000000000 -c22 -1.7976931348623e+308 +c22 -1.7976931348623e308 c23 2.2250738585072e-308 c24 0000000000000000000000 c25 -9999999999 diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/r/mysqlbinlog_row_myisam.result index 973786d698e..b673d36c452 100644 --- a/mysql-test/r/mysqlbinlog_row_myisam.result +++ b/mysql-test/r/mysqlbinlog_row_myisam.result @@ -495,10 +495,10 @@ c15 0000000000 c16 -9223372036854775808 c17 0 c18 00000000000000000000 -c19 -3.40282e+38 +c19 -3.40282e38 c20 1.17549e-38 c21 000000000000 -c22 -1.7976931348623e+308 +c22 -1.7976931348623e308 c23 2.2250738585072e-308 c24 0000000000000000000000 c25 -9999999999 @@ -574,12 +574,12 @@ c15 4294967295 c16 9223372036854775807 c17 18446744073709551615 c18 18446744073709551615 -c19 3.40282e+38 -c20 3.40282e+38 -c21 03.40282e+38 -c22 1.7976931348623e+308 -c23 1.7976931348623e+308 -c24 001.7976931348623e+308 +c19 3.40282e38 +c20 3.40282e38 +c21 003.40282e38 +c22 1.7976931348623e308 +c23 1.7976931348623e308 +c24 0001.7976931348623e308 c25 9999999999 c26 9999999999 c27 9999999999 @@ -1557,12 +1557,12 @@ c15 4294967295 c16 9223372036854775807 c17 18446744073709551615 c18 18446744073709551615 -c19 3.40282e+38 -c20 3.40282e+38 -c21 03.40282e+38 -c22 1.7976931348623e+308 -c23 1.7976931348623e+308 -c24 001.7976931348623e+308 +c19 3.40282e38 +c20 3.40282e38 +c21 003.40282e38 +c22 1.7976931348623e308 +c23 1.7976931348623e308 +c24 0001.7976931348623e308 c25 9999999999 c26 9999999999 c27 9999999999 @@ -1636,10 +1636,10 @@ c15 0000000000 c16 -9223372036854775808 c17 0 c18 00000000000000000000 -c19 -3.40282e+38 +c19 -3.40282e38 c20 1.17549e-38 c21 000000000000 -c22 -1.7976931348623e+308 +c22 -1.7976931348623e308 c23 2.2250738585072e-308 c24 0000000000000000000000 c25 -9999999999 From 3bfb8797d017f8f9f13aecd82f6c08ad6619c5bb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Dec 2009 09:27:41 +0100 Subject: [PATCH 45/86] fix atomic/solaris.h to conform remove duplicated boilerplate code --- include/atomic/nolock.h | 6 +- include/atomic/solaris.h | 246 +++++---------------------------------- include/my_atomic.h | 4 +- 3 files changed, 31 insertions(+), 225 deletions(-) diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h index 9ec5eb5a2fd..5a0c41d9078 100644 --- a/include/atomic/nolock.h +++ b/include/atomic/nolock.h @@ -50,11 +50,7 @@ # endif #endif -#if defined(make_atomic_cas_body) || defined(MY_ATOMICS_MADE) -/* - * We have atomics that require no locking - */ -#define MY_ATOMIC_NOLOCK +#if defined(make_atomic_cas_body) /* Type not used so minimal size (emptry struct has different size between C and C++, zero-length array is gcc-specific). diff --git a/include/atomic/solaris.h b/include/atomic/solaris.h index 34c0c6de0ed..fc9f369c707 100644 --- a/include/atomic/solaris.h +++ b/include/atomic/solaris.h @@ -13,242 +13,54 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifndef _atomic_h_cleanup_ +#define _atomic_h_cleanup_ "atomic/solaris.h" + #include #define MY_ATOMIC_MODE "solaris-atomic" -/* - * This is defined to indicate we fully define the my_atomic_* (inline) - * functions here, so there is no need to "make" them in my_atomic.h - * using make_atomic_* and make_atomic_*_body. - */ -#define MY_ATOMICS_MADE +#define uintptr_t void * +#define atomic_or_ptr_nv(X,Y) (void *)atomic_or_ulong_nv((volatile ulong_t *)X, Y) -STATIC_INLINE int -my_atomic_cas8(int8 volatile *a, int8 *cmp, int8 set) -{ - int ret; - int8 sav; - sav = (int8) atomic_cas_8((volatile uint8_t *)a, (uint8_t)*cmp, - (uint8_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} +#define make_atomic_cas_body(S) \ + uint ## S ## _t sav; \ + sav = atomic_cas_ ## S( \ + (volatile uint ## S ## _t *)a, \ + (uint ## S ## _t)*cmp, \ + (uint ## S ## _t)set); \ + if (! (ret= (sav == *cmp))) \ + *cmp= sav; -STATIC_INLINE int -my_atomic_cas16(int16 volatile *a, int16 *cmp, int16 set) -{ - int ret; - int16 sav; - sav = (int16) atomic_cas_16((volatile uint16_t *)a, (uint16_t)*cmp, - (uint16_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -STATIC_INLINE int -my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set) -{ - int ret; - int32 sav; - sav = (int32) atomic_cas_32((volatile uint32_t *)a, (uint32_t)*cmp, - (uint32_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -STATIC_INLINE int -my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set) -{ - int ret; - int64 sav; - sav = (int64) atomic_cas_64((volatile uint64_t *)a, (uint64_t)*cmp, - (uint64_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -STATIC_INLINE int -my_atomic_casptr(void * volatile *a, void **cmp, void *set) -{ - int ret; - void *sav; - sav = atomic_cas_ptr(a, *cmp, set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -/* ------------------------------------------------------------------------ */ - -STATIC_INLINE int8 -my_atomic_add8(int8 volatile *a, int8 v) -{ - int8 nv; - nv = atomic_add_8_nv((volatile uint8_t *)a, v); - return (nv - v); -} - -STATIC_INLINE int16 -my_atomic_add16(int16 volatile *a, int16 v) -{ - int16 nv; - nv = atomic_add_16_nv((volatile uint16_t *)a, v); - return (nv - v); -} - -STATIC_INLINE int32 -my_atomic_add32(int32 volatile *a, int32 v) -{ - int32 nv; - nv = atomic_add_32_nv((volatile uint32_t *)a, v); - return (nv - v); -} - -STATIC_INLINE int64 -my_atomic_add64(int64 volatile *a, int64 v) -{ - int64 nv; - nv = atomic_add_64_nv((volatile uint64_t *)a, v); - return (nv - v); -} +#define make_atomic_add_body(S) \ + int ## S nv; /* new value */ \ + nv= atomic_add_ ## S ## _nv((volatile uint ## S ## _t *)a, v); \ + v= nv - v /* ------------------------------------------------------------------------ */ #ifdef MY_ATOMIC_MODE_DUMMY -STATIC_INLINE int8 -my_atomic_load8(int8 volatile *a) { return (*a); } - -STATIC_INLINE int16 -my_atomic_load16(int16 volatile *a) { return (*a); } - -STATIC_INLINE int32 -my_atomic_load32(int32 volatile *a) { return (*a); } - -STATIC_INLINE int64 -my_atomic_load64(int64 volatile *a) { return (*a); } - -STATIC_INLINE void * -my_atomic_loadptr(void * volatile *a) { return (*a); } - -/* ------------------------------------------------------------------------ */ - -STATIC_INLINE void -my_atomic_store8(int8 volatile *a, int8 v) { *a = v; } - -STATIC_INLINE void -my_atomic_store16(int16 volatile *a, int16 v) { *a = v; } - -STATIC_INLINE void -my_atomic_store32(int32 volatile *a, int32 v) { *a = v; } - -STATIC_INLINE void -my_atomic_store64(int64 volatile *a, int64 v) { *a = v; } - -STATIC_INLINE void -my_atomic_storeptr(void * volatile *a, void *v) { *a = v; } - -/* ------------------------------------------------------------------------ */ +#define make_atomic_load_body(S) ret= *a +#define make_atomic_store_body(S) *a= v #else /* MY_ATOMIC_MODE_DUMMY */ -STATIC_INLINE int8 -my_atomic_load8(int8 volatile *a) -{ - return ((int8) atomic_or_8_nv((volatile uint8_t *)a, 0)); -} +#define make_atomic_load_body(S) \ + ret= atomic_or_ ## S ## _nv((volatile uint ## S ## _t *)a, 0) -STATIC_INLINE int16 -my_atomic_load16(int16 volatile *a) -{ - return ((int16) atomic_or_16_nv((volatile uint16_t *)a, 0)); -} - -STATIC_INLINE int32 -my_atomic_load32(int32 volatile *a) -{ - return ((int32) atomic_or_32_nv((volatile uint32_t *)a, 0)); -} - -STATIC_INLINE int64 -my_atomic_load64(int64 volatile *a) -{ - return ((int64) atomic_or_64_nv((volatile uint64_t *)a, 0)); -} - -STATIC_INLINE void * -my_atomic_loadptr(void * volatile *a) -{ - return ((void *) atomic_or_ulong_nv((volatile ulong_t *)a, 0)); -} - -/* ------------------------------------------------------------------------ */ - -STATIC_INLINE void -my_atomic_store8(int8 volatile *a, int8 v) -{ - (void) atomic_swap_8((volatile uint8_t *)a, (uint8_t)v); -} - -STATIC_INLINE void -my_atomic_store16(int16 volatile *a, int16 v) -{ - (void) atomic_swap_16((volatile uint16_t *)a, (uint16_t)v); -} - -STATIC_INLINE void -my_atomic_store32(int32 volatile *a, int32 v) -{ - (void) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v); -} - -STATIC_INLINE void -my_atomic_store64(int64 volatile *a, int64 v) -{ - (void) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v); -} - -STATIC_INLINE void -my_atomic_storeptr(void * volatile *a, void *v) -{ - (void) atomic_swap_ptr(a, v); -} +#define make_atomic_store_body(S) \ + (void) atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) #endif -/* ------------------------------------------------------------------------ */ +#define make_atomic_fas_body(S) \ + v= atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) -STATIC_INLINE int8 -my_atomic_fas8(int8 volatile *a, int8 v) -{ - return ((int8) atomic_swap_8((volatile uint8_t *)a, (uint8_t)v)); -} +#else /* cleanup */ -STATIC_INLINE int16 -my_atomic_fas16(int16 volatile *a, int16 v) -{ - return ((int16) atomic_swap_16((volatile uint16_t *)a, (uint16_t)v)); -} +#undef uintptr_t +#undef atomic_or_ptr_nv -STATIC_INLINE int32 -my_atomic_fas32(int32 volatile *a, int32 v) -{ - return ((int32) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v)); -} +#endif -STATIC_INLINE int64 -my_atomic_fas64(int64 volatile *a, int64 v) -{ - return ((int64) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v)); -} - -STATIC_INLINE void * -my_atomic_fasptr(void * volatile *a, void *v) -{ - return (atomic_swap_ptr(a, v)); -} diff --git a/include/my_atomic.h b/include/my_atomic.h index 751afcb77db..b506aa7d3d1 100644 --- a/include/my_atomic.h +++ b/include/my_atomic.h @@ -68,12 +68,11 @@ #include "atomic/nolock.h" #endif -#ifndef MY_ATOMIC_NOLOCK +#ifndef make_atomic_cas_body /* nolock.h was not able to generate even a CAS function, fall back */ #include "atomic/rwlock.h" #endif -#ifndef MY_ATOMICS_MADE /* define missing functions by using the already generated ones */ #ifndef make_atomic_add_body #define make_atomic_add_body(S) \ @@ -287,7 +286,6 @@ make_atomic_store(ptr) #undef make_atomic_load_body #undef make_atomic_store_body #undef make_atomic_fas_body -#endif #undef intptr /* From f87816b450055e9815ced19d47a224bc58e9bfcc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Dec 2009 18:43:45 +0800 Subject: [PATCH 46/86] 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 924e048e9845c33dca097f2ddcb2f9ad24ad9a67 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 23 Dec 2009 15:04:32 +0300 Subject: [PATCH 47/86] Fixed test failures from the 'parts' suite introduced by backporting WL#2934. --- .../parts/r/partition_float_innodb.result | 50 +++++++++---------- .../parts/r/partition_float_myisam.result | 50 +++++++++---------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/mysql-test/suite/parts/r/partition_float_innodb.result b/mysql-test/suite/parts/r/partition_float_innodb.result index 917358dc54a..d2f04a68629 100644 --- a/mysql-test/suite/parts/r/partition_float_innodb.result +++ b/mysql-test/suite/parts/r/partition_float_innodb.result @@ -18,25 +18,25 @@ t1 CREATE TABLE `t1` ( insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a --3.40282e+38 +-3.40282e38 -1.5 -1 0 1 1.5 -3.40282e+38 +3.40282e38 select * from t1 where a=1.5; a 1.5 delete from t1 where a=1.5; select * from t1; a --3.40282e+38 +-3.40282e38 -1.5 -1 0 1 -3.40282e+38 +3.40282e38 drop table t1; create table t2 (a float not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 10; @@ -51,37 +51,37 @@ PARTITIONS 10 */ insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5); select * from t2; a --3.40282e+38 --3.40282e+37 +-3.40282e38 +-3.40282e37 -123.456 0 1.5 123.456 -1.23455e+06 +1234550 select * from t2 where a=123.456; a delete from t2 where a=123.456; select * from t2; a --3.40282e+38 --3.40282e+37 +-3.40282e38 +-3.40282e37 -123.456 0 1.5 123.456 -1.23455e+06 +1234550 select * from t2 where a=1.5; a 1.5 delete from t2 where a=1.5; select * from t2; a --3.40282e+38 --3.40282e+37 +-3.40282e38 +-3.40282e37 -123.456 0 123.456 -1.23455e+06 +1234550 delete from t2; 1024*3 inserts; select count(*) from t2; @@ -108,27 +108,27 @@ t1 CREATE TABLE `t1` ( insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1.5 1234.567 -2.2250738585072e+208 +2.2250738585072016e208 select * from t1 where a=1.5; a 1.5 delete from t1 where a=1.5; select * from t1; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1234.567 -2.2250738585072e+208 +2.2250738585072016e208 drop table t1; create table t2 (a double not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 10; @@ -143,27 +143,27 @@ PARTITIONS 10 */ insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t2; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1.5 1234.567 -2.2250738585072e+208 +2.2250738585072016e208 select * from t2 where a=1234.567; a 1234.567 delete from t2 where a=1234.567; select * from t2; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1.5 -2.2250738585072e+208 +2.2250738585072016e208 delete from t2; 1024*3 inserts; select count(*) from t2; diff --git a/mysql-test/suite/parts/r/partition_float_myisam.result b/mysql-test/suite/parts/r/partition_float_myisam.result index 3f9390f6ba9..2d52d095989 100644 --- a/mysql-test/suite/parts/r/partition_float_myisam.result +++ b/mysql-test/suite/parts/r/partition_float_myisam.result @@ -18,25 +18,25 @@ t1 CREATE TABLE `t1` ( insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a --3.40282e+38 +-3.40282e38 -1.5 -1 0 1 1.5 -3.40282e+38 +3.40282e38 select * from t1 where a=1.5; a 1.5 delete from t1 where a=1.5; select * from t1; a --3.40282e+38 +-3.40282e38 -1.5 -1 0 1 -3.40282e+38 +3.40282e38 drop table t1; create table t2 (a float not null, primary key(a)) engine='MYISAM' partition by key (a) partitions 10; @@ -51,37 +51,37 @@ PARTITIONS 10 */ insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5); select * from t2; a --3.40282e+38 --3.40282e+37 +-3.40282e38 +-3.40282e37 -123.456 0 1.5 123.456 -1.23455e+06 +1234550 select * from t2 where a=123.456; a delete from t2 where a=123.456; select * from t2; a --3.40282e+38 --3.40282e+37 +-3.40282e38 +-3.40282e37 -123.456 0 1.5 123.456 -1.23455e+06 +1234550 select * from t2 where a=1.5; a 1.5 delete from t2 where a=1.5; select * from t2; a --3.40282e+38 --3.40282e+37 +-3.40282e38 +-3.40282e37 -123.456 0 123.456 -1.23455e+06 +1234550 delete from t2; 16384*3 inserts; select count(*) from t2; @@ -108,27 +108,27 @@ t1 CREATE TABLE `t1` ( insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1.5 1234.567 -2.2250738585072e+208 +2.2250738585072016e208 select * from t1 where a=1.5; a 1.5 delete from t1 where a=1.5; select * from t1; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1234.567 -2.2250738585072e+208 +2.2250738585072016e208 drop table t1; create table t2 (a double not null, primary key(a)) engine='MYISAM' partition by key (a) partitions 10; @@ -143,27 +143,27 @@ PARTITIONS 10 */ insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t2; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1.5 1234.567 -2.2250738585072e+208 +2.2250738585072016e208 select * from t2 where a=1234.567; a 1234.567 delete from t2 where a=1234.567; select * from t2; a --2.2250738585072e+208 +-2.2250738585072016e208 -1.5 -1 --2.2250738585072e-208 +-2.2250738585072014e-208 0 1.5 -2.2250738585072e+208 +2.2250738585072016e208 delete from t2; 16384*3 inserts; select count(*) from t2; From b188b1bfccd70e1f83d528d62b013838bb906995 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Dec 2009 13:06:03 +0100 Subject: [PATCH 48/86] fixed "engine not found" error in open_binary_frm corrected rotten test --- mysql-test/r/not_partition.result | 34 +++++++++++++++---------------- sql/sql_yacc.yy | 4 ++-- sql/table.cc | 1 + 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result index f3a0e4ea0e5..fc3e0d64b5e 100644 --- a/mysql-test/r/not_partition.result +++ b/mysql-test/r/not_partition.result @@ -1,47 +1,47 @@ DROP TABLE IF EXISTS t1; FLUSH TABLES; SELECT * FROM t1; -ERROR 42000: Unknown storage engine 'partition' +ERROR 42000: Unknown storage engine 'partition' TRUNCATE TABLE t1; -ERROR 42000: Unknown storage engine 'partition' +ERROR 42000: Unknown storage engine 'partition' ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze Error Unknown storage engine 'partition' +test.t1 analyze Error Unknown storage engine 'partition' test.t1 analyze error Corrupt CHECK TABLE t1; Table Op Msg_type Msg_text -test.t1 check Error Unknown storage engine 'partition' +test.t1 check Error Unknown storage engine 'partition' test.t1 check error Corrupt OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize Error Unknown storage engine 'partition' +test.t1 optimize Error Unknown storage engine 'partition' test.t1 optimize error Corrupt REPAIR TABLE t1; Table Op Msg_type Msg_text -test.t1 repair Error Unknown storage engine 'partition' +test.t1 repair Error Unknown storage engine 'partition' test.t1 repair error Corrupt ALTER TABLE t1 REPAIR PARTITION ALL; Table Op Msg_type Msg_text -test.t1 repair Error Unknown storage engine 'partition' +test.t1 repair Error Unknown storage engine 'partition' test.t1 repair error Corrupt ALTER TABLE t1 CHECK PARTITION ALL; Table Op Msg_type Msg_text -test.t1 check Error Unknown storage engine 'partition' +test.t1 check Error Unknown storage engine 'partition' test.t1 check error Corrupt ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize Error Unknown storage engine 'partition' +test.t1 optimize Error Unknown storage engine 'partition' test.t1 optimize error Corrupt ALTER TABLE t1 ANALYZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 analyze Error Unknown storage engine 'partition' +test.t1 analyze Error Unknown storage engine 'partition' test.t1 analyze error Corrupt ALTER TABLE t1 REBUILD PARTITION ALL; -ERROR 42000: Unknown storage engine 'partition' +ERROR 42000: Unknown storage engine 'partition' ALTER TABLE t1 ENGINE Memory; -ERROR 42000: Unknown storage engine 'partition' +ERROR 42000: Unknown storage engine 'partition' ALTER TABLE t1 ADD (new INT); -ERROR 42000: Unknown storage engine 'partition' +ERROR 42000: Unknown storage engine 'partition' DROP TABLE t1; CREATE TABLE t1 ( firstname VARCHAR(25) NOT NULL, @@ -52,9 +52,9 @@ joined DATE NOT NULL ) PARTITION BY KEY(joined) PARTITIONS 6; -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2; -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working drop table t1; ERROR 42S02: Unknown table 't1' CREATE TABLE t1 ( @@ -71,7 +71,7 @@ PARTITION p2 VALUES LESS THAN (1980), PARTITION p3 VALUES LESS THAN (1990), PARTITION p4 VALUES LESS THAN MAXVALUE ); -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working drop table t1; ERROR 42S02: Unknown table 't1' CREATE TABLE t1 (id INT, purchased DATE) @@ -82,7 +82,7 @@ PARTITION p0 VALUES LESS THAN (1990), PARTITION p1 VALUES LESS THAN (2000), PARTITION p2 VALUES LESS THAN MAXVALUE ); -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working drop table t1; ERROR 42S02: Unknown table 't1' create table t1 (a varchar(10) charset latin1 collate latin1_bin); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 296316896c9..96cf9167014 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4297,8 +4297,8 @@ have_partitioning: MYSQL_YYABORT; } #else - my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), - "--skip-partition"); + my_error(ER_FEATURE_DISABLED, MYF(0), "partitioning", + "--with-plugin-partition"); MYSQL_YYABORT; #endif } diff --git a/sql/table.cc b/sql/table.cc index eef03955183..ea36a856d2c 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -934,6 +934,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { /* purecov: begin inspected */ error= 8; + name.str[name.length]=0; my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str); my_free(buff, MYF(0)); goto err; From 5b9ed28575e88835209256f66113cba9a0db9d0b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Dec 2009 17:51:03 +0100 Subject: [PATCH 49/86] backport typos found --- sql/sql_plugin.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 953f0b3c680..c5f737434be 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -440,7 +440,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report) (plugin_dl.version >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8)) { free_plugin_mem(&plugin_dl); - report_error(report, ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, 0, + report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, "plugin interface version mismatch"); DBUG_RETURN(0); } @@ -469,8 +469,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report) if (!(sym= dlsym(plugin_dl.handle, plugin_declarations_sym))) { free_plugin_mem(&plugin_dl); - report_error(report, ER_CANT_FIND_DL_ENTRY, MYF(0), - plugin_declarations_sym); + report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_declarations_sym); DBUG_RETURN(0); } From dcf8e115369c4e97ae092d091365ee07e2f819ed Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 24 Dec 2009 01:07:35 +0000 Subject: [PATCH 50/86] 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 51/86] 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 025d86a60a9c797b689b3d3a2b1c626bd3d7f5f3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 24 Dec 2009 12:30:23 +0100 Subject: [PATCH 52/86] slightly more complete mysqld--help test --- mysql-test/include/mysqld--help.inc | 11 ++++++----- mysql-test/r/mysqld--help-notwin.result | 7 +++++++ mysql-test/r/mysqld--help-win.result | 7 +++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc index 11945e6606a..25d0068cec0 100644 --- a/mysql-test/include/mysqld--help.inc +++ b/mysql-test/include/mysqld--help.inc @@ -10,12 +10,11 @@ exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1; perl; - @skipvars=qw/basedir character-sets-dir datadir - general-log-file language lc-messages-dir - log log-slow-queries pid-file plugin-dir slave-load-tmpdir - slow-query-log-file tmpdir open-files-limit/; + @skipvars=qw/basedir open-files-limit general-log-file log + log-slow-queries pid-file slow-query-log-file/; @plugins=qw/innodb ndb ndbcluster safemalloc debug temp-pool - thread-concurrency super-large-pages/; + thread-concurrency super-large-pages mutex-deadlock-detector/; + @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_SHAREDIR/; $re1=join('|', @skipvars, @plugins); $re2=join('|', @plugins); $skip=0; @@ -27,9 +26,11 @@ perl; $skip=0 if /^ -/; $skip=1 if / --($re2)\b/; # fixes for 32-bit + y!\\!/!; s/\b4294967295\b/18446744073709551615/; s/\b2146435072\b/9223372036853727232/; s/\b196608\b/262144/; + foreach $var (@env) { s/$ENV{$var}/$var/ } next if /use --skip-(use-)?symbolic-links to disable/; # for valgrind, again next if $skip; print; diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 623b4a119e4..85c0ea7bd6c 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -744,12 +744,14 @@ 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 @@ -793,8 +795,10 @@ 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) @@ -861,6 +865,7 @@ 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 @@ -901,6 +906,7 @@ 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 @@ -934,6 +940,7 @@ 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 ec621d72bef..4f705156c60 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -748,12 +748,14 @@ 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 @@ -797,7 +799,9 @@ 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) @@ -865,6 +869,7 @@ 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 @@ -907,6 +912,7 @@ 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 @@ -940,6 +946,7 @@ 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 c5f7044d1a055752c30043c425d01bc1a32634cd Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 24 Dec 2009 15:55:46 +0000 Subject: [PATCH 53/86] 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 ac6b2605ffcec457a6ada66fc35c8d03750d98af Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Fri, 25 Dec 2009 00:06:53 +0300 Subject: [PATCH 54/86] Addendum to the backport patch for WL#2934: Unlike other platforms --mfpmath=sse is the default gcc mode on Mac OS X Intel. So it is unnecessary to switch FPU to double precision mode (in fact, it even breaks some math library functions). --- sql/mysqld.cc | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fe7f85f82d2..c2e05c84578 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -191,6 +191,18 @@ typedef fp_except fp_except_t; /* for IRIX to use set_fpc_csr() */ #include #endif +#if defined(__i386__) && !defined(HAVE_FPU_CONTROL_H) +# define fpu_control_t unsigned int +# define _FPU_EXTENDED 0x300 +# define _FPU_DOUBLE 0x200 +# ifdef __GNUC__ +# define _FPU_GETCW(cw) __asm__ __volatile__("fnstcw %0" : "=m" (*&cw)) +# define _FPU_SETCW(cw) __asm__ __volatile__("fldcw %0" : : "m" (*&cw)) +# else +# define _FPU_GETCW(cw) (cw= 0) +# define _FPU_SETCW(cw) +# endif +#endif inline void setup_fpu() { @@ -214,27 +226,17 @@ inline void setup_fpu() #endif /* HAVE_FESETROUND */ /* - x86 (32-bit) requires FPU precision to be explicitly set to 64 bit for - portable results of floating point operations + x86 (32-bit) requires FPU precision to be explicitly set to 64 bit + (double precision) for portable results of floating point operations. + However, there is no need to do so if compiler is using SSE2 for floating + point, double values will be stored and processed in 64 bits anyway. */ -#if defined(__i386__) +#if defined(__i386__) && !defined(__SSE2_MATH__) #if defined(_WIN32) #if !defined(_WIN64) _control87(_PC_53, MCW_PC); #endif /* !_WIN64 */ #else /* !_WIN32 */ -#if !defined(HAVE_FPU_CONTROL_H) -#define fpu_control_t unsigned int -#define _FPU_EXTENDED 0x300 -#define _FPU_DOUBLE 0x200 -#if defined(__GNUC__) -#define _FPU_GETCW(cw) __asm__ __volatile__("fnstcw %0" : "=m" (*&cw)) -#define _FPU_SETCW(cw) __asm__ __volatile__("fldcw %0" : : "m" (*&cw)) -#else /* !__GNUC__ */ -#define _FPU_GETCW(cw) (cw= 0) -#define _FPU_SETCW(cw) -#endif /* __GNUC__ */ -#endif /* !HAVE_FPU_CONTROL_H */ fpu_control_t cw; _FPU_GETCW(cw); cw= (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE; From 7e1e21982963086829fe50906350ea9ac8272d4c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Dec 2009 14:12:49 +0800 Subject: [PATCH 55/86] 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 bd05ac9a6bf5f55e442e116c3ed666894e6ed299 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 25 Dec 2009 22:36:59 +0100 Subject: [PATCH 56/86] don't show --ssl* option if ssl is not compiled in --- Makefile.am | 6 +++--- mysql-test/include/mysqld--help.inc | 2 +- mysql-test/r/mysqld--help-notwin.result | 16 ---------------- mysql-test/r/mysqld--help-win.result | 16 ---------------- sql/mysqld.cc | 2 ++ sql/sys_vars.cc | 20 +++++++++++++------- 6 files changed, 19 insertions(+), 43 deletions(-) diff --git a/Makefile.am b/Makefile.am index 88322206575..5d672daf5f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -129,14 +129,14 @@ smoke: test-full: test test-nr test-ps test-force: - $(MAKE) force=--force test + $(MAKE) -k force=--force test test-force-full: - $(MAKE) force=--force test-full + $(MAKE) -k force=--force test-full #used by autopush.pl to run memory based tests test-force-mem: - $(MAKE) force=--force mem=--mem test + $(MAKE) -k force=--force mem=--mem test EXP = --experimental=collections/default.experimental diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc index 25d0068cec0..82bf65bc362 100644 --- a/mysql-test/include/mysqld--help.inc +++ b/mysql-test/include/mysqld--help.inc @@ -12,7 +12,7 @@ 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/; - @plugins=qw/innodb ndb ndbcluster safemalloc debug temp-pool + @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/; $re1=join('|', @skipvars, @plugins); diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 85c0ea7bd6c..2ba7df6b7e3 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -124,8 +124,6 @@ The following options may be given as the first argument: handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again - --des-key-file=name Load keys for des_encrypt() and des_encrypt from given - file. --disconnect-slave-event-count=# Option used by mysql-test for debugging and testing of replication. @@ -646,13 +644,6 @@ The following options may be given as the first argument: anymore. --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the complete list of valid sql modes - --ssl Enable SSL for connection (automatically enabled with - other flags). - --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl) - --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl) - --ssl-cert=name X509 cert in PEM format (implies --ssl) - --ssl-cipher=name SSL cipher to use (implies --ssl) - --ssl-key=name X509 key in PEM format (implies --ssl) -s, --symbolic-links Enable symbolic link support. --sync-binlog=# Synchronously flush binary log to disk after every #th @@ -763,7 +754,6 @@ delay-key-write ON delayed-insert-limit 100 delayed-insert-timeout 300 delayed-queue-size 1000 -des-key-file (No default value) disconnect-slave-event-count 0 div-precision-increment 4 enable-locking FALSE @@ -916,12 +906,6 @@ socket /tmp/mysql.sock sort-buffer-size 2097152 sporadic-binlog-dump-fail FALSE sql-mode -ssl FALSE -ssl-ca (No default value) -ssl-capath (No default value) -ssl-cert (No default value) -ssl-cipher (No default value) -ssl-key (No default value) symbolic-links FALSE sync-binlog 0 sync-frm TRUE diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 4f705156c60..5627716f6ec 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -124,8 +124,6 @@ The following options may be given as the first argument: handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again - --des-key-file=name Load keys for des_encrypt() and des_encrypt from given - file. --disconnect-slave-event-count=# Option used by mysql-test for debugging and testing of replication. @@ -649,13 +647,6 @@ The following options may be given as the first argument: anymore. --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the complete list of valid sql modes - --ssl Enable SSL for connection (automatically enabled with - other flags). - --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl) - --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl) - --ssl-cert=name X509 cert in PEM format (implies --ssl) - --ssl-cipher=name SSL cipher to use (implies --ssl) - --ssl-key=name X509 key in PEM format (implies --ssl) --standalone Dummy option to start as a standalone program (NT). -s, --symbolic-links Enable symbolic link support. @@ -767,7 +758,6 @@ delay-key-write ON delayed-insert-limit 100 delayed-insert-timeout 300 delayed-queue-size 1000 -des-key-file (No default value) disconnect-slave-event-count 0 div-precision-increment 4 enable-locking FALSE @@ -922,12 +912,6 @@ socket MySQL sort-buffer-size 2097152 sporadic-binlog-dump-fail FALSE sql-mode -ssl FALSE -ssl-ca (No default value) -ssl-capath (No default value) -ssl-cert (No default value) -ssl-cipher (No default value) -ssl-key (No default value) symbolic-links FALSE sync-binlog 0 sync-frm TRUE diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 068a49d0ae6..ae9c2b56d48 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5743,10 +5743,12 @@ Can't be set to 1 if --log-slave-updates is used.", "The update log is deprecated since version 5.0, is replaced by the " "binary log and this option does nothing anymore.", 0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef HAVE_OPENSSL {"ssl", 0, "Enable SSL for connection (automatically enabled with other flags).", (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#endif #ifdef __WIN__ {"standalone", 0, "Dummy option to start as a standalone program (NT).", 0, 0, 0, GET_NO_ARG, diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 3c4683d23f9..da507edbdb4 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1654,31 +1654,37 @@ static Sys_var_set Sys_sql_mode( sql_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_sql_mode), ON_UPDATE(fix_sql_mode)); +#ifdef HAVE_OPENSSL +#define SSL_OPT(X) CMD_LINE(REQUIRED_ARG,X) +#else +#define SSL_OPT(X) NO_CMD_LINE +#endif + static Sys_var_charptr Sys_ssl_ca( "ssl_ca", "CA file in PEM format (check OpenSSL docs, implies --ssl)", - READ_ONLY GLOBAL_VAR(opt_ssl_ca), CMD_LINE(REQUIRED_ARG, OPT_SSL_CA), + READ_ONLY GLOBAL_VAR(opt_ssl_ca), SSL_OPT(OPT_SSL_CA), IN_FS_CHARSET, DEFAULT(0)); static Sys_var_charptr Sys_ssl_capath( "ssl_capath", "CA directory (check OpenSSL docs, implies --ssl)", - READ_ONLY GLOBAL_VAR(opt_ssl_capath), - CMD_LINE(REQUIRED_ARG, OPT_SSL_CAPATH), IN_FS_CHARSET, DEFAULT(0)); + READ_ONLY GLOBAL_VAR(opt_ssl_capath), SSL_OPT(OPT_SSL_CAPATH), + IN_FS_CHARSET, DEFAULT(0)); static Sys_var_charptr Sys_ssl_cert( "ssl_cert", "X509 cert in PEM format (implies --ssl)", - READ_ONLY GLOBAL_VAR(opt_ssl_cert), CMD_LINE(REQUIRED_ARG, OPT_SSL_CERT), + READ_ONLY GLOBAL_VAR(opt_ssl_cert), SSL_OPT(OPT_SSL_CERT), IN_FS_CHARSET, DEFAULT(0)); static Sys_var_charptr Sys_ssl_cipher( "ssl_cipher", "SSL cipher to use (implies --ssl)", - READ_ONLY GLOBAL_VAR(opt_ssl_cipher), - CMD_LINE(REQUIRED_ARG, OPT_SSL_CIPHER), IN_FS_CHARSET, DEFAULT(0)); + READ_ONLY GLOBAL_VAR(opt_ssl_cipher), SSL_OPT(OPT_SSL_CIPHER), + IN_FS_CHARSET, DEFAULT(0)); static Sys_var_charptr Sys_ssl_key( "ssl_key", "X509 key in PEM format (implies --ssl)", - READ_ONLY GLOBAL_VAR(opt_ssl_key), CMD_LINE(REQUIRED_ARG, OPT_SSL_KEY), + READ_ONLY GLOBAL_VAR(opt_ssl_key), SSL_OPT(OPT_SSL_KEY), IN_FS_CHARSET, DEFAULT(0)); // why ENUM and not BOOL ? From 9c22d1ecfaaf34b1d2b1d02a3017e5e71733d5be Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Dec 2009 09:35:42 +0100 Subject: [PATCH 57/86] don't show the value of open_files_limit --- .../suite/sys_vars/r/open_files_limit_basic.result | 10 +++++----- .../suite/sys_vars/t/open_files_limit_basic.test | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/open_files_limit_basic.result b/mysql-test/suite/sys_vars/r/open_files_limit_basic.result index b136fdf2e20..7ca75b8d283 100644 --- a/mysql-test/suite/sys_vars/r/open_files_limit_basic.result +++ b/mysql-test/suite/sys_vars/r/open_files_limit_basic.result @@ -1,20 +1,20 @@ select @@global.open_files_limit; @@global.open_files_limit -1024 +# select @@session.open_files_limit; ERROR HY000: Variable 'open_files_limit' is a GLOBAL variable show global variables like 'open_files_limit'; Variable_name Value -open_files_limit 1024 +open_files_limit # show session variables like 'open_files_limit'; Variable_name Value -open_files_limit 1024 +open_files_limit # select * from information_schema.global_variables where variable_name='open_files_limit'; VARIABLE_NAME VARIABLE_VALUE -OPEN_FILES_LIMIT 1024 +OPEN_FILES_LIMIT # select * from information_schema.session_variables where variable_name='open_files_limit'; VARIABLE_NAME VARIABLE_VALUE -OPEN_FILES_LIMIT 1024 +OPEN_FILES_LIMIT # set global open_files_limit=1; ERROR HY000: Variable 'open_files_limit' is a read only variable set session open_files_limit=1; diff --git a/mysql-test/suite/sys_vars/t/open_files_limit_basic.test b/mysql-test/suite/sys_vars/t/open_files_limit_basic.test index 50c0b2d5b6e..bac3c8f6685 100644 --- a/mysql-test/suite/sys_vars/t/open_files_limit_basic.test +++ b/mysql-test/suite/sys_vars/t/open_files_limit_basic.test @@ -1,17 +1,17 @@ # # show the global and session values; # ---replace_result 3072 1024 16384 1024 +--replace_column 1 # select @@global.open_files_limit; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.open_files_limit; ---replace_result 3072 1024 16384 1024 +--replace_column 2 # show global variables like 'open_files_limit'; ---replace_result 3072 1024 16384 1024 +--replace_column 2 # show session variables like 'open_files_limit'; ---replace_result 3072 1024 16384 1024 +--replace_column 2 # select * from information_schema.global_variables where variable_name='open_files_limit'; ---replace_result 3072 1024 16384 1024 +--replace_column 2 # select * from information_schema.session_variables where variable_name='open_files_limit'; # From e7441f0b602735e2c40b0e0e7cfb01a2443aaa5a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Dec 2009 21:55:32 +0100 Subject: [PATCH 58/86] my_once.c: clarify the comment --- mysys/my_once.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysys/my_once.c b/mysys/my_once.c index b6f6656fce2..727b8477365 100644 --- a/mysys/my_once.c +++ b/mysys/my_once.c @@ -25,7 +25,8 @@ #include /* - Alloc for things we don't nead to free + Alloc for things we don't nend to free run-time (that only + should be free'd on exit) SYNOPSIS my_once_alloc() @@ -100,7 +101,7 @@ void *my_once_memdup(const void *src, size_t len, myf myflags) /* - Deallocate everything used by my_once_alloc + Deallocate everything that was allocated with my_once_alloc SYNOPSIS my_once_free() From c3ea71896cbc4fcc9b68f77f1b909d2fb5c6c365 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 31 Dec 2009 14:05:33 +0100 Subject: [PATCH 59/86] possible fix for sporadic sys_vars.delayed_insert_limit_func failures --- mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test index e46ebc1e598..88f247135c8 100644 --- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test +++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test @@ -109,7 +109,8 @@ delimiter ;| --echo ** Connection con0 ** connection con0; let $wait_condition= - SELECT variable_value > 0 FROM information_schema.global_status + SELECT variable_value > @@global.delayed_insert_limit + FROM information_schema.global_status WHERE variable_name like 'Not_flushed_delayed_rows'; --source include/wait_condition.inc let $my_select= SELECT COUNT(*) FROM t1; From 305f2e7f8a368cb1f04b75e3953a727f7c67e5ad Mon Sep 17 00:00:00 2001 From: Jorgen Loland Date: Mon, 4 Jan 2010 10:39:42 +0100 Subject: [PATCH 60/86] 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 61/86] 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 62/86] 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 63/86] 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 64/86] 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 65/86] 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 66/86] 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 67/86] 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 68/86] 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 69/86] 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 70/86] 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 71/86] 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 72/86] 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 73/86] 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 74/86] 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 75/86] 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 76/86] 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 77/86] 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 78/86] 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 79/86] 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 80/86] 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 81/86] 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 82/86] 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 83/86] 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 84/86] 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 85/86] 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 86/86] 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