1
# suite/funcs_1/t/is_character_sets.test
3
# Check the layout of information_schema.character_sets and run some
4
# functionality related 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 = CHARACTER_SETS;
14
# The table INFORMATION_SCHEMA.CHARACTER_SETS 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.2.1: INFORMATION_SCHEMA.CHARACTER_SETS layout
28
--echo #########################################################################
29
# Ensure that the INFORMATION_SCHEMA.CHARACTER_SETS table has the following
30
# columns, in the following order:
32
# CHARACTER_SET_NAME (shows a character set name),
33
# DEFAULT_COLLATE_NAME (shows the name of the default collation for that
35
# DESCRIPTION (shows a descriptive name for that character set),
36
# MAXLEN (shows the number of bytes used to store each character supported by
37
# that character set).
39
eval DESCRIBE information_schema.$is_table;
40
eval SHOW CREATE TABLE information_schema.$is_table;
41
eval SHOW COLUMNS FROM information_schema.$is_table;
43
# Note: Retrieval of information within information_schema.columns about
44
# information_schema.character_sets is in is_columns_is.test.
45
# Retrieval of information_schema.character_sets content is in
46
# charset_collation.inc (sourced by charset_collation_*.test).
49
echo # Testcases 3.2.2.2 and 3.2.2.3 are checked in suite/funcs_1/t/charset_collation*.test;
51
--echo ########################################################################
52
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
53
--echo # DDL on INFORMATION_SCHEMA tables are not supported
54
--echo ########################################################################
55
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any
56
# INFORMATION_SCHEMA table.
57
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
58
# INFORMATION_SCHEMA table.
59
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any
60
# INFORMATION_SCHEMA table.
61
# 3.2.1.8: Ensure that no user may create an index on an
62
# INFORMATION_SCHEMA table.
63
# 3.2.1.9: Ensure that no user may alter the definition of an
64
# INFORMATION_SCHEMA table.
65
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
66
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
68
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
69
# in an INFORMATION_SCHEMA table.
72
DROP DATABASE IF EXISTS db_datadict;
74
CREATE DATABASE db_datadict;
76
--error ER_DBACCESS_DENIED_ERROR
77
INSERT INTO information_schema.character_sets
78
SELECT * FROM information_schema.character_sets;
80
--error ER_DBACCESS_DENIED_ERROR
81
UPDATE information_schema.character_sets SET description = 'just updated';
83
--error ER_DBACCESS_DENIED_ERROR
84
DELETE FROM information_schema.character_sets WHERE table_name = 't1';
85
--error ER_DBACCESS_DENIED_ERROR
86
TRUNCATE information_schema.character_sets;
88
--error ER_DBACCESS_DENIED_ERROR
89
CREATE INDEX my_idx ON information_schema.character_sets(character_set_name);
91
--error ER_DBACCESS_DENIED_ERROR
92
ALTER TABLE information_schema.character_sets DROP PRIMARY KEY;
93
--error ER_DBACCESS_DENIED_ERROR
94
ALTER TABLE information_schema.character_sets ADD f1 INT;
96
--error ER_DBACCESS_DENIED_ERROR
97
DROP TABLE information_schema.character_sets;
99
--error ER_DBACCESS_DENIED_ERROR
100
ALTER TABLE information_schema.character_sets RENAME db_datadict.character_sets;
101
--error ER_DBACCESS_DENIED_ERROR
102
ALTER TABLE information_schema.character_sets
103
RENAME information_schema.xcharacter_sets;
106
DROP DATABASE db_datadict;