| 1 |
# suite/funcs_1/datadict/is_table_query.inc |
| 2 |
# |
| 3 |
# Check that every INFORMATION_SCHEMA table can be queried with a SELECT |
| 4 |
# statement, just as if it were an ordinary user-defined table. |
| 5 |
# (Requirement 3.2.1.1) |
| 6 |
# |
| 7 |
# The variable $is_table must be set before sourcing this script. |
| 8 |
# |
| 9 |
# Author: |
| 10 |
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of |
| 11 |
# testsuite funcs_1 |
| 12 |
# Create this script based on older scripts and new code. |
| 13 |
# |
| 14 |
--disable_warnings |
| 15 |
DROP VIEW IF EXISTS test.v1; |
| 16 |
DROP PROCEDURE IF EXISTS test.p1; |
| 17 |
DROP FUNCTION IF EXISTS test.f1; |
| 18 |
--enable_warnings |
| 19 |
eval CREATE VIEW test.v1 AS SELECT * FROM information_schema.$is_table; |
| 20 |
eval CREATE PROCEDURE test.p1() SELECT * FROM information_schema.$is_table; |
| 21 |
delimiter //; |
| 22 |
eval CREATE FUNCTION test.f1() returns BIGINT |
| 23 |
BEGIN |
| 24 |
DECLARE counter BIGINT DEFAULT NULL; |
| 25 |
SELECT COUNT(*) INTO counter FROM information_schema.$is_table; |
| 26 |
RETURN counter; |
| 27 |
END// |
| 28 |
delimiter ;// |
| 29 |
|
| 30 |
|
| 31 |
# We are not interested to check the content here. |
| 32 |
--echo # Attention: The printing of the next result sets is disabled. |
| 33 |
--disable_result_log |
| 34 |
eval SELECT * FROM information_schema.$is_table; |
| 35 |
SELECT * FROM test.v1; |
| 36 |
CALL test.p1; |
| 37 |
SELECT test.f1(); |
| 38 |
--enable_result_log |
| 39 |
|
| 40 |
DROP VIEW test.v1; |
| 41 |
DROP PROCEDURE test.p1; |
| 42 |
DROP FUNCTION test.f1; |