1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-5528 Command line variable to choose MariaDB-5.3 vs MySQL-5.6 temporal data formats

This commit is contained in:
Alexander Barkov
2014-11-03 21:45:06 +04:00
parent a245543bc8
commit 43f185e171
53 changed files with 1643 additions and 588 deletions

View File

@@ -0,0 +1,83 @@
include/master-slave.inc
[connection master]
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
1
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
1
CREATE TABLE t1
(
c0 TIME(0),
c1 TIME(1),
c2 TIME(2),
c3 TIME(3),
c4 TIME(4),
c5 TIME(5),
c6 TIME(6)
);
CREATE TABLE t2
(
c0 TIMESTAMP(0),
c1 TIMESTAMP(1),
c2 TIMESTAMP(2),
c3 TIMESTAMP(3),
c4 TIMESTAMP(4),
c5 TIMESTAMP(5),
c6 TIMESTAMP(6)
);
CREATE TABLE t3
(
c0 DATETIME(0),
c1 DATETIME(1),
c2 DATETIME(2),
c3 DATETIME(3),
c4 DATETIME(4),
c5 DATETIME(5),
c6 DATETIME(6)
);
INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
c2 01:01:01.11
c3 01:01:01.111
c4 01:01:01.1111
c5 01:01:01.11111
c6 01:01:01.111111
SELECT * FROM t2;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT * FROM t3;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
SET @@global.mysql56_temporal_format=DEFAULT;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc

View File

@@ -0,0 +1,85 @@
include/master-slave.inc
[connection master]
SET @@global.mysql56_temporal_format=false;;
SET @@global.mysql56_temporal_format=false;;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
0
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
0
CREATE TABLE t1
(
c0 TIME(0),
c1 TIME(1),
c2 TIME(2),
c3 TIME(3),
c4 TIME(4),
c5 TIME(5),
c6 TIME(6)
);
CREATE TABLE t2
(
c0 TIMESTAMP(0),
c1 TIMESTAMP(1),
c2 TIMESTAMP(2),
c3 TIMESTAMP(3),
c4 TIMESTAMP(4),
c5 TIMESTAMP(5),
c6 TIMESTAMP(6)
);
CREATE TABLE t3
(
c0 DATETIME(0),
c1 DATETIME(1),
c2 DATETIME(2),
c3 DATETIME(3),
c4 DATETIME(4),
c5 DATETIME(5),
c6 DATETIME(6)
);
INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
c2 01:01:01.11
c3 01:01:01.111
c4 01:01:01.1111
c5 01:01:01.11111
c6 01:01:01.111111
SELECT * FROM t2;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT * FROM t3;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
SET @@global.mysql56_temporal_format=DEFAULT;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc

View File

@@ -0,0 +1,85 @@
include/master-slave.inc
[connection master]
SET @@global.mysql56_temporal_format=false;;
SET @@global.mysql56_temporal_format=true;;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
0
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
1
CREATE TABLE t1
(
c0 TIME(0),
c1 TIME(1),
c2 TIME(2),
c3 TIME(3),
c4 TIME(4),
c5 TIME(5),
c6 TIME(6)
);
CREATE TABLE t2
(
c0 TIMESTAMP(0),
c1 TIMESTAMP(1),
c2 TIMESTAMP(2),
c3 TIMESTAMP(3),
c4 TIMESTAMP(4),
c5 TIMESTAMP(5),
c6 TIMESTAMP(6)
);
CREATE TABLE t3
(
c0 DATETIME(0),
c1 DATETIME(1),
c2 DATETIME(2),
c3 DATETIME(3),
c4 DATETIME(4),
c5 DATETIME(5),
c6 DATETIME(6)
);
INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
c2 01:01:01.11
c3 01:01:01.111
c4 01:01:01.1111
c5 01:01:01.11111
c6 01:01:01.111111
SELECT * FROM t2;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT * FROM t3;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
SET @@global.mysql56_temporal_format=DEFAULT;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc

View File

@@ -0,0 +1,85 @@
include/master-slave.inc
[connection master]
SET @@global.mysql56_temporal_format=true;;
SET @@global.mysql56_temporal_format=false;;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
1
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
0
CREATE TABLE t1
(
c0 TIME(0),
c1 TIME(1),
c2 TIME(2),
c3 TIME(3),
c4 TIME(4),
c5 TIME(5),
c6 TIME(6)
);
CREATE TABLE t2
(
c0 TIMESTAMP(0),
c1 TIMESTAMP(1),
c2 TIMESTAMP(2),
c3 TIMESTAMP(3),
c4 TIMESTAMP(4),
c5 TIMESTAMP(5),
c6 TIMESTAMP(6)
);
CREATE TABLE t3
(
c0 DATETIME(0),
c1 DATETIME(1),
c2 DATETIME(2),
c3 DATETIME(3),
c4 DATETIME(4),
c5 DATETIME(5),
c6 DATETIME(6)
);
INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
c2 01:01:01.11
c3 01:01:01.111
c4 01:01:01.1111
c5 01:01:01.11111
c6 01:01:01.111111
SELECT * FROM t2;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT * FROM t3;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
SET @@global.mysql56_temporal_format=DEFAULT;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc

View File

@@ -0,0 +1,85 @@
include/master-slave.inc
[connection master]
SET @@global.mysql56_temporal_format=true;;
SET @@global.mysql56_temporal_format=true;;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
1
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
1
CREATE TABLE t1
(
c0 TIME(0),
c1 TIME(1),
c2 TIME(2),
c3 TIME(3),
c4 TIME(4),
c5 TIME(5),
c6 TIME(6)
);
CREATE TABLE t2
(
c0 TIMESTAMP(0),
c1 TIMESTAMP(1),
c2 TIMESTAMP(2),
c3 TIMESTAMP(3),
c4 TIMESTAMP(4),
c5 TIMESTAMP(5),
c6 TIMESTAMP(6)
);
CREATE TABLE t3
(
c0 DATETIME(0),
c1 DATETIME(1),
c2 DATETIME(2),
c3 DATETIME(3),
c4 DATETIME(4),
c5 DATETIME(5),
c6 DATETIME(6)
);
INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
c2 01:01:01.11
c3 01:01:01.111
c4 01:01:01.1111
c5 01:01:01.11111
c6 01:01:01.111111
SELECT * FROM t2;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT * FROM t3;;
c0 2001-01-01 01:01:01
c1 2001-01-01 01:01:01.1
c2 2001-01-01 01:01:01.11
c3 2001-01-01 01:01:01.111
c4 2001-01-01 01:01:01.1111
c5 2001-01-01 01:01:01.11111
c6 2001-01-01 01:01:01.111111
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
SET @@global.mysql56_temporal_format=DEFAULT;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc

View File

@@ -20,17 +20,31 @@ mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
`b` datetime(1) DEFAULT NULL,
`c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @@mysql56_temporal_format;
@@mysql56_temporal_format
1
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 TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 2 13 26
mysql050614_temporal1 1 16 16
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
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 1 13 13
mysql050614_temporal1 1 16 16
SET @@global.mysql56_temporal_format=DEFAULT;
DROP TABLE mysql050614_temporal0;
DROP TABLE mysql050614_temporal1;
include/rpl_end.inc

View File

@@ -0,0 +1,51 @@
include/master-slave.inc
[connection master]
SET @@global.mysql56_temporal_format=false;;
#
# 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
SELECT @@mysql56_temporal_format;
@@mysql56_temporal_format
0
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 TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 2 13 26
mysql050614_temporal1 1 16 16
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
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 1 16 16
mysql050614_temporal1 1 16 16
SET @@global.mysql56_temporal_format=DEFAULT;
DROP TABLE mysql050614_temporal0;
DROP TABLE mysql050614_temporal1;
include/rpl_end.inc

View File

@@ -0,0 +1,76 @@
--source include/master-slave.inc
if ($force_master_mysql56_temporal_format)
{
connection master;
eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format;
}
if ($force_slave_mysql56_temporal_format)
{
connection slave;
eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
}
connection master;
SELECT @@global.mysql56_temporal_format AS on_master;
connection slave;
SELECT @@global.mysql56_temporal_format AS on_slave;
connection master;
CREATE TABLE t1
(
c0 TIME(0),
c1 TIME(1),
c2 TIME(2),
c3 TIME(3),
c4 TIME(4),
c5 TIME(5),
c6 TIME(6)
);
CREATE TABLE t2
(
c0 TIMESTAMP(0),
c1 TIMESTAMP(1),
c2 TIMESTAMP(2),
c3 TIMESTAMP(3),
c4 TIMESTAMP(4),
c5 TIMESTAMP(5),
c6 TIMESTAMP(6)
);
CREATE TABLE t3
(
c0 DATETIME(0),
c1 DATETIME(1),
c2 DATETIME(2),
c3 DATETIME(3),
c4 DATETIME(4),
c5 DATETIME(5),
c6 DATETIME(6)
);
INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
sync_slave_with_master;
connection slave;
--query_vertical SELECT * FROM t1;
--query_vertical SELECT * FROM t2;
--query_vertical SELECT * FROM t3;
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
connection slave;
SET @@global.mysql56_temporal_format=DEFAULT;
connection master;
SET @@global.mysql56_temporal_format=DEFAULT;
--source include/rpl_end.inc

View File

@@ -0,0 +1,4 @@
--let $force_master_mysql56_temporal_format=false;
--let $force_slave_mysql56_temporal_format=false;
--source rpl_temporal_format_default_to_default.test

View File

@@ -0,0 +1,14 @@
#
# MariaDB-5.3 fractional temporal types do not store metadata
# when running with --binlog-format=row, thus can replicate
# only into a field with exactly the same data type and format.
#
# Skip when running with --binlog-format=row.
# But mixed and statement formats should work without problems.
#
-- source include/have_binlog_format_mixed_or_statement.inc
--let $force_master_mysql56_temporal_format=false;
--let $force_slave_mysql56_temporal_format=true;
--source rpl_temporal_format_default_to_default.test

View File

@@ -0,0 +1,4 @@
--let $force_master_mysql56_temporal_format=true;
--let $force_slave_mysql56_temporal_format=false;
--source rpl_temporal_format_default_to_default.test

View File

@@ -0,0 +1,4 @@
--let $force_master_mysql56_temporal_format=true;
--let $force_slave_mysql56_temporal_format=true;
--source rpl_temporal_format_default_to_default.test

View File

@@ -1,5 +1,12 @@
--source include/master-slave.inc
if ($force_slave_mysql56_temporal_format)
{
connection slave;
eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
connection master;
}
--echo #
--echo # Testing replication from MariaDB-10.0 master
@@ -22,6 +29,7 @@ SHOW CREATE TABLE mysql050614_temporal0;
SHOW CREATE TABLE mysql050614_temporal1;
connection slave;
SELECT @@mysql56_temporal_format;
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;
@@ -29,11 +37,16 @@ CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) en
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');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
sync_slave_with_master;
connection slave;
SELECT * FROM mysql050614_temporal0;
SELECT * FROM mysql050614_temporal1;
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
SET @@global.mysql56_temporal_format=DEFAULT;
connection master;
DROP TABLE mysql050614_temporal0;

View File

@@ -0,0 +1,2 @@
--let $force_slave_mysql56_temporal_format=false;
--source rpl_temporal_mysql56_to_mariadb.test