~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/suite/funcs_1/datadict/charset_collation.inc

  • 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/datadict/charset_collation.inc
 
2
#
 
3
# Tests checking the content of the information_schema tables
 
4
#      character_sets
 
5
#      collations
 
6
#      collation_character_set_applicability
 
7
#
 
8
#
 
9
# The amount and properties of character_sets/collations depend on the
 
10
# build type
 
11
# 2007-12 MySQL 5.0
 
12
# ---------------------------------------------------------------------
 
13
#
 
14
# Variant 1 fits to
 
15
#    version_comment       MySQL Enterprise Server (Commercial)
 
16
#    version_comment       MySQL Enterprise Server (GPL)
 
17
#    version_comment       MySQL Classic Server (Commercial)
 
18
#    version_comment       MySQL Pushbuild Edition, build <number>
 
19
#   (version_comment       Source distribution
 
20
#    and
 
21
#    compile was without "max" - > no collation 'utf8_general_ci')
 
22
#
 
23
# Variant 2 fits to
 
24
#    version_comment       MySQL Enterprise Server (GPL)
 
25
#    version_comment       MySQL Classic Server (Commercial)
 
26
#    version_comment       MySQL Pushbuild Edition, build <number>
 
27
#   (version_comment       Source distribution
 
28
#    and
 
29
#    compile was without "max" - > collation 'utf8_general_ci' exists)
 
30
#
 
31
# Difference between variant 1 and 2 is the collation 'utf8_general_ci'.
 
32
#
 
33
# Variant 3 fits to
 
34
#    version_comment       MySQL Community Server (GPL)
 
35
#    version_comment       MySQL Cluster Server (Commercial)
 
36
#
 
37
# Difference between variant 3 and 2 is within the collation properties
 
38
# IS_COMPILED and SORTLEN.
 
39
#
 
40
# Created:
 
41
# 2007-12-18 mleich - remove the unstable character_set/collation subtests
 
42
#                     from include/datadict-master.inc
 
43
#                   - create this new test
 
44
#
 
45
 
 
46
# Create a low privileged user.
 
47
--error 0, ER_CANNOT_USER
 
48
DROP USER dbdict_test@localhost;
 
49
CREATE USER dbdict_test@localhost;
 
50
 
 
51
--echo # Establish connection con (user=dbdict_test)
 
52
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
 
53
connect (con,localhost,dbdict_test,,);
 
54
################################################################################
 
55
#
 
56
# The original requirements for the following tests were:
 
57
#
 
58
# 3.2.2.2: Ensure that the table (information_schema.character_sets) shows the
 
59
#          relevant information on every character set for which the current
 
60
#          user or PUBLIC have the USAGE privilege.
 
61
#
 
62
# 3.2.2.3: Ensure that the table (information_schema.character_sets) does not
 
63
#          show any information on any character set for which the current user
 
64
#          or PUBLIC have no USAGE privilege.
 
65
#
 
66
#
 
67
# 3.2.3.2: Ensure that the table (information_schema.collations) shows the
 
68
#          relevant information on every collation for which the current user
 
69
#          or PUBLIC have the USAGE privilege.
 
70
#
 
71
# 3.2.3.3: Ensure that the table (information_schema.collations) does not show
 
72
#          any information on any collations for which the current user and
 
73
#          PUBLIC have no USAGE privilege.
 
74
#
 
75
#
 
76
# 3.2.4.2: Ensure that the table
 
77
#                information_schema.collation_character_set_applicability
 
78
#          shows the relevant information on every collation/character set
 
79
#          combination for which the current user or PUBLIC have the USAGE
 
80
#          privilege.
 
81
#
 
82
# 3.2.4.3: Ensure that the table
 
83
#                information_schema.collation_character_set_applicability
 
84
#          does not show any information on any collation/character set
 
85
#          combinations for which the current user and PUBLIC have no
 
86
#          USAGE privilege.
 
87
#
 
88
# Notes (2007-12-19 mleich):
 
89
# - The requirements are outdated because grant/revoke privilege for using a
 
90
#   characterset/collation were never implemented.
 
91
#   Therefore the tests should simply check the content of these tables.
 
92
#
 
93
# - The amount of collations/character sets grows with new MySQL releases.
 
94
#
 
95
# - Even within the same release the amount of records within these tables
 
96
#   can differ between different build types (community, enterprise, source,...)
 
97
#
 
98
#
 
99
################################################################################
 
100
--echo
 
101
SELECT *
 
102
FROM information_schema.character_sets
 
103
ORDER BY character_set_name;
 
104
 
 
105
--echo
 
106
SELECT *
 
107
FROM information_schema.collations
 
108
ORDER BY collation_name;
 
109
 
 
110
echo;
 
111
--echo
 
112
SELECT *
 
113
FROM information_schema.collation_character_set_applicability
 
114
ORDER BY collation_name, character_set_name;
 
115
 
 
116
 
 
117
# Cleanup
 
118
--echo # Switch to connection default + disconnect con
 
119
connection default;
 
120
disconnect con;
 
121
DROP USER dbdict_test@localhost;
 
122