1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-28 17:36:30 +03:00
Files
mariadb/mysql-test/suite/rpl/r/rpl_create_drop_view.result
2015-04-13 22:36:49 +04:00

100 lines
1.3 KiB
Plaintext

include/master-slave.inc
[connection master]
CREATE TABLE t1(id INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
INSERT INTO t1 VALUES (5), (8), (10), (20), (30);
SELECT * FROM t1;
id
5
8
10
20
30
SELECT * FROM v1;
id
20
30
# Syncing slave with master
SELECT * FROM t1;
id
5
8
10
20
30
SELECT * FROM v1;
id
20
30
CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
ERROR 42S01: Table 'v1' already exists
CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
Warnings:
Note 1050 Table 'v1' already exists
CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
# Syncing slave with master
SELECT * FROM t1;
id
5
8
10
20
30
SELECT * FROM v1;
id
20
30
CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
INSERT INTO t1 VALUES (50), (80), (3), (2), (40);
SELECT * FROM t1;
id
5
8
10
20
30
50
80
3
2
40
SELECT * FROM v1;
id
20
30
50
80
40
# Syncing slave with master
SELECT * FROM t1;
id
5
8
10
20
30
50
80
3
2
40
SELECT * FROM v1;
id
20
30
50
80
40
DROP VIEW v1;
DROP TABLE t1;
DROP VIEW v1;
ERROR 42S02: Unknown table 'test.v1'
DROP VIEW IF EXISTS v2;
Warnings:
Note 1051 Unknown table 'test.v2'
# Syncing slave with master
SELECT * FROM v1;
ERROR 42S02: Table 'test.v1' doesn't exist
include/rpl_end.inc