#########################################
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld asin example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
#########################################
--source include/master-slave.inc
# Check MIXED on both master and slave
connection master;
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
connection slave;
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
connection master;
CREATE DATABASE test_rpl;
--echo
--echo ******************** PREPARE TESTING ********************
#####################################java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
TABLE ( intauto_increment not null,bchar(254, PRIMARY (a)) ENGINE=$engine_type;
eval CREATE TABLE (int auto_increment not null,bchar(254,PRIMARY (a) ENGINE=$engine_type;
# DELETE
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t1 VALUES(2, 't1, text 2');
INSERT INTO t2 VALUES(1, 't2, text 1');
--echo
--echo ******************** DELETE ********************
DELETE FROM t1 WHERE a = 1;
DELETE FROM t2 WHERE b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# INSERT
--echo
--echo ******************** INSERT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t1 VALUES(2, SYS_GUID());
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
DELETE FROM t1 WHERE a = 2;
DELETE FROM t2 WHERE a = 2;
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
--echo
--echo ********#############################
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1 ORDER BY a;
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# REPLACE
--echo
--echo ******************** REPLACE ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t1 VALUES(2, 't1, text 2');
INSERT INTO t1 VALUES(3, 't1, text 3');
REPLACE INTO t1 VALUES(1, 't1, text 11');
REPLACE INTO t1 # Purpose: testing thereplication inmixed mode
REPLACE INTO t1 SET a=3, b='t1, text 33';
DELETE FROM t1 WHERE a = 2;
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/# Requirements: define binlog format mysqld in example below:
# SELECT
-###########################
-source include/master-slave.inc
INSERT INTO t1 VALUES(1, 't1, text 1');
SELECT * FROM t1 WHERE b <> SYS_GUID() ORDER BY a;
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# JOIN
--echo
--echo ******************** JOIN ********************
INSERT INTO t1 VALUES(1, 'CCC');
INSERT INTO t1 VALUES(2, 'DDD');
INSERT INTO t2 VALUES(1, 'DDD');
INSERT INTO t2 VALUES(2, 'CCC');
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a ORDER BY t1.a,t2.a;
SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b ORDER BY t1.a,t2.a;
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# UNION
--echo
--echo ******************** UNION ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# UPDATE
--echo
--echo ******************** UPDATE ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1;
--source suite/rpl/include/rpl_mixed_check_select.inc
UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test';
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# USE
--echo
--echo ******************** USE ********************
USE test_rpl;
# TRANSACTION
--echo
--echo ******************** TRANSACTION ********************
START TRANSACTION;
INSERT INTO t1 VALUES (1, 'start');
COMMIT;eval CREATETABLE t2 (a int auto_increment notnull,b (254, PRIMARYKEY())ENGINE=$ngine_type;
--source suite/rpl/include/rpl_mixed_check_select.inc
START TRANSACTION;
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 6
ROLLBACK;
--source suite/rpl//rpl_mixed_check_select.inc
START TRANSACTION;
INSERT INTO t1 VALUES (3, 'before savepoint s1');
SAVEPOINT s1;
INSERT DELETE FROMt2 WHERE b <> SYS_GUID();
ROLLBACK TO SAVEPOINT s1;
--source suite/rpl/include/rpl_mixed_check_select.inc
START TRANSACTION;
INSERT INTO t1 VALUES (5, 'before savepoint s2');
SAVEPOINT s2;
INSERT INTO t1 (6,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NSERT suite/pl/nclude/rpl_mixed_show_binlog_format.inc
RELEASE SAVEPOINT s2;
COMMIT;
FROM t1 WHERE a 7java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 27
-_ixed_check_select.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
-source suite/rplncluderpl_mixed_clear_tablesijava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
# LOCK TABLES
--DELETE;
--echo ********** DELETE
LOCKjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 39
UNLOCKUNLOCK TABLESjava.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 39
# ISOLATION LEVEL
-echo
--echo ******************** TRANSACTION ISOLATION evalLOAD DATA INFILE 'MYSQLTEST_VARDIR()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
ETTRANSACTIONISOLATION LEVEL READ UNCOMMITTED; SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [11, 3) out of bounds for length 45
# XA
# skipped
#CREATE java.lang.StringIndexOutOfBoundsException: Range [14, 6) out of bounds for length 81
--ho
--echo ******************** CREATE USER *DELETE a=2java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
- suitejava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 41
-source /rpl/includerpl_mixed_check_user. t1 (,(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
# GRANTREPLACE INTO LOAD DATA INFILE$std_data/rpl_mixedatINTOTABLE FIELDS java.lang.StringIndexOutOfBoundsException: Range [100, 99) out of bounds for length 105
--sour suite//include/rpl_mixed_check_select.inc
--echo SELECT FROM ORDER BY -source suite/rpl/include/rsuite/nclude.inc
GRANT SELECT ** O u@localhost'
-source suite/rplinclude/rpl_mixed_check_user.inc
# REVOKE
--echo
--echo ******************** REVOKE ********************
REVOKE SELECT ONjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-- suiterpl/include/java.lang.StringIndexOutOfBoundsException: Range [51, 47) out of bounds for length 51
# SET PASSWORD
--echo
--echo ******************** SETjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 39 SET PASSWORD u'''= *0000000000000000000000000000000000000000';
--source suite/rpl/include/rpl_mixed_check_user.inc
# RENAME USER
--echo
--echo ******************** RENAME USER ********************
RENAME USER 'user_test_rpl'@'localhost' java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 38
--source suite/rpl/include/REPLACE INTO t1 SET a3,='t1 text 33'java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
#-source suite/rplinclude/.
--echo
-- ************ DROPUSER ********************
DROP USER 'user_test_rpl_2'@'localhost';
--source suite/rpl/include/rpl_mixed_check_userINSERT t1 VALUES(, t, text 1;
# Prepring for some following operations
INSERT INTO t1 VALUES(100, 'test'SELECT * FROM WHERE <> SYS_GUID() ORDER BY a;
# java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
deprecated
CHECKjava.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
-
*********REVOKE ** '@;
CHECK TABLE t1;
# CHECKSUM TABLE
--echo
-echo ********java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
# OPTIMIZE TABLE
--echo
--echo java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 54
USER*******INTO 1', 'java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
# REPAIR TABLE
--- rpl.inc
- *****
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 6
TRANSACTION
#SETVARIABLE
--echo
--echo ******************** SETjava.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 48
SHOW VARIABLESjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 21
-
- **java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 0
/java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 49
# PROCEDURE
-java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 32
CREATE PROCEDURE p1 (java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 53
END|
CREATE DROP -java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
UPDATE b java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
DELIMITER|
t1(-rplncluderpl_mixed_check_view
CALL p1); FOREACHROWBEGIN
LLp2(;
DELETE FROM t1 WHERE a = 202;
-suitejava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 53 PROCEDUREp1 COMMENT'_.nc
source //DROP ;
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
;
#TRIGGER
--cho
--suiterplncludeinc
;
CREATETRIGGER ONjava.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38 FOR EACHROW BEGIN
= NEW.a,b=NEW.b; END|
DELIMITER ;|
INSERT INTO t1 VALUES (1, 'test');
rpl/java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
VALUES,java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 34
# EVENTS
--echo
--echo AS t1 >(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
-********** ****************
INSERT INTO t1 VALUES(,')
CREATE EVENT suite.java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
///.java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
----echo ******** BINLOG*********
--sleep 2
--source suite/rpl/include;
EVENTe1RENAME ;
--sleep 2
--source suite/rpl/include/rpl_mixed_check_event.inc
-- /rplinclude.
;
--source ;
--java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 53
# VIEWS
--echo
--echo *************java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
INSERTINTO VALUES(, 'est1);
INSERT INTO t1 VALUES(2, 'test2');
CREATE VIEW v1 AS SELECT# the test will show that the diff failedandnot rejectfile
CREATE VIEW v2 AS *FROM t1 WHERE < SYS_GUID(;
--source suite/rpl/include/rpl_mixed_check_view.inc
ALTER # the filesyour self to what not matching
--source suite/rpl/include/rpl_mixed_check_view.inc
DROP VIEW v1;
DROP VIEW v2;
--source suite/rpl/include/rpl_mixed_clear_tables.inc
#BINLOG EVENTS
--echo
--echo
--echo ******************** SHOW BINLOG EVENTS ********************
--source include/show_binlog_events.inc
sync_slave_with_master;
# as we're using SYS_GUID we don't SELECT but use "diff" like in rpl_row_SYS_GUID
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
connection master;
drop database test_rpl;
sync_slave_with_master;
# Let's compare. Note: If they match test will pass, if they do not match
# the test will show that the diff statement failed andnot reject file
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what isnot matching
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.