1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Added support for replication for S3

MDEV-19964 S3 replication support

Added new configure options:
s3_slave_ignore_updates
"If the slave has shares same S3 storage as the master"

s3_replicate_alter_as_create_select
"When converting S3 table to local table, log all rows in binary log"

This allows on to configure slaves to have the S3 storage shared or
independent from the master.

Other thing:
Added new session variable '@@sql_if_exists' to force IF_EXIST to DDL's.
This commit is contained in:
Monty
2019-12-30 13:56:19 +02:00
parent e5de1e26e7
commit 6a9e24d046
70 changed files with 1499 additions and 350 deletions

View File

@@ -96,7 +96,15 @@ s3_pagecache_division_limit X
s3_pagecache_file_hash_size X
s3_protocol_version X
s3_region X
s3_replicate_alter_as_create_select X
s3_secret_key X
s3_slave_ignore_updates X
show variables like "s3_slave%";
Variable_name Value
s3_slave_ignore_updates OFF
show variables like "s3_replicate%";
Variable_name Value
s3_replicate_alter_as_create_select ON
show status like "s3%";
Variable_name Value
S3_pagecache_blocks_not_flushed X

View File

@@ -47,8 +47,12 @@ drop table t1;
--replace_column 2 X
show variables like "s3%";
show variables like "s3_slave%";
show variables like "s3_replicate%";
--replace_column 2 X
show status like "s3%";
#
# clean up
#

View File

@@ -9,3 +9,12 @@ s3=ON
#s3-access-key=...
#s3-secret-key=...
#s3-region=eu-north-1
[mysqld.2]
s3=ON
#s3-host-name=s3.amazonaws.com
#s3-protocol-version=Amazon
#s3-bucket=MariaDB
#s3-access-key=...
#s3-secret-key=...
#s3-region=eu-north-1

View File

@@ -0,0 +1,179 @@
--source include/have_s3.inc
--source include/have_sequence.inc
#
# Tests for S3 replication
#
connection slave;
let $SLAVE_DATADIR= `select @@datadir`;
connection master;
#
# Create unique database for running the tests
#
--source create_database.inc
--echo #
--echo # Test ALTER TABLE ENGINE S3
--echo #
create table t1 (a int, b int) engine=aria;
insert into t1 select seq,seq+10 from seq_1_to_10;
alter table t1 engine=s3;
show create table t1;
sync_slave_with_master;
--replace_result $database database
--eval use $database
select * from t1 limit 2;
--file_exists $SLAVE_DATADIR/$database/t1.frm
connection master;
alter table t1 add column c int;
sync_slave_with_master;
--error 1
--file_exists $SLAVE_DATADIR/$database/t1.frm
--replace_result $database database
select * from t1,t1 as t1_tmp limit 2;
--echo # Now test when the .frm table is out of date on the slave
stop slave;
connection master;
alter table t1 add column d int, engine=s3;
connection slave;
select * from t1 limit 2;
start slave;
connection master;
sync_slave_with_master;
select * from t1 limit 2;
--echo # Same without tables in the table cache;
stop slave;
flush tables;
connection master;
alter table t1 add column e int, engine=s3;
connection slave;
select * from t1 limit 2;
start slave;
connection master;
sync_slave_with_master;
select * from t1 limit 2;
connection master;
--echo # Convert S3 table to Aria. Rows should be binary logged
alter table t1 engine=aria;
sync_slave_with_master;
select * from t1 limit 2;
show create table t1;
--echo # Convert S3 table to Aria with rename. Rows should be binary logged
connection master;
alter table t1 engine=s3;
alter table t1 rename t2, engine=aria;
sync_slave_with_master;
select * from t2 limit 2;
show create table t2;
connection master;
drop table t2;
--echo #
--echo # Test RENAME
--echo #
create table t1 (a int, b int) engine=aria;
insert into t1 select seq,seq+10 from seq_1_to_10;
alter table t1 engine=s3;
rename table t1 to t2;
sync_slave_with_master;
--replace_result $database database
--error 1
--file_exists $SLAVE_DATADIR/$database/t2.frm
--error ER_NO_SUCH_TABLE
select * from t1 limit 2;
select * from t2 limit 2;
connection master;
alter table t2 add column f int, rename t1;
select * from t1 limit 2;
sync_slave_with_master;
--error 1
--file_exists $SLAVE_DATADIR/$database/t1.frm
--error 1
--file_exists $SLAVE_DATADIR/$database/t2.frm
select * from t1 limit 2;
--replace_result $database database
--error ER_NO_SUCH_TABLE
select * from t2 limit 2;
# Check rename of table when a new table has replaced the original one
connection slave;
stop slave;
connection master;
rename table t1 to t2;
create table t1 (a int, b int) engine=aria;
alter table t1 engine=s3;
connection slave;
start slave;
connection master;
sync_slave_with_master;
select * from t1 limit 2;
select * from t2 limit 2;
connection master;
--echo #
--echo # Test DROP
--echo #
drop table t1,t2;
sync_slave_with_master;
--error 1
--file_exists $SLAVE_DATADIR/$database/t1.frm
--error 1
--file_exists $SLAVE_DATADIR/$database/t2.frm
--replace_result $database database
--error ER_NO_SUCH_TABLE
select * from t1 limit 2;
--replace_result $database database
--error ER_NO_SUCH_TABLE
select * from t2 limit 2;
connection master;
--echo #
--echo # Test LIKE
--echo #
create table t1 (a int,b int);
alter table t1 engine=s3;
--replace_result $database database
--error ER_CANT_CREATE_TABLE
create table t2 like t1;
sync_slave_with_master;
--replace_result $database database
--error ER_NO_SUCH_TABLE
show create table t2;
connection master;
--replace_result $database database
drop table if exists t1,t2;
--echo #
--echo # Check slave binary log
--echo #
sync_slave_with_master;
--let $binlog_database=$database
--source include/show_binlog_events.inc
connection master;
--echo #
--echo # clean up
--echo #
--source drop_database.inc
sync_slave_with_master;
--source include/rpl_end.inc

View File

@@ -0,0 +1,2 @@
!include ../rpl/my.cnf
!include ./my.cnf

View File

@@ -0,0 +1,261 @@
include/master-slave.inc
[connection master]
set binlog_format=mixed;
RESET MASTER;
connection slave;
set binlog_format=mixed;
RESET MASTER;
connection master;
connection slave;
connection master;
#
# Test ALTER TABLE ENGINE S3
#
create table t1 (a int, b int) engine=aria;
insert into t1 select seq,seq+10 from seq_1_to_10;
alter table t1 engine=s3;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=S3 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
connection slave;
use database;
select * from t1 limit 2;
a b
1 11
2 12
connection master;
alter table t1 add column c int;
connection slave;
select * from t1,t1 as t1_tmp limit 2;
a b c a b c
1 11 NULL 1 11 NULL
2 12 NULL 1 11 NULL
# Now test when the .frm table is out of date on the slave
stop slave;
connection master;
alter table t1 add column d int, engine=s3;
connection slave;
select * from t1 limit 2;
a b c d
1 11 NULL NULL
2 12 NULL NULL
start slave;
connection master;
connection slave;
select * from t1 limit 2;
a b c d
1 11 NULL NULL
2 12 NULL NULL
# Same without tables in the table cache;
stop slave;
flush tables;
connection master;
alter table t1 add column e int, engine=s3;
connection slave;
select * from t1 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
start slave;
connection master;
connection slave;
select * from t1 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
connection master;
# Convert S3 table to Aria. Rows should be binary logged
alter table t1 engine=aria;
connection slave;
select * from t1 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
# Convert S3 table to Aria with rename. Rows should be binary logged
connection master;
alter table t1 engine=s3;
alter table t1 rename t2, engine=aria;
connection slave;
select * from t2 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
connection master;
drop table t2;
#
# Test RENAME
#
create table t1 (a int, b int) engine=aria;
insert into t1 select seq,seq+10 from seq_1_to_10;
alter table t1 engine=s3;
rename table t1 to t2;
connection slave;
select * from t1 limit 2;
ERROR 42S02: Table 'database.t1' doesn't exist
select * from t2 limit 2;
a b
1 11
2 12
connection master;
alter table t2 add column f int, rename t1;
select * from t1 limit 2;
a b f
1 11 NULL
2 12 NULL
connection slave;
select * from t1 limit 2;
a b f
1 11 NULL
2 12 NULL
select * from t2 limit 2;
ERROR 42S02: Table 'database.t2' doesn't exist
connection slave;
stop slave;
connection master;
rename table t1 to t2;
create table t1 (a int, b int) engine=aria;
alter table t1 engine=s3;
connection slave;
start slave;
connection master;
connection slave;
select * from t1 limit 2;
a b
select * from t2 limit 2;
a b f
1 11 NULL
2 12 NULL
connection master;
#
# Test DROP
#
drop table t1,t2;
connection slave;
select * from t1 limit 2;
ERROR 42S02: Table 'database.t1' doesn't exist
select * from t2 limit 2;
ERROR 42S02: Table 'database.t2' doesn't exist
connection master;
#
# Test LIKE
#
create table t1 (a int,b int);
alter table t1 engine=s3;
create table t2 like t1;
ERROR HY000: Can't create table `database`.`t2` (errno: 131 "Command not supported by the engine")
connection slave;
show create table t2;
ERROR 42S02: Table 'database.t2' doesn't exist
connection master;
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'database.t2'
#
# Check slave binary log
#
connection slave;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # create database database
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int, b int) engine=aria
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `database`; insert into t1 select seq,seq+10 from seq_1_to_10
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t1 add column c int
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t1 add column d int, engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; flush tables
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t1 add column e int, engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Annotate_rows # # alter table t1 engine=aria
slave-bin.000001 # Table_map # # table_id: # (database.t1)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Annotate_rows # # alter table t1 rename t2, engine=aria
slave-bin.000001 # Table_map # # table_id: # (database.t2)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t2` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int, b int) engine=aria
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `database`; insert into t1 select seq,seq+10 from seq_1_to_10
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; rename table t1 to t2
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t2 add column f int, rename t1
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; rename table t1 to t2
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int, b int) engine=aria
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int,b int)
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by server */
connection master;
#
# clean up
#
connection slave;
include/rpl_end.inc

View File

@@ -0,0 +1,11 @@
--source include/master-slave.inc
--source include/have_binlog_format_mixed.inc
set binlog_format=mixed;
RESET MASTER;
connection slave;
set binlog_format=mixed;
RESET MASTER;
connection master;
--source replication.inc

View File

@@ -0,0 +1,2 @@
!include ../rpl/my.cnf
!include ./my.cnf

View File

@@ -0,0 +1,261 @@
include/master-slave.inc
[connection master]
set binlog_format=statement;
RESET MASTER;
connection slave;
set binlog_format=statement;
RESET MASTER;
connection master;
connection slave;
connection master;
#
# Test ALTER TABLE ENGINE S3
#
create table t1 (a int, b int) engine=aria;
insert into t1 select seq,seq+10 from seq_1_to_10;
alter table t1 engine=s3;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=S3 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
connection slave;
use database;
select * from t1 limit 2;
a b
1 11
2 12
connection master;
alter table t1 add column c int;
connection slave;
select * from t1,t1 as t1_tmp limit 2;
a b c a b c
1 11 NULL 1 11 NULL
2 12 NULL 1 11 NULL
# Now test when the .frm table is out of date on the slave
stop slave;
connection master;
alter table t1 add column d int, engine=s3;
connection slave;
select * from t1 limit 2;
a b c d
1 11 NULL NULL
2 12 NULL NULL
start slave;
connection master;
connection slave;
select * from t1 limit 2;
a b c d
1 11 NULL NULL
2 12 NULL NULL
# Same without tables in the table cache;
stop slave;
flush tables;
connection master;
alter table t1 add column e int, engine=s3;
connection slave;
select * from t1 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
start slave;
connection master;
connection slave;
select * from t1 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
connection master;
# Convert S3 table to Aria. Rows should be binary logged
alter table t1 engine=aria;
connection slave;
select * from t1 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
# Convert S3 table to Aria with rename. Rows should be binary logged
connection master;
alter table t1 engine=s3;
alter table t1 rename t2, engine=aria;
connection slave;
select * from t2 limit 2;
a b c d e
1 11 NULL NULL NULL
2 12 NULL NULL NULL
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
connection master;
drop table t2;
#
# Test RENAME
#
create table t1 (a int, b int) engine=aria;
insert into t1 select seq,seq+10 from seq_1_to_10;
alter table t1 engine=s3;
rename table t1 to t2;
connection slave;
select * from t1 limit 2;
ERROR 42S02: Table 'database.t1' doesn't exist
select * from t2 limit 2;
a b
1 11
2 12
connection master;
alter table t2 add column f int, rename t1;
select * from t1 limit 2;
a b f
1 11 NULL
2 12 NULL
connection slave;
select * from t1 limit 2;
a b f
1 11 NULL
2 12 NULL
select * from t2 limit 2;
ERROR 42S02: Table 'database.t2' doesn't exist
connection slave;
stop slave;
connection master;
rename table t1 to t2;
create table t1 (a int, b int) engine=aria;
alter table t1 engine=s3;
connection slave;
start slave;
connection master;
connection slave;
select * from t1 limit 2;
a b
select * from t2 limit 2;
a b f
1 11 NULL
2 12 NULL
connection master;
#
# Test DROP
#
drop table t1,t2;
connection slave;
select * from t1 limit 2;
ERROR 42S02: Table 'database.t1' doesn't exist
select * from t2 limit 2;
ERROR 42S02: Table 'database.t2' doesn't exist
connection master;
#
# Test LIKE
#
create table t1 (a int,b int);
alter table t1 engine=s3;
create table t2 like t1;
ERROR HY000: Can't create table `database`.`t2` (errno: 131 "Command not supported by the engine")
connection slave;
show create table t2;
ERROR 42S02: Table 'database.t2' doesn't exist
connection master;
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'database.t2'
#
# Check slave binary log
#
connection slave;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # create database database
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int, b int) engine=aria
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `database`; insert into t1 select seq,seq+10 from seq_1_to_10
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t1 add column c int
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t1 add column d int, engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; flush tables
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t1 add column e int, engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Annotate_rows # # alter table t1 engine=aria
slave-bin.000001 # Table_map # # table_id: # (database.t1)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
`e` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Annotate_rows # # alter table t1 rename t2, engine=aria
slave-bin.000001 # Table_map # # table_id: # (database.t2)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t2` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int, b int) engine=aria
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `database`; insert into t1 select seq,seq+10 from seq_1_to_10
slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; rename table t1 to t2
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; alter table t2 add column f int, rename t1
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; set @@sql_if_exists=1; rename table t1 to t2
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int, b int) engine=aria
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; create table t1 (a int,b int)
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; alter table t1 engine=s3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `database`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by server */
connection master;
#
# clean up
#
connection slave;
include/rpl_end.inc

View File

@@ -0,0 +1,11 @@
--source include/master-slave.inc
--source include/have_binlog_format_statement.inc
set binlog_format=statement;
RESET MASTER;
connection slave;
set binlog_format=statement;
RESET MASTER;
connection master;
--source replication.inc

View File

@@ -6,3 +6,10 @@ create temporary table t1 (a int);
alter table t1 engine=S3;
ERROR HY000: Can't create table `database`.`t1` (errno: 131 "Command not supported by the engine")
drop temporary table t1;
#
# CREATE of S3 table
#
create or replace table t1 (a int, b int, key (a)) engine=S3;
ERROR HY000: Can't create table `database`.`t1` (errno: 131 "Command not supported by the engine")
select * from t1;
ERROR 42S02: Table 'database.t1' doesn't exist

View File

@@ -26,6 +26,18 @@ create temporary table t1 (a int);
alter table t1 engine=S3;
drop temporary table t1;
--echo #
--echo # CREATE of S3 table
--echo #
--replace_result $database database
--error ER_CANT_CREATE_TABLE
create or replace table t1 (a int, b int, key (a)) engine=S3;
--replace_result $database database
--error ER_NO_SUCH_TABLE
select * from t1;
#
# clean up
#
--source drop_database.inc