1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-11 13:21:44 +03:00
mariadb/mysql-test/t/mysql_locale_posix.test
Alexander Barkov e17d05cdc7 A postfix for WL#1349.
Fixed problems:
- "mtr --mem mysql_locale_posix" could fail because of wrong temporary
  directory name: var/tmp/ -> $MYSQLTEST_VARDIR/tmp/
- "mtr federated_debug" could fail because of not compiled-in
   locale character set.  Always run mysqladmin with latin1.
2009-10-23 13:02:17 +05:00

201 lines
6.8 KiB
Plaintext

--source include/not_windows.inc
--source include/have_case_sensitive_file_system.inc
#
# Note, please keep this file UTF-8 compatible.
# After editing, make sure that
# "file mysql_locale_posix.test"
# says
# "UTF-8 Unicode text"
# or
# "UTF-8 Unicode English text"
#
#
# Check if we're running on a POSIX-locale machine
#
--disable_query_log
--exec locale -a > $MYSQLTEST_VARDIR/tmp/locale_a.output 2>/dev/null || true
SET @file=REPLACE(LOAD_FILE('../../tmp/locale_a.output'), '-', '');
# make it case insensitive
SET @file=CAST(@file AS CHAR CHARACTER SET latin1) COLLATE latin1_swedish_ci;
--remove_file $MYSQLTEST_VARDIR/tmp/locale_a.output
if (`SELECT (IFNULL(@file,'') NOT LIKE '%\nde_DE.iso88591\n%')`)
{
Skip Need POSIX locale de_DE.iso88591;
}
if (`SELECT (IFNULL(@file,'') NOT LIKE '%\nru_RU.koi8r\n%')`)
{
Skip Need POSIX locale ru_RU.koi8r;
}
if (`SELECT (IFNULL(@file,'') NOT LIKE '%\ncs_CZ.iso88592\n%')`)
{
Skip Need POSIX locale cs_CZ.iso88592;
}
if (`SELECT (IFNULL(@file,'') NOT LIKE '%\nen_US.utf8\n%')`)
{
Skip Need POSIX locale en_US.utf8;
}
--enable_query_log
SET NAMES utf8;
--disable_warnings
DROP DATABASE IF EXISTS `ó`;
DROP DATABASE IF EXISTS `Ăł`;
DROP DATABASE IF EXISTS `цЁ`;
DROP DATABASE IF EXISTS `ó`;
--enable_warnings
#
# Test some of the OS-to-MySQL character set mappings
#
# {"ANSI_X3.4-1968", "ascii", my_cs_exact},
# {"ansi1251", "cp1251", my_cs_exact},
# {"armscii8", "armscii8", my_cs_exact},
# {"ASCII", "ascii", my_cs_exact},
# {"Big5", "big5", my_cs_exact},
# {"cp1251", "cp1251", my_cs_exact},
# {"cp1255", "cp1255", my_cs_exact},
# {"CP866", "cp866", my_cs_exact},
# {"eucCN", "gb2312", my_cs_exact},
# {"eucJP", "ujis", my_cs_exact},
# {"eucKR", "euckr", my_cs_exact},
#
# {"gb18030", "gb18030", my_cs_exact},
#
# {"gb2312", "gb2312", my_cs_exact},
# {"gbk", "gbk", my_cs_exact},
# {"georgianps", "geostd8", my_cs_exact},
# {"IBM-1252", "cp1252", my_cs_exact},
#
# {"iso88591", "latin1", my_cs_approx},
# {"ISO_8859-1", "latin1", my_cs_approx},
# {"ISO8859-1", "latin1", my_cs_approx},
# {"ISO-8859-1", "latin1", my_cs_approx},
#
# _utf8 0xC3B3 = LATIN SMALL LETTER O WITH ACUTE
# _latin1 0xC3 = LATIN CAPITAL LETTER A WITH TILDE
# _latin1 0xB3 = SUPERSCRIPT THREE
#
--echo
--echo ISO8859-1
--exec LC_ALL=fi_FI.ISO8859-1 $MYSQL --default-character-set=auto test -e "SELECT @@character_set_client"
--exec LC_ALL=fi_FI.ISO8859-1 $MYSQLADMIN -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
--exec LC_ALL=fi_FI.ISO8859-1 $MYSQL_SHOW --default-character-set=auto ó
--exec LC_ALL=fi_FI.ISO8859-1 $MYSQL_CHECK --default-character-set=auto "ó"
# {"iso885913", "latin7", my_cs_exact},
# {"ISO_8859-13", "latin7", my_cs_exact},
# {"ISO8859-13", "latin7", my_cs_exact},
# {"ISO-8859-13", "latin7", my_cs_exact},
#
# {"iso885915", "latin9", my_cs_exact},
# {"ISO_8859-15", "latin9", my_cs_exact},
# {"ISO8859-15", "latin9", my_cs_exact},
# {"ISO-8859-15", "latin9", my_cs_exact},
#
# {"iso88592", "latin2", my_cs_exact},
# {"ISO_8859-2", "latin2", my_cs_exact},
# {"ISO8859-2", "latin2", my_cs_exact},
# {"ISO-8859-2", "latin2", my_cs_exact},
#
#
# _utf8 0xC3B3 = LATIN SMALL LETTER O WITH ACUTE
# _latin2 0xC3 = LATIN CAPITAL LETTER A WITH BREVE
# _latin2 0xB3 = LATIN SMALL LETTER L WITH STROKE
#
--echo
--echo ISO8859-2
--exec LC_ALL=cs_CZ.ISO8859-2 $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
--exec LC_ALL=cs_CZ.ISO8859-2 $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
--exec LC_ALL=cs_CZ.ISO8859-2 $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
--exec LC_ALL=cs_CZ.ISO8859-1 $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR--default-character-set=auto "ó"
# {"iso88597", "greek", my_cs_exact},
# {"ISO_8859-7", "greek", my_cs_exact},
# {"ISO8859-7", "greek", my_cs_exact},
# {"ISO-8859-7", "greek", my_cs_exact},
#
# {"iso88598", "hebrew", my_cs_exact},
# {"ISO_8859-8", "hebrew", my_cs_exact},
# {"ISO8859-8", "hebrew", my_cs_exact},
# {"ISO-8859-8", "hebrew", my_cs_exact},
#
# {"iso88599", "latin5", my_cs_exact},
# {"ISO_8859-9", "latin5", my_cs_exact},
# {"ISO8859-9", "latin5", my_cs_exact},
# {"ISO-8859-9", "latin5", my_cs_exact},
#
# {"koi8r", "koi8r", my_cs_exact},
# {"KOI8-R", "koi8r", my_cs_exact},
# {"koi8u", "koi8u", my_cs_exact},
# {"KOI8-U", "koi8u", my_cs_exact},
#
#
# _utf8 0xC3B3 = LATIN SMALL LETTER O WITH ACUTE
# _koi8r 0xC3 = CYRILLIC SMALL LETTER TSE
# _koi8r 0xB3 = CYRILLIC CAPITAL LETTER IO
#
--echo
--echo KOI8-R
--exec LC_ALL=ru_RU.KOI8-R $MYSQL --character-sets-dir=$CHARSETSDIR --default-character-set=auto test -e "SELECT @@character_set_client"
--exec LC_ALL=ru_RU.KOI8-R $MYSQLADMIN --character-sets-dir=$CHARSETSDIR -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
--exec LC_ALL=ru_RU.KOI8-R $MYSQL_SHOW --character-sets-dir=$CHARSETSDIR --default-character-set=auto ó
--exec LC_ALL=ru_RU.ISO8859-1 $MYSQL_CHECK --character-sets-dir=$CHARSETSDIR --default-character-set=auto "ó"
# {"Shift_JIS", "sjis", my_cs_exact},
# {"SJIS", "sjis", my_cs_exact},
#
# {"tis620", "tis620", my_cs_exact},
#
# {"ujis", "ujis", my_cs_exact},
#
# {"US-ASCII", "ascii", my_cs_exact},
#
# {"utf8", "utf8", my_cs_exact},
# {"utf-8", "utf8", my_cs_exact},
--echo
--echo UTF-8
--exec LC_ALL=en_US.UTF-8 $MYSQL --default-character-set=auto test -e "SELECT @@character_set_client"
--exec LC_ALL=en_US.UTF-8 $MYSQLADMIN -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-character-set=auto create ó
--exec LC_ALL=en_US.UTF-8 $MYSQL_SHOW --default-character-set=auto ó
--exec LC_ALL=en_US.UTF-8 $MYSQL_SHOW --default-character-set=auto "ó"
--exec LC_ALL=en_US.UTF-8 $MYSQL_SHOW --default-character-set=auto "Ăł"
--exec LC_ALL=en_US.UTF-8 $MYSQL_SHOW --default-character-set=auto "цЁ"
--exec LC_ALL=en_US.UTF-8 $MYSQL_CHECK --default-character-set=auto ó
--exec LC_ALL=en_US.UTF-8 $MYSQL_CHECK --default-character-set=auto "ó"
--exec LC_ALL=en_US.UTF-8 $MYSQL_CHECK --default-character-set=auto "Ăł"
--exec LC_ALL=en_US.UTF-8 $MYSQL_CHECK --default-character-set=auto "цЁ"
SHOW DATABASES LIKE 'ó';
SHOW DATABASES LIKE 'Ăł';
SHOW DATABASES LIKE 'цЁ';
SHOW DATABASES LIKE 'ó';
DROP DATABASE `ó`;
DROP DATABASE `Ăł`;
DROP DATABASE `цЁ`;
DROP DATABASE `ó`;