-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathpart_exch_qa_4.inc
45 lines (38 loc) · 1.11 KB
/
part_exch_qa_4.inc
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
CREATE DATABASE test_2;
USE test;
--disable_result_log
--disable_query_log
--source suite/parts/inc/part_exch_tabs.inc
USE test_2;
--source suite/parts/inc/part_exch_tabs.inc
--enable_result_log
--enable_query_log
USE test;
# 10) Exchanges with different databases.
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE test_2.t_10;
--sorted_result
SELECT * FROM test_2.t_10;
--sorted_result
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
# Back to former values.
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE test_2.t_10;
--sorted_result
SELECT * FROM test_2.t_10;
--sorted_result
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE test_2.tsp_00;
--sorted_result
SELECT * FROM test_2.tsp_00;
--sorted_result
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
# Back to former values.
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE test_2.tsp_00;
--sorted_result
SELECT * FROM test_2.tsp_00;
--sorted_result
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
--source suite/parts/inc/part_exch_drop_tabs.inc
USE test_2;
--source suite/parts/inc/part_exch_drop_tabs.inc
USE test;
DROP DATABASE test_2;