~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# suite/funcs_1/t/is_collation_character_set_applicability.test
 
2
#
 
3
# Check the layout of information_schema.collation_character_set_applicability
 
4
# and some functionality realted tests.
 
5
#
 
6
# Author:
 
7
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
 
8
#                           testsuite funcs_1
 
9
#                   Create this script based on older scripts and new code.
 
10
#
 
11
 
 
12
let $is_table = COLLATION_CHARACTER_SET_APPLICABILITY;
 
13
 
 
14
# The table INFORMATION_SCHEMA.CHARACTER_SET_APPLICABILITY must exist
 
15
eval SHOW TABLES FROM information_schema LIKE '$is_table';
 
16
 
 
17
--echo #######################################################################
 
18
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
 
19
--echo #######################################################################
 
20
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
 
21
# statement, just as if it were an ordinary user-defined table.
 
22
#
 
23
--source suite/funcs_1/datadict/is_table_query.inc
 
24
 
 
25
 
 
26
--echo #########################################################################
 
27
--echo # Testcase 3.2.4.1: INFORMATION_SCHEMA.CHARACTER_SET_APPLICABILITY layout
 
28
--echo #########################################################################
 
29
# Ensure that the INFORMATION_SCHEMA.CHARACTER_SET_APPLICABILITY table has the
 
30
# following columns, in the following order:
 
31
#
 
32
# COLLATION_NAME (shows the name of a collation),
 
33
# CHARACTER_SET_NAME (shows the name of a character set to which that
 
34
#           collation applies).
 
35
#
 
36
eval DESCRIBE          information_schema.$is_table;
 
37
eval SHOW CREATE TABLE information_schema.$is_table;
 
38
eval SHOW COLUMNS FROM information_schema.$is_table;
 
39
 
 
40
# Note: Retrieval of information within information_schema.columns about
 
41
#       information_schema.collation_character_set_applicability is in
 
42
#       is_columns_is.test.
 
43
#       Retrieval of information_schema.collation_character_set_applicability
 
44
#       content is in charset_collation.inc (sourced by charset_collation_*.test).
 
45
 
 
46
echo # Testcases 3.2.4.2 and 3.2.4.3 are checked in suite/funcs_1/t/charset_collation*.test;
 
47
 
 
48
--echo ########################################################################
 
49
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
 
50
--echo #           DDL on INFORMATION_SCHEMA tables are not supported
 
51
--echo ########################################################################
 
52
# 3.2.1.3:  Ensure that no user may execute an INSERT statement on any
 
53
#           INFORMATION_SCHEMA table.
 
54
# 3.2.1.4:  Ensure that no user may execute an UPDATE statement on any
 
55
#           INFORMATION_SCHEMA table.
 
56
# 3.2.1.5:  Ensure that no user may execute a DELETE statement on any
 
57
#           INFORMATION_SCHEMA table.
 
58
# 3.2.1.8:  Ensure that no user may create an index on an
 
59
#           INFORMATION_SCHEMA table.
 
60
# 3.2.1.9:  Ensure that no user may alter the definition of an
 
61
#           INFORMATION_SCHEMA table.
 
62
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
 
63
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
 
64
#           other database.
 
65
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
 
66
#           in an INFORMATION_SCHEMA table.
 
67
#
 
68
--disable_warnings
 
69
DROP DATABASE IF EXISTS db_datadict;
 
70
--enable_warnings
 
71
CREATE DATABASE db_datadict;
 
72
 
 
73
--error ER_DBACCESS_DENIED_ERROR
 
74
INSERT INTO information_schema.collation_character_set_applicability
 
75
SELECT * FROM information_schema.collation_character_set_applicability;
 
76
 
 
77
--error ER_DBACCESS_DENIED_ERROR
 
78
UPDATE information_schema.collation_character_set_applicability
 
79
SET collation_name = 'big6_chinese_ci' WHERE character_set_name = 'big6';
 
80
--error ER_DBACCESS_DENIED_ERROR
 
81
UPDATE information_schema.collation_character_set_applicability
 
82
SET character_set_name = 't_4711';
 
83
 
 
84
--error ER_DBACCESS_DENIED_ERROR
 
85
DELETE FROM information_schema.collation_character_set_applicability;
 
86
--error ER_DBACCESS_DENIED_ERROR
 
87
TRUNCATE information_schema.collation_character_set_applicability;
 
88
 
 
89
--error ER_DBACCESS_DENIED_ERROR
 
90
CREATE INDEX my_idx
 
91
ON information_schema.collation_character_set_applicability(collation_name);
 
92
 
 
93
--error ER_DBACCESS_DENIED_ERROR
 
94
ALTER TABLE information_schema.collation_character_set_applicability ADD f1 INT;
 
95
 
 
96
--error ER_DBACCESS_DENIED_ERROR
 
97
DROP TABLE information_schema.collation_character_set_applicability;
 
98
 
 
99
--error ER_DBACCESS_DENIED_ERROR
 
100
ALTER TABLE information_schema.collation_character_set_applicability
 
101
RENAME db_datadict.collation_character_set_applicability;
 
102
--error ER_DBACCESS_DENIED_ERROR
 
103
ALTER TABLE information_schema.collation_character_set_applicability
 
104
RENAME information_schema.xcollation_character_set_applicability;
 
105
 
 
106
# Cleanup
 
107
DROP DATABASE db_datadict;
 
108