| 1 |
DROP TABLE IF EXISTS t1, t2; |
| 2 |
DROP VIEW IF EXISTS v_t1; |
| 3 |
CREATE TABLE t1 (id INT PRIMARY KEY); |
| 4 |
CREATE view v_t1 AS SELECT * FROM t1; |
| 5 |
CALL sys.table_exists('test', 't1', @exists); |
| 6 |
SELECT @exists; |
| 7 |
@exists |
| 8 |
BASE TABLE |
| 9 |
CALL sys.table_exists('test', 'v_t1', @exists); |
| 10 |
SELECT @exists; |
| 11 |
@exists |
| 12 |
VIEW |
| 13 |
CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY); |
| 14 |
CALL sys.table_exists('test', 't1', @exists); |
| 15 |
SELECT @exists; |
| 16 |
@exists |
| 17 |
TEMPORARY |
| 18 |
CALL sys.table_exists('test', 't2', @exists); |
| 19 |
SELECT @exists; |
| 20 |
@exists |
| 21 |
|
| 22 |
SET @identifier := REPEAT('a', 65); |
| 23 |
CALL sys.table_exists(@identifier, 't1', @exists); |
| 24 |
ERROR 22001: Data too long for column 'in_db' at row 1 |
| 25 |
CALL sys.table_exists('test', @identifier, @exists); |
| 26 |
ERROR 22001: Data too long for column 'in_table' at row 1 |
| 27 |
DROP TEMPORARY TABLE t1; |
| 28 |
DROP TABLE t1; |
| 29 |
DROP VIEW v_t1; |
| 30 |
SET @identifier := NULL; |