summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/federated/federated_partition.test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mysql-test/suite/federated/federated_partition.test79
1 files changed, 79 insertions, 0 deletions
diff --git a/mysql-test/suite/federated/federated_partition.test b/mysql-test/suite/federated/federated_partition.test
new file mode 100644
index 00000000..42f56134
--- /dev/null
+++ b/mysql-test/suite/federated/federated_partition.test
@@ -0,0 +1,79 @@
+#
+# Tests for partitioned FEDERATED
+#
+source have_federatedx.inc;
+source include/have_partition.inc;
+source include/have_innodb.inc;
+source include/federated.inc;
+
+disable_warnings;
+drop table if exists t1;
+enable_warnings;
+
+#
+# Federated + partition
+#
+# Create 2 tables on the Slave, we can use different storage engines.
+# Then create a Federated table on the Master, using different connect
+# string to specify the two different target partitions we want to use.
+#
+
+connection slave;
+create table federated.t1_1 (s1 int primary key) engine=myisam;
+create table federated.t1_2 (s1 int primary key) engine=innodb;
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table t1 (s1 int primary key) engine=federated
+ CONNECTION="remember_this"
+ partition by list (s1)
+ (partition p1 values in (1,3)
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_1',
+ partition p2 values in (2,4)
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_2');
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+show create table t1;
+
+insert into t1 values (1), (2), (3), (4);
+select * from t1;
+
+connection slave;
+select * from federated.t1_1;
+select * from federated.t1_2;
+
+connection master;
+drop table t1;
+
+connection slave;
+drop table federated.t1_1;
+drop table federated.t1_2;
+
+--echo End of 5.1 tests
+
+--echo #
+--echo # MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from partitioned table
+--echo #
+connection slave;
+use federated;
+create table t1_1 (x int, b text, key(x));
+create table t1_2 (x int, b text, key(x));
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table t1 (x int, b text, key(x)) engine=federated
+ partition by range columns (x) (
+ partition p1 values less than (40) connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_1',
+ partition pn values less than (maxvalue) connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_2'
+);
+insert t1 values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8);
+insert t1 select x + 8, x + 8 from t1;
+insert t1 select x + 16, x + 16 from t1;
+insert t1 select x + 49, repeat(x + 49, 100) from t1;
+flush tables;
+--echo # This produces wrong result before MDEV-17573
+select x, left(b, 10) from t1 where x > 30 and x < 60 order by b;
+drop table t1;
+connection slave;
+drop table t1_1, t1_2;
+
+source include/federated_cleanup.inc;