1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge 5.0 -> 5.1 of fixes for various funcs_1 related bugs

This commit is contained in:
Matthias Leich
2009-06-19 17:44:29 +02:00
9 changed files with 72 additions and 1081 deletions

View File

@ -0,0 +1,107 @@
# suite/funcs_1/t/charset_collation.test
#
# Tests checking the content of the information_schema tables
# character_sets
# collations
# collation_character_set_applicability
#
# Created:
# 2009-04-28 mleich Replace the charset_collation_* test which failed too often
# because of changes
# - in general available character sets and collations
# - in build types
# (Bug#40545, Bug#40209, Bug#40618, Bug#38346)
#
# Create a low privileged user.
--error 0, ER_CANNOT_USER
DROP USER dbdict_test@localhost;
CREATE USER dbdict_test@localhost;
--echo # Establish connection con (user=dbdict_test)
connect (con,localhost,dbdict_test,,);
################################################################################
#
# The original requirements for the following tests were:
#
# 3.2.2.2: Ensure that the table (information_schema.character_sets) shows the
# relevant information on every character set for which the current
# user or PUBLIC have the USAGE privilege.
#
# 3.2.2.3: Ensure that the table (information_schema.character_sets) does not
# show any information on any character set for which the current user
# or PUBLIC have no USAGE privilege.
#
#
# 3.2.3.2: Ensure that the table (information_schema.collations) shows the
# relevant information on every collation for which the current user
# or PUBLIC have the USAGE privilege.
#
# 3.2.3.3: Ensure that the table (information_schema.collations) does not show
# any information on any collations for which the current user and
# PUBLIC have no USAGE privilege.
#
#
# 3.2.4.2: Ensure that the table
# information_schema.collation_character_set_applicability
# shows the relevant information on every collation/character set
# combination for which the current user or PUBLIC have the USAGE
# privilege.
#
# 3.2.4.3: Ensure that the table
# information_schema.collation_character_set_applicability
# does not show any information on any collation/character set
# combinations for which the current user and PUBLIC have no
# USAGE privilege.
#
# Notes (2009-04-28 mleich):
# - The requirements are outdated because grant/revoke privilege for using a
# characterset/collation were never implemented.
# Therefore the tests focus on the completeness and correctness of the
# content (rows and columns) of these tables.
# - The amount of collations/character sets grows with new MySQL releases.
# Even within the same release the amount of records within these tables
# can differ between different build types (community, enterprise, source,...)
# Therefore we limit the queries to character sets and collations which
# - exist in all build types
# - have in all build types the same "state".
# The character set
# - utf8 is used for Metadata
# - ascii is a quite usual
# The collations <character set>_general_ci and <character set>_bin seem
# to be available all time.
#
################################################################################
let $char_set_condition= character_set_name IN ('utf8','latin1','binary');
let $collation_condition=
(collation_name LIKE CONCAT(character_set_name,'_general_ci')
OR
collation_name LIKE CONCAT(character_set_name,'_bin'));
--echo
eval SELECT *
FROM information_schema.character_sets
WHERE $char_set_condition
ORDER BY character_set_name;
--echo
eval SELECT *
FROM information_schema.collations
WHERE $char_set_condition
AND $collation_condition
ORDER BY collation_name;
--echo
eval SELECT *
FROM information_schema.collation_character_set_applicability
WHERE $char_set_condition
AND $collation_condition
ORDER BY collation_name, character_set_name;
# Cleanup
--echo # Switch to connection default + disconnect con
connection default;
disconnect con;
DROP USER dbdict_test@localhost;

View File

@ -1,32 +0,0 @@
# Tests checking the content of the information_schema tables
# character_sets
# collations
# collation_character_set_applicability
#
# Content variant 1 which should fit to
# Enterprise or Classic builds (binaries provided by MySQL)
# Pushbuilds
# Source builds without "max"
#
# Please read suite/funcs_1/datadict/charset_collation.inc for
# additional information.
#
# Created:
# 2007-12-18 mleich - remove the unstable character_set/collation subtests
# from include/datadict-master.inc
# - create this new test
#
if (`SELECT EXISTS (SELECT 1 FROM information_schema.collations
WHERE collation_name = 'utf8_general_cs')
OR ( @@version_comment NOT LIKE '%Source%'
AND @@version_comment NOT LIKE '%Enterprise%'
AND @@version_comment NOT LIKE '%Classic%'
AND @@version_comment NOT LIKE '%Pushbuild%')
OR (SELECT count(*) = 0 FROM information_schema.collations
WHERE collation_name = 'ucs2_bin')`)
{
skip Test needs Enterprise, Classic , regular Pushbuild or Source-without-max build;
}
--source suite/funcs_1/datadict/charset_collation.inc

View File

@ -1,24 +0,0 @@
# Tests checking the content of the information_schema tables
# character_sets
# collations
# collation_character_set_applicability
#
# Content variant 2 (compile from source with "max")
#
# Please read suite/funcs_1/datadict/charset_collation.inc for
# additional information.
#
# Created:
# 2007-12-18 mleich - remove the unstable character_set/collation subtests
# from include/datadict-master.inc
# - create this new test
#
if (`SELECT @@version_comment NOT LIKE '%Source%'
OR NOT EXISTS (SELECT 1 FROM information_schema.collations
WHERE collation_name = 'utf8_general_cs')`)
{
skip Test needs Source build with "max";
}
--source suite/funcs_1/datadict/charset_collation.inc

View File

@ -1,25 +0,0 @@
# Tests checking the content of the information_schema tables
# character_sets
# collations
# collation_character_set_applicability
#
# Content variant 3 which should fit to
# Community and Cluster builds (binaries provided by MySQL)
#
# Please read suite/funcs_1/datadict/charset_collation.inc for
# additional information.
#
# Created:
# 2007-12-18 mleich - remove the unstable character_set/collation subtests
# from include/datadict-master.inc
# - create this new test
#
if (`SELECT @@version_comment NOT LIKE '%Community%'
AND @@version_comment NOT LIKE '%Cluster%'
AND @@version_comment NOT LIKE '%Advanced%'`)
{
skip Test needs Community, Cluster or Advanced build;
}
--source suite/funcs_1/datadict/charset_collation.inc

View File

@ -11,6 +11,3 @@
##############################################################################
ndb_trig_1011ext: Bug#32656 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL
charset_collation_1: Bug#38346, Bug#40209, Bug#40545, Bug#40618
charset_collation_2: Bug#38346, Bug#40209, Bug#40545, Bug#40618
charset_collation_3: Bug#38346, Bug#40209, Bug#40545, Bug#40618