mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed bug #28244.
When the same VIEW was created at the master side twice, malformed (truncated after the word 'AS') query string was forwarded to client side, so error messages on the master and client was different, and replication was broken. The mysql_register_view function call failed too early: fields of `view' output argument of this function was not filled yet with correct data required for query replication. The mysql_register_view function also copied pointers to local buffers into a memory allocated by the caller. sql/sql_view.cc: Fixed bug #28244. Checking of existence of VIEW .frm file has been moved down to the place, when `view' argument is completely filled with proper data. view->query.str and view->query.md5 pointers has been set to the NULL before return from the mysql_register_view function. mysql-test/t/rpl_view.test: Updated test case for bug #28244. mysql-test/r/rpl_view.result: Updated test case for bug #28244.
This commit is contained in:
@ -106,4 +106,10 @@ a b
|
||||
1 6
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
ERROR 42S01: Table 'v1' already exists
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -149,4 +149,16 @@ drop view v1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# BUG#28244 CREATE VIEW breaks replication when view exists
|
||||
#
|
||||
connection master;
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user