1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-5297 TIME(0), TIMESTAMP(0) and DATETIME(0) are self-incompatible during replication (upstream)

Fixed.
This commit is contained in:
Alexander Barkov
2013-12-06 19:02:55 +04:00
parent 0afd292073
commit 1f4f425a20
9 changed files with 123 additions and 13 deletions

View File

@ -0,0 +1,36 @@
include/master-slave.inc
[connection master]
#
# Testing replication from MariaDB-10.0 master
# started over MySQL-5.6 data directory
# to MariaDB-10.0 slave running with natively created tables
#
SET TIME_ZONE='+00:00';
SHOW CREATE TABLE mysql050614_temporal0;
Table Create Table
mysql050614_temporal0 CREATE TABLE `mysql050614_temporal0` (
`a` time DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE mysql050614_temporal1;
Table Create Table
mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
`a` time(1) DEFAULT NULL,
`b` datetime(1) DEFAULT NULL,
`c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SET TIME_ZONE='+00:00';
CREATE TABLE mysql050614_temporal0 (a time(0), b datetime(0), c timestamp(0)) engine=myisam;
CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) engine=myisam;
INSERT INTO mysql050614_temporal0 VALUES ('00:00:02','2001-01-01 00:00:02','2001-01-01 00:00:02');
INSERT INTO mysql050614_temporal1 VALUES ('00:00:02.1','2001-01-01 00:00:02.2','2001-01-01 00:00:02.3');
SELECT * FROM mysql050614_temporal0;
a b c
00:00:02 2001-01-01 00:00:02 2001-01-01 00:00:02
SELECT * FROM mysql050614_temporal1;
a b c
00:00:02.1 2001-01-01 00:00:02.2 2001-01-01 00:00:02.3
DROP TABLE mysql050614_temporal0;
DROP TABLE mysql050614_temporal1;
include/rpl_end.inc

View File

@ -0,0 +1,42 @@
--source include/master-slave.inc
--echo #
--echo # Testing replication from MariaDB-10.0 master
--echo # started over MySQL-5.6 data directory
--echo # to MariaDB-10.0 slave running with natively created tables
--echo #
connection master;
SET TIME_ZONE='+00:00';
let $MYSQLD_MASTER_DATADIR= `select @@datadir`;
--copy_file std_data/temporal_upgrade/mysql050614_temporal0.frm $MYSQLD_MASTER_DATADIR/test/mysql050614_temporal0.frm
--copy_file std_data/temporal_upgrade/mysql050614_temporal0.MYD $MYSQLD_MASTER_DATADIR/test/mysql050614_temporal0.MYD
--copy_file std_data/temporal_upgrade/mysql050614_temporal0.MYI $MYSQLD_MASTER_DATADIR/test/mysql050614_temporal0.MYI
--copy_file std_data/temporal_upgrade/mysql050614_temporal1.frm $MYSQLD_MASTER_DATADIR/test/mysql050614_temporal1.frm
--copy_file std_data/temporal_upgrade/mysql050614_temporal1.MYD $MYSQLD_MASTER_DATADIR/test/mysql050614_temporal1.MYD
--copy_file std_data/temporal_upgrade/mysql050614_temporal1.MYI $MYSQLD_MASTER_DATADIR/test/mysql050614_temporal1.MYI
SHOW CREATE TABLE mysql050614_temporal0;
SHOW CREATE TABLE mysql050614_temporal1;
connection slave;
SET TIME_ZONE='+00:00';
CREATE TABLE mysql050614_temporal0 (a time(0), b datetime(0), c timestamp(0)) engine=myisam;
CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) engine=myisam;
connection master;
INSERT INTO mysql050614_temporal0 VALUES ('00:00:02','2001-01-01 00:00:02','2001-01-01 00:00:02');
INSERT INTO mysql050614_temporal1 VALUES ('00:00:02.1','2001-01-01 00:00:02.2','2001-01-01 00:00:02.3');
sync_slave_with_master;
connection slave;
SELECT * FROM mysql050614_temporal0;
SELECT * FROM mysql050614_temporal1;
connection master;
DROP TABLE mysql050614_temporal0;
DROP TABLE mysql050614_temporal1;
--source include/rpl_end.inc