mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
7dbea7df27
checks on trigger activation) mysql-test/r/information_schema.result: Update result file: a new column DEFINER has been added to INFORMATION_SCHEMA.TRIGGERS. mysql-test/r/mysqldump.result: Update result file: a new column DEFINER has been added to INFORMATION_SCHEMA.TRIGGERS. mysql-test/r/rpl_ddl.result: Update result file: a new column DEFINER has been added to INFORMATION_SCHEMA.TRIGGERS. mysql-test/r/rpl_sp.result: Update result file: a new clause DEFINER has been added to CREATE TRIGGER statement. mysql-test/r/rpl_trigger.result: Results for new test cases were added. mysql-test/r/skip_grants.result: Error message has been changed. mysql-test/r/trigger.result: Added DEFINER column. mysql-test/r/view.result: Error messages have been changed. mysql-test/r/view_grant.result: Error messages have been changed. mysql-test/t/mysqldump.test: Drop created procedure to not affect further tests. mysql-test/t/rpl_trigger.test: Add tests for new column in information schema. mysql-test/t/skip_grants.test: Error tag has been renamed. mysql-test/t/view.test: Error tag has been renamed. mysql-test/t/view_grant.test: Error tag has been changed. sql/item_func.cc: Fix typo in comments. sql/mysql_priv.h: A try to minimize copy&paste: - introduce operations to be used from sql_yacc.yy; - introduce an operation to be used from trigger and view processing code. sql/share/errmsg.txt: - Rename ER_NO_VIEW_USER to ER_MALFORMED_DEFINER in order to be shared for view and trigger implementations; - Fix a typo; - Add a new error code for trigger warning. sql/sp.cc: set_info() was split into set_info() and set_definer(). sql/sp_head.cc: set_info() was split into set_info() and set_definer(). sql/sp_head.h: set_info() was split into set_info() and set_definer(). sql/sql_acl.cc: Add a new check: exit from the cycle if the table is NULL. sql/sql_lex.h: - Rename create_view_definer to definer, since it is used for views and triggers; - Change st_lex_user to LEX_USER, since st_lex_user is a structure. So, formally, it should be "struct st_lex_user", which is longer than just LEX_USER; - Add trigger_definition_begin. sql/sql_parse.cc: - Add a new check: exit from the cycle if the table is NULL; - Implement definer-related functions. sql/sql_show.cc: Add DEFINER column. sql/sql_trigger.cc: Add DEFINER support for triggers. sql/sql_trigger.h: Add DEFINER support for triggers. sql/sql_view.cc: Rename create_view_definer to definer. sql/sql_yacc.yy: Add support for DEFINER-clause in CREATE TRIGGER statement. Since CREATE TRIGGER and CREATE VIEW can be similar at the start, yacc is unable to distinguish between them. So, had to modify both statements in order to make it parsable by yacc. mysql-test/r/trigger-compat.result: Result file for triggers backward compatibility test. mysql-test/r/trigger-grant.result: Result file of the test for WL#2818. mysql-test/t/trigger-compat.test: Triggers backward compatibility test: check that the server still can load triggers w/o definer attribute and modify tables with such triggers (add a new trigger, etc). mysql-test/t/trigger-grant.test: Test for WL#2818 -- check that DEFINER support in triggers works properly
1693 lines
30 KiB
Text
1693 lines
30 KiB
Text
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 AUTOCOMMIT = 1;
|
|
DROP DATABASE IF EXISTS mysqltest1;
|
|
DROP DATABASE IF EXISTS mysqltest2;
|
|
DROP DATABASE IF EXISTS mysqltest3;
|
|
CREATE DATABASE mysqltest1;
|
|
CREATE DATABASE mysqltest2;
|
|
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB";
|
|
INSERT INTO mysqltest1.t1 SET f1= 0;
|
|
CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
|
|
CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB";
|
|
INSERT INTO mysqltest1.t7 SET f1= 0;
|
|
CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB";
|
|
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
|
|
SET AUTOCOMMIT = 0;
|
|
use mysqltest1;
|
|
|
|
-------- switch to slave --------
|
|
SET AUTOCOMMIT = 0;
|
|
use mysqltest1;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## COMMIT ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 0 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
0
|
|
|
|
-------- switch to master -------
|
|
COMMIT;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## ROLLBACK ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 1 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
2
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## SET AUTOCOMMIT=1 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 1 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
2
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
1
|
|
|
|
-------- switch to master -------
|
|
SET AUTOCOMMIT=1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
2
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
2
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
2
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
2
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SET AUTOCOMMIT=0;
|
|
|
|
######## START TRANSACTION ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 2 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
3
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
2
|
|
|
|
-------- switch to master -------
|
|
START TRANSACTION;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
3
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
3
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
3
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
3
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## BEGIN ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 3 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
4
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
3
|
|
|
|
-------- switch to master -------
|
|
BEGIN;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
4
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
4
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
4
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
4
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## DROP TABLE mysqltest1.t2 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 4 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
4
|
|
|
|
-------- switch to master -------
|
|
DROP TABLE mysqltest1.t2;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW TABLES LIKE 't2';
|
|
Tables_in_mysqltest1 (t2)
|
|
|
|
-------- switch to slave --------
|
|
SHOW TABLES LIKE 't2';
|
|
Tables_in_mysqltest1 (t2)
|
|
|
|
-------- switch to master -------
|
|
|
|
######## DROP TEMPORARY TABLE mysqltest1.t23 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 5 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
-------- switch to master -------
|
|
DROP TEMPORARY TABLE mysqltest1.t23;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
Warnings:
|
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
5
|
|
|
|
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW TABLES LIKE 't23';
|
|
Tables_in_mysqltest1 (t23)
|
|
|
|
-------- switch to slave --------
|
|
SHOW TABLES LIKE 't23';
|
|
Tables_in_mysqltest1 (t23)
|
|
|
|
-------- switch to master -------
|
|
|
|
######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 5 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
-------- switch to master -------
|
|
RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW TABLES LIKE 't20';
|
|
Tables_in_mysqltest1 (t20)
|
|
t20
|
|
|
|
-------- switch to slave --------
|
|
SHOW TABLES LIKE 't20';
|
|
Tables_in_mysqltest1 (t20)
|
|
t20
|
|
|
|
-------- switch to master -------
|
|
|
|
######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 6 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
7
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
6
|
|
|
|
-------- switch to master -------
|
|
ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
7
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
7
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
7
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
7
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
describe mysqltest1.t4;
|
|
Field Type Null Key Default Extra
|
|
f1 bigint(20) YES NULL
|
|
f2 bigint(20) YES NULL
|
|
|
|
-------- switch to slave --------
|
|
describe mysqltest1.t4;
|
|
Field Type Null Key Default Extra
|
|
f1 bigint(20) YES NULL
|
|
f2 bigint(20) YES NULL
|
|
|
|
-------- switch to master -------
|
|
|
|
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 7 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
7
|
|
|
|
-------- switch to master -------
|
|
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB";
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 8 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
-------- switch to master -------
|
|
CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
Warnings:
|
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
8
|
|
|
|
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## TRUNCATE TABLE mysqltest1.t7 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 8 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
-------- switch to master -------
|
|
TRUNCATE TABLE mysqltest1.t7;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SELECT * FROM mysqltest1.t7;
|
|
f1
|
|
|
|
-------- switch to slave --------
|
|
SELECT * FROM mysqltest1.t7;
|
|
f1
|
|
|
|
-------- switch to master -------
|
|
|
|
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 9 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
9
|
|
|
|
-------- switch to master -------
|
|
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
UNLOCK TABLES;
|
|
|
|
######## UNLOCK TABLES ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 10 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to master -------
|
|
UNLOCK TABLES;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
LOCK TABLES mysqltest1.t1 READ;
|
|
|
|
######## UNLOCK TABLES ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 10 + 1;
|
|
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to master -------
|
|
UNLOCK TABLES;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
|
|
|
|
######## UNLOCK TABLES ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 10 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
10
|
|
|
|
-------- switch to master -------
|
|
UNLOCK TABLES;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
|
|
######## DROP INDEX my_idx6 ON mysqltest1.t6 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 11 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
12
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
11
|
|
|
|
-------- switch to master -------
|
|
DROP INDEX my_idx6 ON mysqltest1.t6;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
12
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
12
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
12
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
12
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW INDEX FROM mysqltest1.t6;
|
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
|
|
|
-------- switch to slave --------
|
|
SHOW INDEX FROM mysqltest1.t6;
|
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
|
|
|
-------- switch to master -------
|
|
|
|
######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 12 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
13
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
12
|
|
|
|
-------- switch to master -------
|
|
CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
13
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
13
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
13
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
13
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW INDEX FROM mysqltest1.t5;
|
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
|
t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
|
|
|
|
-------- switch to slave --------
|
|
SHOW INDEX FROM mysqltest1.t5;
|
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
|
t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE
|
|
|
|
-------- switch to master -------
|
|
|
|
######## DROP DATABASE mysqltest2 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 13 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
14
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
13
|
|
|
|
-------- switch to master -------
|
|
DROP DATABASE mysqltest2;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
14
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
14
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
14
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
14
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW DATABASES LIKE "mysqltest2";
|
|
Database (mysqltest2)
|
|
|
|
-------- switch to slave --------
|
|
SHOW DATABASES LIKE "mysqltest2";
|
|
Database (mysqltest2)
|
|
|
|
-------- switch to master -------
|
|
|
|
######## CREATE DATABASE mysqltest3 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 14 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
15
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
14
|
|
|
|
-------- switch to master -------
|
|
CREATE DATABASE mysqltest3;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
15
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
15
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
15
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
15
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW DATABASES LIKE "mysqltest3";
|
|
Database (mysqltest3)
|
|
mysqltest3
|
|
|
|
-------- switch to slave --------
|
|
SHOW DATABASES LIKE "mysqltest3";
|
|
Database (mysqltest3)
|
|
mysqltest3
|
|
|
|
-------- switch to master -------
|
|
|
|
######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 15 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
16
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
15
|
|
|
|
-------- switch to master -------
|
|
CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
16
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
16
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
16
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
16
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
|
Db mysqltest1
|
|
Name p1
|
|
Type PROCEDURE
|
|
Definer root@localhost
|
|
Modified #
|
|
Created #
|
|
Security_type DEFINER
|
|
Comment
|
|
-------- switch to slave -------
|
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
|
Db mysqltest1
|
|
Name p1
|
|
Type PROCEDURE
|
|
Definer @
|
|
Modified #
|
|
Created #
|
|
Security_type DEFINER
|
|
Comment
|
|
|
|
######## ALTER PROCEDURE p1 COMMENT "I have been altered" ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 16 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
17
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
16
|
|
|
|
-------- switch to master -------
|
|
ALTER PROCEDURE p1 COMMENT "I have been altered";
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
17
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
17
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
17
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
17
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
|
Db mysqltest1
|
|
Name p1
|
|
Type PROCEDURE
|
|
Definer root@localhost
|
|
Modified #
|
|
Created #
|
|
Security_type DEFINER
|
|
Comment I have been altered
|
|
-------- switch to slave -------
|
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
|
Db mysqltest1
|
|
Name p1
|
|
Type PROCEDURE
|
|
Definer @
|
|
Modified #
|
|
Created #
|
|
Security_type DEFINER
|
|
Comment I have been altered
|
|
|
|
######## DROP PROCEDURE p1 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 17 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
18
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
17
|
|
|
|
-------- switch to master -------
|
|
DROP PROCEDURE p1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
18
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
18
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
18
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
18
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
|
-------- switch to slave -------
|
|
SHOW PROCEDURE STATUS LIKE 'p1';
|
|
|
|
######## CREATE OR REPLACE VIEW v1 as select * from t1 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 18 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
19
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
18
|
|
|
|
-------- switch to master -------
|
|
CREATE OR REPLACE VIEW v1 as select * from t1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
19
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
19
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
19
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
19
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW CREATE VIEW v1;
|
|
View Create View
|
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
|
|
|
|
-------- switch to slave -------
|
|
SHOW CREATE VIEW v1;
|
|
View Create View
|
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
|
|
|
|
######## ALTER VIEW v1 AS select f1 from t1 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 19 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
20
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
19
|
|
|
|
-------- switch to master -------
|
|
ALTER VIEW v1 AS select f1 from t1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
20
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
20
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
20
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
20
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW CREATE VIEW v1;
|
|
View Create View
|
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
|
|
|
|
-------- switch to slave -------
|
|
SHOW CREATE VIEW v1;
|
|
View Create View
|
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
|
|
|
|
######## DROP VIEW IF EXISTS v1 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 20 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
21
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
20
|
|
|
|
-------- switch to master -------
|
|
DROP VIEW IF EXISTS v1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
21
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
21
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
21
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
21
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW CREATE VIEW v1;
|
|
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
|
|
|
|
-------- switch to slave -------
|
|
SHOW CREATE VIEW v1;
|
|
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
|
|
|
|
######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 21 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
22
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
21
|
|
|
|
-------- switch to master -------
|
|
CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
22
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
22
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
22
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
22
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW TRIGGERS;
|
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
|
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
|
|
|
|
-------- switch to slave -------
|
|
SHOW TRIGGERS;
|
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
|
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
|
|
|
|
######## DROP TRIGGER trg1 ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 22 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
23
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
22
|
|
|
|
-------- switch to master -------
|
|
DROP TRIGGER trg1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
23
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
23
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
23
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
23
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SHOW TRIGGERS;
|
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
|
|
|
-------- switch to slave -------
|
|
SHOW TRIGGERS;
|
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
|
|
|
######## CREATE USER user1@localhost ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 23 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
24
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
23
|
|
|
|
-------- switch to master -------
|
|
CREATE USER user1@localhost;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
24
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
24
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
24
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
24
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SELECT user FROM mysql.user WHERE user = 'user1';
|
|
user
|
|
user1
|
|
|
|
-------- switch to slave -------
|
|
SELECT user FROM mysql.user WHERE user = 'user1';
|
|
user
|
|
user1
|
|
|
|
######## RENAME USER user1@localhost TO rename1@localhost ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 24 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
25
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
24
|
|
|
|
-------- switch to master -------
|
|
RENAME USER user1@localhost TO rename1@localhost;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
25
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
25
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
25
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
25
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
|
user
|
|
rename1
|
|
|
|
-------- switch to slave -------
|
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
|
user
|
|
rename1
|
|
|
|
######## DROP USER rename1@localhost ########
|
|
|
|
-------- switch to master -------
|
|
INSERT INTO t1 SET f1= 25 + 1;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
26
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
25
|
|
|
|
-------- switch to master -------
|
|
DROP USER rename1@localhost;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
26
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
26
|
|
|
|
-------- switch to master -------
|
|
ROLLBACK;
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
26
|
|
|
|
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to slave --------
|
|
SELECT MAX(f1) FROM t1;
|
|
MAX(f1)
|
|
26
|
|
|
|
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
|
|
|
|
-------- switch to master -------
|
|
flush logs;
|
|
|
|
-------- switch to slave --------
|
|
flush logs;
|
|
|
|
-------- switch to master -------
|
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
|
user
|
|
|
|
-------- switch to slave -------
|
|
SELECT user FROM mysql.user WHERE user = 'rename1';
|
|
user
|
|
DROP DATABASE IF EXISTS mysqltest1;
|
|
DROP DATABASE IF EXISTS mysqltest2;
|
|
DROP DATABASE IF EXISTS mysqltest3;
|