~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/funcs_1/datadict/is_table_query.inc

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;