File: federated_partition.test

package info (click to toggle)
mariadb-10.0 10.0.32-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 476,064 kB
  • sloc: cpp: 1,400,131; ansic: 832,140; perl: 54,391; sh: 41,304; pascal: 32,365; yacc: 14,921; xml: 5,257; sql: 4,667; cs: 4,647; makefile: 4,555; ruby: 4,465; python: 2,292; lex: 1,427; java: 941; asm: 295; awk: 54; php: 22; sed: 16
file content (53 lines) | stat: -rw-r--r-- 1,345 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# 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
  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

source include/federated_cleanup.inc;