summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts/t/partition_exch_qa_11.test
blob: 3283c65966b03e0c4112e140d1a01c064e6bc8db (plain)
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
# Author: Horst Hunger
# Created: 2010-07-13

--source include/have_partition.inc

let $engine_table= MYISAM;
let $engine_part= MYISAM;
let $engine_subpart= MYISAM;

use test;

--disable_result_log
--disable_query_log
--source suite/parts/inc/part_exch_tabs.inc
--enable_result_log
--enable_query_log

# 13) Exchange with dynamic variables.
SET @part= 'p0';
SET @part_tab= 'tp';
SET @table= 't_10';
SET @s= CONCAT('ALTER TABLE ',@part_tab,' EXCHANGE PARTITION ',@part,' WITH TABLE ',@table);
PREPARE test_stmt1 FROM @s;
EXECUTE test_stmt1;
--sorted_result
SELECT * FROM t_10;
--sorted_result
SELECT * FROM tp;
DEALLOCATE PREPARE test_stmt1;

SET @part_tab= 'tp';
SET @s= CONCAT('ALTER TABLE ',@part_tab,' EXCHANGE PARTITION ? WITH TABLE ?');
--error ER_PARSE_ERROR
PREPARE test_stmt2 FROM @s;

--source suite/parts/inc/part_exch_drop_tabs.inc