mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
b766a51f41
'CREATE TABLE IF NOT EXISTS ... SELECT' behaviour BUG#55474, BUG#55499, BUG#55598, BUG#55616 and BUG#55777 are fixed in this patch too. This is the 5.1 part. It implements: - if the table exists, binlog two events: CREATE TABLE IF NOT EXISTS and INSERT ... SELECT - Insert nothing and binlog nothing on master if the existing object is a view. It only generates a warning that table already exists.
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
# #############################################################################
|
|
# Check whether the given table is consistent between different master and
|
|
# slaves
|
|
#
|
|
# Usage:
|
|
# --let $diff_table= test.t1
|
|
# --let $diff_server_list= master, slave, slave2
|
|
# --source include/rpl_diff_tables.inc
|
|
# #############################################################################
|
|
|
|
if (`SELECT "XX$diff_table" = "XX"`)
|
|
{
|
|
--die diff_table is null.
|
|
}
|
|
|
|
--let $_servers= master, slave
|
|
if (`SELECT "XX$diff_server_list" <> "XX"`)
|
|
{
|
|
--let $_servers= $diff_server_list
|
|
}
|
|
|
|
--let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
|
|
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))`
|
|
connection $_master;
|
|
while (`SELECT "XX$_servers" <> "XX"`)
|
|
{
|
|
--let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
|
|
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))`
|
|
|
|
--sync_slave_with_master $_slave
|
|
--let $diff_table_1= $_master:$diff_table
|
|
--let $diff_table_2= $_slave:$diff_table
|
|
--source include/diff_tables.inc
|
|
connection $_slave;
|
|
}
|
|
connection $_master;
|