~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
include/master-slave.inc
 
2
Warnings:
 
3
Note    ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
 
4
Note    ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
 
5
[connection master]
 
6
==== Initialize ====
 
7
[on master]
 
8
CREATE TABLE t1 (a CHAR(48));
 
9
CREATE TEMPORARY TABLE t1_tmp1(a INT);
 
10
INSERT INTO t1 VALUES (UUID());
 
11
[on slave]
 
12
==== Verify results on slave ====
 
13
SHOW STATUS LIKE "Slave_open_temp_tables";
 
14
Variable_name   Value
 
15
Slave_open_temp_tables  1
 
16
[on master]
 
17
[on master1]
 
18
[on slave]
 
19
==== Verify results on slave ====
 
20
SHOW STATUS LIKE "Slave_open_temp_tables";
 
21
Variable_name   Value
 
22
Slave_open_temp_tables  0
 
23
==== Clean up ====
 
24
[on master]
 
25
include/rpl_connect.inc [creating master]
 
26
DROP TABLE t1;
 
27
[on slave]
 
28
include/rpl_reset.inc
 
29
CREATE TABLE t1 (a int);
 
30
CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
 
31
CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
 
32
CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ();
 
33
CREATE TEMPORARY TABLE t1_tmp (i1 int);
 
34
ALTER TABLE t1_tmp ADD COLUMN b INT;
 
35
DELETE FROM t2;
 
36
CREATE TEMPORARY TABLE t2_tmp (a int);
 
37
ALTER TABLE t1_tmp ADD COLUMN c INT;
 
38
### assertion: assert that there is one open temp table on slave
 
39
SHOW STATUS LIKE 'Slave_open_temp_tables';
 
40
Variable_name   Value
 
41
Slave_open_temp_tables  1
 
42
DROP TABLE t1_tmp, t2;
 
43
INSERT INTO t1 VALUES (1);
 
44
DROP TEMPORARY TABLE t2_tmp;
 
45
INSERT INTO t1 VALUES (2);
 
46
### assertion: assert that slave has no temporary tables opened
 
47
SHOW STATUS LIKE 'Slave_open_temp_tables';
 
48
Variable_name   Value
 
49
Slave_open_temp_tables  0
 
50
DROP TABLE t3, t1;
 
51
include/show_binlog_events.inc
 
52
Log_name        Pos     Event_type      Server_id       End_log_pos     Info
 
53
slave-bin.000001        #       Query   #       #       use `test`; CREATE TABLE t1 (a int)
 
54
slave-bin.000001        #       Query   #       #       use `test`; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) )
 
55
slave-bin.000001        #       Query   #       #       use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) )
 
56
slave-bin.000001        #       Query   #       #       use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES ()
 
57
slave-bin.000001        #       Query   #       #       use `test`; CREATE TEMPORARY TABLE t1_tmp (i1 int)
 
58
slave-bin.000001        #       Query   #       #       use `test`; ALTER TABLE t1_tmp ADD COLUMN b INT
 
59
slave-bin.000001        #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`t1_tmp` /* generated by server */
 
60
slave-bin.000001        #       Query   #       #       use `test`; DROP TABLE `t2` /* generated by server */
 
61
slave-bin.000001        #       Query   #       #       BEGIN
 
62
slave-bin.000001        #       Table_map       #       #       table_id: # (test.t1)
 
63
slave-bin.000001        #       Write_rows      #       #       table_id: # flags: STMT_END_F
 
64
slave-bin.000001        #       Xid     #       #       COMMIT /* XID */
 
65
slave-bin.000001        #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`t2_tmp` /* generated by server */
 
66
slave-bin.000001        #       Query   #       #       BEGIN
 
67
slave-bin.000001        #       Query   #       #       use `test`; INSERT INTO t1 VALUES (2)
 
68
slave-bin.000001        #       Xid     #       #       COMMIT /* XID */
 
69
slave-bin.000001        #       Query   #       #       use `test`; DROP TABLE `t3`,`t1` /* generated by server */
 
70
 
 
71
# Bug#55478 Row events wrongly apply on the temporary table of the same name
 
72
# ==========================================================================
 
73
# The statement should be binlogged
 
74
CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
 
75
 
 
76
# Case 1: CREATE TABLE t1 ... SELECT
 
77
# ----------------------------------
 
78
 
 
79
# The statement generates row events on t1. And the rows events should
 
80
# be inserted into the base table on slave.
 
81
CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
 
82
include/show_binlog_events.inc
 
83
Log_name        Pos     Event_type      Server_id       End_log_pos     Info
 
84
master-bin.000001       #       Query   #       #       BEGIN
 
85
master-bin.000001       #       Query   #       #       use `test`; CREATE TABLE `t1` (
 
86
  `rand()` double NOT NULL DEFAULT '0'
 
87
) ENGINE=MyISAM
 
88
master-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
 
89
master-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
 
90
master-bin.000001       #       Query   #       #       COMMIT
 
91
 
 
92
# Case 2: DROP TEMPORARY TABLE in a transacation
 
93
# ----------------------------------------------
 
94
 
 
95
BEGIN;
 
96
DROP TEMPORARY TABLE t1;
 
97
# The rows event will binlogged before 'DROP TEMPORARY TABLE t1',
 
98
# as t1 is non-transactional table
 
99
INSERT INTO t1 VALUES(Rand());
 
100
COMMIT;
 
101
include/show_binlog_events.inc
 
102
Log_name        Pos     Event_type      Server_id       End_log_pos     Info
 
103
master-bin.000001       #       Query   #       #       BEGIN
 
104
master-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
 
105
master-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
 
106
master-bin.000001       #       Query   #       #       COMMIT
 
107
master-bin.000001       #       Query   #       #       BEGIN
 
108
master-bin.000001       #       Query   #       #       DROP TEMPORARY TABLE IF EXISTS `test`.`t1` /* generated by server */
 
109
master-bin.000001       #       Query   #       #       COMMIT
 
110
# Compare the base table.
 
111
include/diff_tables.inc [master:t1, slave:t1]
 
112
 
 
113
DROP TABLE t1;
 
114
include/rpl_end.inc