1
# suite/funcs_1/t/charset_collation.test
3
# Tests checking the content of the information_schema tables
6
# collation_character_set_applicability
9
# 2009-04-28 mleich Replace the charset_collation_* test which failed too often
11
# - in general available character sets and collations
13
# (Bug#40545, Bug#40209, Bug#40618, Bug#38346)
16
# Create a low privileged user.
17
--error 0, ER_CANNOT_USER
18
DROP USER dbdict_test@localhost;
19
CREATE USER dbdict_test@localhost;
21
--echo # Establish connection con (user=dbdict_test)
22
connect (con,localhost,dbdict_test,,);
23
################################################################################
25
# The original requirements for the following tests were:
27
# 3.2.2.2: Ensure that the table (information_schema.character_sets) shows the
28
# relevant information on every character set for which the current
29
# user or PUBLIC have the USAGE privilege.
31
# 3.2.2.3: Ensure that the table (information_schema.character_sets) does not
32
# show any information on any character set for which the current user
33
# or PUBLIC have no USAGE privilege.
36
# 3.2.3.2: Ensure that the table (information_schema.collations) shows the
37
# relevant information on every collation for which the current user
38
# or PUBLIC have the USAGE privilege.
40
# 3.2.3.3: Ensure that the table (information_schema.collations) does not show
41
# any information on any collations for which the current user and
42
# PUBLIC have no USAGE privilege.
45
# 3.2.4.2: Ensure that the table
46
# information_schema.collation_character_set_applicability
47
# shows the relevant information on every collation/character set
48
# combination for which the current user or PUBLIC have the USAGE
51
# 3.2.4.3: Ensure that the table
52
# information_schema.collation_character_set_applicability
53
# does not show any information on any collation/character set
54
# combinations for which the current user and PUBLIC have no
57
# Notes (2009-04-28 mleich):
58
# - The requirements are outdated because grant/revoke privilege for using a
59
# characterset/collation were never implemented.
60
# Therefore the tests focus on the completeness and correctness of the
61
# content (rows and columns) of these tables.
62
# - The amount of collations/character sets grows with new MySQL releases.
63
# Even within the same release the amount of records within these tables
64
# can differ between different build types (community, enterprise, source,...)
65
# Therefore we limit the queries to character sets and collations which
66
# - exist in all build types
67
# - have in all build types the same "state".
69
# - utf8 is used for Metadata
70
# - ascii is a quite usual
71
# The collations <character set>_general_ci and <character set>_bin seem
72
# to be available all time.
74
################################################################################
76
let $char_set_condition= character_set_name IN ('utf8','latin1','binary');
77
let $collation_condition=
78
(collation_name LIKE CONCAT(character_set_name,'_general_ci')
80
collation_name LIKE CONCAT(character_set_name,'_bin'));
83
FROM information_schema.character_sets
84
WHERE $char_set_condition
85
ORDER BY character_set_name;
89
FROM information_schema.collations
90
WHERE $char_set_condition
91
AND $collation_condition
92
ORDER BY collation_name;
96
FROM information_schema.collation_character_set_applicability
97
WHERE $char_set_condition
98
AND $collation_condition
99
ORDER BY collation_name, character_set_name;
103
--echo # Switch to connection default + disconnect con
106
DROP USER dbdict_test@localhost;