Debian Codegraph @

mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test

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