| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
connection master; |
| 4 |
create database if not exists mysqltest1; |
| 5 |
DROP VIEW IF EXISTS mysqltest1.v1; |
| 6 |
DROP VIEW IF EXISTS mysqltest1.v2; |
| 7 |
DROP VIEW IF EXISTS mysqltest1.v3; |
| 8 |
DROP VIEW IF EXISTS mysqltest1.v4; |
| 9 |
DROP TABLE IF EXISTS mysqltest1.t3; |
| 10 |
DROP TABLE IF EXISTS mysqltest1.t1; |
| 11 |
DROP TABLE IF EXISTS mysqltest1.t2; |
| 12 |
DROP TABLE IF EXISTS mysqltest1.t4; |
| 13 |
CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a)); |
| 14 |
CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a)); |
| 15 |
CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a)); |
| 16 |
CREATE TABLE mysqltest1.t4 (a INT, qty INT, price INT,PRIMARY KEY(a)); |
| 17 |
CREATE TABLE mysqltest1.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty)); |
| 18 |
INSERT INTO mysqltest1.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday'); |
| 19 |
INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF'); |
| 20 |
INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4); |
| 21 |
CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4 ORDER BY qty; |
| 22 |
CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a ORDER BY a; |
| 23 |
CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1; |
| 24 |
CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION; |
| 25 |
SELECT * FROM mysqltest1.v2; |
| 26 |
qty price value |
| 27 |
3 50 150 |
| 28 |
4 4 16 |
| 29 |
18 3 54 |
| 30 |
SELECT * FROM mysqltest1.v1; |
| 31 |
a c c2 |
| 32 |
1 Thank GOD |
| 33 |
2 it is |
| 34 |
3 Friday TGIF |
| 35 |
connection slave; |
| 36 |
SELECT * FROM mysqltest1.v2; |
| 37 |
qty price value |
| 38 |
3 50 150 |
| 39 |
4 4 16 |
| 40 |
18 3 54 |
| 41 |
SELECT * FROM mysqltest1.v1; |
| 42 |
a c c2 |
| 43 |
1 Thank GOD |
| 44 |
2 it is |
| 45 |
3 Friday TGIF |
| 46 |
connection master; |
| 47 |
INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2; |
| 48 |
INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1; |
| 49 |
SELECT * FROM mysqltest1.t5 ORDER BY qty; |
| 50 |
qty price total |
| 51 |
3 50 150 |
| 52 |
4 4 16 |
| 53 |
18 3 54 |
| 54 |
SELECT * FROM mysqltest1.t3 ORDER BY a; |
| 55 |
a c c2 |
| 56 |
1 Thank GOD |
| 57 |
2 it is |
| 58 |
3 Friday TGIF |
| 59 |
connection slave; |
| 60 |
SELECT * FROM mysqltest1.t5 ORDER BY qty; |
| 61 |
qty price total |
| 62 |
3 50 150 |
| 63 |
4 4 16 |
| 64 |
18 3 54 |
| 65 |
SELECT * FROM mysqltest1.t3 ORDER BY a; |
| 66 |
a c c2 |
| 67 |
1 Thank GOD |
| 68 |
2 it is |
| 69 |
3 Friday TGIF |
| 70 |
connection master; |
| 71 |
INSERT INTO mysqltest1.v4 VALUES (4,'TEST'); |
| 72 |
SELECT * FROM mysqltest1.t1 ORDER BY a; |
| 73 |
a c |
| 74 |
1 Thank |
| 75 |
2 it |
| 76 |
3 Friday |
| 77 |
4 TEST |
| 78 |
SELECT * FROM mysqltest1.v4 ORDER BY a; |
| 79 |
a c |
| 80 |
2 it |
| 81 |
3 Friday |
| 82 |
4 TEST |
| 83 |
connection slave; |
| 84 |
SELECT * FROM mysqltest1.t1 ORDER BY a; |
| 85 |
a c |
| 86 |
1 Thank |
| 87 |
2 it |
| 88 |
3 Friday |
| 89 |
4 TEST |
| 90 |
SELECT * FROM mysqltest1.v4 ORDER BY a; |
| 91 |
a c |
| 92 |
2 it |
| 93 |
3 Friday |
| 94 |
4 TEST |
| 95 |
connection master; |
| 96 |
DROP VIEW IF EXISTS mysqltest1.v1; |
| 97 |
DROP VIEW IF EXISTS mysqltest1.v2; |
| 98 |
DROP VIEW IF EXISTS mysqltest1.v3; |
| 99 |
DROP VIEW IF EXISTS mysqltest1.v4; |
| 100 |
DROP TABLE IF EXISTS mysqltest1.t3; |
| 101 |
DROP TABLE IF EXISTS mysqltest1.t1; |
| 102 |
DROP TABLE IF EXISTS mysqltest1.t2; |
| 103 |
DROP TABLE IF EXISTS mysqltest1.t4; |
| 104 |
DROP DATABASE mysqltest1; |
| 105 |
connection slave; |
| 106 |
include/rpl_end.inc |