summaryrefslogtreecommitdiff
path: root/mysql-test/main/prepare.result
blob: c1a2969212bd56763a1a5ae70a33ca64c536ed93 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PREPARE stmt1 FROM "
SELECT table_name FROM information_schema.tables
WHERE table_name = 't1_first'
UNION ALL
SELECT table_name FROM information_schema.tables
WHERE table_name = 't1_second'";
execute stmt1;
table_name
execute stmt1;
table_name
create or replace table t1 (a int primary key, table_name char(40));
insert into t1 values(1,"t1_first");
insert into t1 values(2,"t1_second");
PREPARE stmt2 FROM "
SELECT table_name FROM t1
WHERE table_name = 't1_first'
UNION ALL
SELECT table_name FROM t1
WHERE table_name = 't1_second'";
execute stmt2;
table_name
t1_first
t1_second
execute stmt2;
table_name
t1_first
t1_second
flush tables;
execute stmt2;
table_name
t1_first
t1_second
alter table t1 add column b int;
execute stmt2;
table_name
t1_first
t1_second
execute stmt2;
table_name
t1_first
t1_second
drop table t1;
execute stmt2;
ERROR 42S02: Table 'test.t1' doesn't exist
create or replace table t1 (a int primary key, table_name char(40));
insert into t1 values(1,"t1_first");
execute stmt2;
table_name
t1_first
deallocate prepare stmt1;
deallocate prepare stmt2;
drop table t1;