summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/compat/maxdb
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/compat/maxdb
parentInitial commit. (diff)
downloadmariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz
mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/compat/maxdb')
-rw-r--r--mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result65
-rw-r--r--mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test33
-rw-r--r--mysql-test/suite/compat/maxdb/type_timestamp.result53
-rw-r--r--mysql-test/suite/compat/maxdb/type_timestamp.test29
4 files changed, 180 insertions, 0 deletions
diff --git a/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result
new file mode 100644
index 00000000..727c7949
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.result
@@ -0,0 +1,65 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+#
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:00:00');
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT NOW());
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
+SET sql_mode=MAXDB;
+CREATE TABLE t2 SELECT * FROM t1;
+SET timestamp=DEFAULT;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT NOW())
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (NULL)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES ('2001-01-01 10:20:30')
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE "t2" (
+ "a" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp()
+)
+master-bin.000001 # Annotate_rows # # CREATE TABLE t2 SELECT * FROM t1
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+connection slave;
+SELECT * FROM t1;
+a
+2001-01-01 10:00:00
+2001-01-01 10:20:30
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "a" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp()
+)
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE "t2" (
+ "a" mariadb_schema.timestamp NOT NULL DEFAULT current_timestamp()
+)
+connection master;
+DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test
new file mode 100644
index 00000000..f4a82661
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/rpl_mariadb_timestamp.test
@@ -0,0 +1,33 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+--echo #
+
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:00:00');
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT NOW());
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
+SET sql_mode=MAXDB;
+CREATE TABLE t2 SELECT * FROM t1;
+SET timestamp=DEFAULT;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+SELECT * FROM t1;
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection master
+DROP TABLE t1, t2;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/compat/maxdb/type_timestamp.result b/mysql-test/suite/compat/maxdb/type_timestamp.result
new file mode 100644
index 00000000..f6612ab1
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/type_timestamp.result
@@ -0,0 +1,53 @@
+#
+# MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+#
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (
+def_timestamp TIMESTAMP,
+mdb_timestamp mariadb_schema.TIMESTAMP,
+ora_timestamp oracle_schema.TIMESTAMP,
+max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `def_timestamp` timestamp NULL DEFAULT NULL,
+ `mdb_timestamp` timestamp NULL DEFAULT NULL,
+ `ora_timestamp` timestamp NULL DEFAULT NULL,
+ `max_timestamp` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "def_timestamp" mariadb_schema.timestamp NULL DEFAULT NULL,
+ "mdb_timestamp" mariadb_schema.timestamp NULL DEFAULT NULL,
+ "ora_timestamp" mariadb_schema.timestamp NULL DEFAULT NULL,
+ "max_timestamp" datetime DEFAULT NULL
+)
+DROP TABLE t1;
+SET sql_mode=MAXDB;
+CREATE TABLE t1 (
+def_timestamp TIMESTAMP,
+mdb_timestamp mariadb_schema.TIMESTAMP,
+ora_timestamp oracle_schema.TIMESTAMP,
+max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "def_timestamp" datetime DEFAULT NULL,
+ "mdb_timestamp" mariadb_schema.timestamp NULL DEFAULT NULL,
+ "ora_timestamp" mariadb_schema.timestamp NULL DEFAULT NULL,
+ "max_timestamp" datetime DEFAULT NULL
+)
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `def_timestamp` datetime DEFAULT NULL,
+ `mdb_timestamp` timestamp NULL DEFAULT NULL,
+ `ora_timestamp` timestamp NULL DEFAULT NULL,
+ `max_timestamp` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/maxdb/type_timestamp.test b/mysql-test/suite/compat/maxdb/type_timestamp.test
new file mode 100644
index 00000000..cd60ffc0
--- /dev/null
+++ b/mysql-test/suite/compat/maxdb/type_timestamp.test
@@ -0,0 +1,29 @@
+--echo #
+--echo # MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode
+--echo #
+
+
+SET sql_mode=DEFAULT;
+CREATE TABLE t1 (
+ def_timestamp TIMESTAMP,
+ mdb_timestamp mariadb_schema.TIMESTAMP,
+ ora_timestamp oracle_schema.TIMESTAMP,
+ max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+SET sql_mode=MAXDB;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+SET sql_mode=MAXDB;
+CREATE TABLE t1 (
+ def_timestamp TIMESTAMP,
+ mdb_timestamp mariadb_schema.TIMESTAMP,
+ ora_timestamp oracle_schema.TIMESTAMP,
+ max_timestamp maxdb_schema.TIMESTAMP
+);
+SHOW CREATE TABLE t1;
+SET sql_mode=DEFAULT;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;