mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
eaae13059f
Closes #1844
66 lines
1.4 KiB
Text
66 lines
1.4 KiB
Text
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;
|
|
#
|
|
# MDEV-25808 PREPARE/EXECUTE makes signed integer out of unsigned
|
|
#
|
|
prepare p1 from 'select concat(?)';
|
|
execute p1 using 17864960750176564435;
|
|
concat(?)
|
|
17864960750176564435
|
|
prepare p1 from 'select SQRT(?) is not null';
|
|
execute p1 using 17864960750176564435;
|
|
SQRT(?) is not null
|
|
1
|
|
#
|
|
# End of 10.3 tests
|
|
#
|