1
# suite/funcs_1/t/is_collation_character_set_applicability.test
3
# Check the layout of information_schema.collation_character_set_applicability
4
# and some functionality realted tests.
7
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
9
# Create this script based on older scripts and new code.
12
let $is_table = COLLATION_CHARACTER_SET_APPLICABILITY;
14
# The table INFORMATION_SCHEMA.CHARACTER_SET_APPLICABILITY must exist
15
eval SHOW TABLES FROM information_schema LIKE '$is_table';
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.
23
--source suite/funcs_1/datadict/is_table_query.inc
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:
32
# COLLATION_NAME (shows the name of a collation),
33
# CHARACTER_SET_NAME (shows the name of a character set to which that
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;
40
# Note: Retrieval of information within information_schema.columns about
41
# information_schema.collation_character_set_applicability is in
43
# Retrieval of information_schema.collation_character_set_applicability
44
# content is in charset_collation.inc (sourced by charset_collation_*.test).
46
echo # Testcases 3.2.4.2 and 3.2.4.3 are checked in suite/funcs_1/t/charset_collation*.test;
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
65
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
66
# in an INFORMATION_SCHEMA table.
69
DROP DATABASE IF EXISTS db_datadict;
71
CREATE DATABASE db_datadict;
73
--error ER_DBACCESS_DENIED_ERROR
74
INSERT INTO information_schema.collation_character_set_applicability
75
SELECT * FROM information_schema.collation_character_set_applicability;
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';
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;
89
--error ER_DBACCESS_DENIED_ERROR
91
ON information_schema.collation_character_set_applicability(collation_name);
93
--error ER_DBACCESS_DENIED_ERROR
94
ALTER TABLE information_schema.collation_character_set_applicability ADD f1 INT;
96
--error ER_DBACCESS_DENIED_ERROR
97
DROP TABLE information_schema.collation_character_set_applicability;
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;
107
DROP DATABASE db_datadict;