Commit 329c4281 authored by Alfranio Correia's avatar Alfranio Correia

merge mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge

parents 57a8d221 f199ad1a
...@@ -37,14 +37,22 @@ CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT I ...@@ -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); 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. 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; 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 * 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; 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); INSERT INTO t_stmt VALUES (1);
ERROR HY000: Cannot execute statement: binlogging impossible since both row-incapable engines and statement-incapable engines are involved. 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; DROP TRIGGER trig_2;
* Stmt-only table and binlog_format=row * Stmt-only table and binlog_format=row
INSERT INTO t_stmt VALUES (1); 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. 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 * Row injection and stmt-only table: in slave sql thread
INSERT INTO t_slave_stmt VALUES (1); INSERT INTO t_slave_stmt VALUES (1);
[on slave] [on slave]
...@@ -52,12 +60,17 @@ INSERT INTO t_slave_stmt VALUES (1); ...@@ -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 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; set global sql_slave_skip_counter=1;
include/start_slave.inc include/start_slave.inc
SELECT * FROM t_slave_stmt /* should be empty */;
a
[on master]
* Row injection and stmt-only table: use BINLOG statement * Row injection and stmt-only table: use BINLOG statement
BINLOG ' BINLOG '
1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE= 1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE=
1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE= 1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE=
'; ';
ERROR HY000: Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging. 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 ---- ---- binlog_format=mixed ----
[on slave] [on slave]
include/stop_slave.inc include/stop_slave.inc
...@@ -83,21 +96,30 @@ SET @@session.binlog_format = STATEMENT; ...@@ -83,21 +96,30 @@ SET @@session.binlog_format = STATEMENT;
* Row-only engine and binlog_format=statement: innodb-specific message * Row-only engine and binlog_format=statement: innodb-specific message
INSERT INTO t_row VALUES (1); 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. 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 * 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); 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. 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 * Same statement, but db filtered out - no error
USE other; USE other;
INSERT INTO test.t_row VALUES (1); INSERT INTO test.t_row VALUES (1);
USE test; USE test;
SET @@session.debug= ''; SET @@session.debug= '';
SELECT * FROM t_row /* should contain the value 1 */;
a
1
* Row injection and binlog_format=statement: BINLOG statement * Row injection and binlog_format=statement: BINLOG statement
BINLOG ' BINLOG '
cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
'; ';
ERROR HY000: Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT. 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 * Same statement, but db filtered out - no error
USE other; USE other;
BINLOG ' BINLOG '
...@@ -105,24 +127,38 @@ cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB ...@@ -105,24 +127,38 @@ cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
'; ';
USE test; USE test;
SELECT * FROM t /* should contain the value 1 */;
a
1
DELETE FROM t;
* Unsafe statement and binlog_format=statement * Unsafe statement and binlog_format=statement
INSERT INTO t VALUES (UUID()); INSERT INTO t VALUES (COALESCE(1, UUID()));
Warnings: 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: 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 * Same statement, but db filtered out - no message
USE other; USE other;
INSERT INTO test.t VALUES (UUID()); INSERT INTO test.t VALUES (COALESCE(1, UUID()));
USE test; USE test;
SELECT * FROM t /* should contain the value 1 */;
a
1
DELETE FROM t;
---- master: binlog_format=mixed, slave: binlog_format=statement ---- ---- master: binlog_format=mixed, slave: binlog_format=statement ----
SET @@global.binlog_format = MIXED; SET @@global.binlog_format = MIXED;
SET @@session.binlog_format = MIXED; SET @@session.binlog_format = MIXED;
* Row injection and binlog_format=statement: in slave sql thread * Row injection and binlog_format=statement: in slave sql thread
INSERT INTO t VALUES (UUID()); INSERT INTO t VALUES (COALESCE(1, UUID()));
[on slave] [on slave]
--source include/wait_for_slave_sql_error_and_skip.inc --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 Last_SQL_Error = Error 'Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT.' on opening tables
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
include/start_slave.inc include/start_slave.inc
SELECT * FROM t /* should be empty */;
a
[on master] [on master]
==== Clean up ==== ==== Clean up ====
DROP TRIGGER trig_autoinc; DROP TRIGGER trig_autoinc;
......
...@@ -93,16 +93,20 @@ AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ...@@ -93,16 +93,20 @@ AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
--error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE --error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE
INSERT INTO t_self_logging VALUES (1); INSERT INTO t_self_logging VALUES (1);
DROP trigger trig_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 --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 --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 --error ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE
INSERT INTO t_stmt VALUES (1); INSERT INTO t_stmt VALUES (1);
SELECT * FROM t_stmt /* should be empty */;
DROP TRIGGER trig_2; DROP TRIGGER trig_2;
--echo * Stmt-only table and binlog_format=row --echo * Stmt-only table and binlog_format=row
--error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE --error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE
INSERT INTO t_stmt VALUES (1); INSERT INTO t_stmt VALUES (1);
SELECT * FROM t_stmt /* should be empty */;
--echo * Row injection and stmt-only table: in slave sql thread --echo * Row injection and stmt-only table: in slave sql thread
INSERT INTO t_slave_stmt VALUES (1); INSERT INTO t_slave_stmt VALUES (1);
...@@ -112,7 +116,11 @@ INSERT INTO t_slave_stmt VALUES (1); ...@@ -112,7 +116,11 @@ INSERT INTO t_slave_stmt VALUES (1);
--let $slave_sql_errno= 1664 --let $slave_sql_errno= 1664
--let $show_sql_error= 1 --let $show_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc --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 --echo * Row injection and stmt-only table: use BINLOG statement
# This is a Table_map_event and a Write_rows_event. Together, they are # This is a Table_map_event and a Write_rows_event. Together, they are
# equivalent to 'INSERT INTO t_stmt VALUES (1)' # equivalent to 'INSERT INTO t_stmt VALUES (1)'
...@@ -121,6 +129,7 @@ BINLOG ' ...@@ -121,6 +129,7 @@ BINLOG '
1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE= 1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE=
1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE= 1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE=
'; ';
SELECT * FROM t_stmt /* should be empty */;
--echo ---- binlog_format=mixed ---- --echo ---- binlog_format=mixed ----
...@@ -161,6 +170,7 @@ SET @@session.binlog_format = STATEMENT; ...@@ -161,6 +170,7 @@ SET @@session.binlog_format = STATEMENT;
--echo * Row-only engine and binlog_format=statement: innodb-specific message --echo * Row-only engine and binlog_format=statement: innodb-specific message
--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE --error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
INSERT INTO t_row VALUES (1); INSERT INTO t_row VALUES (1);
SELECT * FROM t_row /* should be empty */;
# Commented out since innodb gives an error (this is a bug) # Commented out since innodb gives an error (this is a bug)
#--echo * Same statement, but db filtered out - no error #--echo * Same statement, but db filtered out - no error
...@@ -172,12 +182,14 @@ INSERT INTO t_row VALUES (1); ...@@ -172,12 +182,14 @@ INSERT INTO t_row VALUES (1);
SET @@session.debug= '+d,no_innodb_binlog_errors'; SET @@session.debug= '+d,no_innodb_binlog_errors';
--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE --error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
INSERT INTO t_row VALUES (1); INSERT INTO t_row VALUES (1);
SELECT * FROM t_row /* should be empty */;
--echo * Same statement, but db filtered out - no error --echo * Same statement, but db filtered out - no error
USE other; USE other;
INSERT INTO test.t_row VALUES (1); INSERT INTO test.t_row VALUES (1);
USE test; USE test;
SET @@session.debug= ''; SET @@session.debug= '';
SELECT * FROM t_row /* should contain the value 1 */;
--echo * Row injection and binlog_format=statement: BINLOG statement --echo * Row injection and binlog_format=statement: BINLOG statement
# This is a Table_map_event and a Write_rows_event. Together, they are # This is a Table_map_event and a Write_rows_event. Together, they are
...@@ -187,6 +199,7 @@ BINLOG ' ...@@ -187,6 +199,7 @@ BINLOG '
cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
'; ';
SELECT * FROM t /* should be empty */;
--echo * Same statement, but db filtered out - no error --echo * Same statement, but db filtered out - no error
# This is a Table_map_event and a Write_rows_event. Together, they are # This is a Table_map_event and a Write_rows_event. Together, they are
...@@ -197,15 +210,21 @@ cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB ...@@ -197,15 +210,21 @@ cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
'; ';
USE test; USE test;
SELECT * FROM t /* should contain the value 1 */;
DELETE FROM t;
--echo * Unsafe statement and binlog_format=statement --echo * Unsafe statement and binlog_format=statement
# This will give a warning. # 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 --echo * Same statement, but db filtered out - no message
USE other; USE other;
INSERT INTO test.t VALUES (UUID()); INSERT INTO test.t VALUES (COALESCE(1, UUID()));
USE test; USE test;
SELECT * FROM t /* should contain the value 1 */;
DELETE FROM t;
--echo ---- master: binlog_format=mixed, slave: binlog_format=statement ---- --echo ---- master: binlog_format=mixed, slave: binlog_format=statement ----
...@@ -214,14 +233,15 @@ SET @@global.binlog_format = MIXED; ...@@ -214,14 +233,15 @@ SET @@global.binlog_format = MIXED;
SET @@session.binlog_format = MIXED; SET @@session.binlog_format = MIXED;
--echo * Row injection and binlog_format=statement: in slave sql thread --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] --echo [on slave]
--connection slave --connection slave
# 1666 = ER_BINLOG_ROW_INJECTION_AND_STMT_MODE # 1666 = ER_BINLOG_ROW_INJECTION_AND_STMT_MODE
--let $slave_sql_errno= 1666 --let $slave_sql_errno= 1666
--let $show_sql_error= 1 --let $show_sql_error= 1
--source include/wait_for_slave_sql_error_and_skip.inc --source include/wait_for_slave_sql_error_and_skip.inc
--connection slave
SELECT * FROM t /* should be empty */;
--echo [on master] --echo [on master]
--connection master --connection master
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment