List:Commits« Previous MessageNext Message »
From:bar Date:September 12 2007 2:41pm
Subject:bk commit into 5.2 tree (bar:1.2607)
View as plain text  
Below is the list of changes that have just been committed into a local
5.2 repository of root. When root does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-09-12 17:41:27+05:00, bar@stripped +63 -0
  WL#1213 Implement 4-byte UTF8, UTF16 and UTF32

  config/ac-macros/character_sets.m4@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +73 -16
    Adding utf8mb3 definitions

  include/m_ctype.h@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +49 -5
    Adding prototypes for new variables and functions

  include/my_global.h@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing ifdef condition

  include/myisam.h@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing MI_MAX_KEY_LENGTH, to support keys on CHAR(333),
    now with 4-byte character sets.

  include/mysql_com.h@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing maxlen constant from 3 to 4

  mysql-test/include/have_utf16.inc@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +4 -0
    New BitKeeper file ``mysql-test/include/have_utf16.inc''

  mysql-test/include/have_utf16.inc@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +0 -0

  mysql-test/include/have_utf32.inc@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +4 -0
    New BitKeeper file ``mysql-test/include/have_utf32.inc''

  mysql-test/include/have_utf32.inc@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +0 -0

  mysql-test/r/ctype_ldml.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +21 -3
    Changing test results

  mysql-test/r/ctype_utf16.result@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +1042 -0
    New BitKeeper file ``mysql-test/r/ctype_utf16.result''

  mysql-test/r/ctype_utf16.result@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +0 -0

  mysql-test/r/ctype_utf16_uca.result@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +2405 -0
    New BitKeeper file ``mysql-test/r/ctype_utf16_uca.result''

  mysql-test/r/ctype_utf16_uca.result@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +0 -0

  mysql-test/r/ctype_utf32.result@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +997 -0
    New BitKeeper file ``mysql-test/r/ctype_utf32.result''

  mysql-test/r/ctype_utf32.result@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +0 -0

  mysql-test/r/ctype_utf32_uca.result@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +2405 -0
    New BitKeeper file ``mysql-test/r/ctype_utf32_uca.result''

  mysql-test/r/ctype_utf32_uca.result@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +0 -0

  mysql-test/r/ctype_utf8.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +53 -45
    Changing test results

  mysql-test/r/explain.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +16 -0
    Changing test results

  mysql-test/r/group_by.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/r/have_utf16.require@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +2 -0
    New BitKeeper file ``mysql-test/r/have_utf16.require''

  mysql-test/r/have_utf16.require@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +0 -0

  mysql-test/r/have_utf32.require@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +2 -0
    New BitKeeper file ``mysql-test/r/have_utf32.require''

  mysql-test/r/have_utf32.require@stripped, 2007-09-12 17:41:17+05:00, bar@stripped +0 -0

  mysql-test/r/information_schema.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +2 -2
    Changing test results

  mysql-test/r/innodb_mysql.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/r/join.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +2 -2
    Changing test results

  mysql-test/r/key.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +4 -4
    Changing test results

  mysql-test/r/mix2_myisam.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/r/myisam.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +20 -20
    Changing test results

  mysql-test/r/ps_1general.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +2 -2
    Changing test results

  mysql-test/r/ps_2myisam.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/r/ps_3innodb.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/r/ps_4heap.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/r/ps_5merge.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +2 -2
    Changing test results

  mysql-test/r/show_check.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +180 -180
    Changing test results

  mysql-test/r/type_blob.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +3 -3
    Changing test results

  mysql-test/std_data/Index.xml@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +23 -3
    Adding tests for new character sets

  mysql-test/suite/ndb/r/ndb_index_unique.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/suite/ndb/r/ps_7ndb.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/suite/ndb/t/ndb_index_unique.test@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +1 -1
    Changing test results

  mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +2 -2
    Changing test results

  mysql-test/t/ctype_ldml.test@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +15 -0
    Adding tests for new character sets

  mysql-test/t/ctype_utf16.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +719 -0
    New BitKeeper file ``mysql-test/t/ctype_utf16.test''

  mysql-test/t/ctype_utf16.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +0 -0

  mysql-test/t/ctype_utf16_uca.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +287 -0
    New BitKeeper file ``mysql-test/t/ctype_utf16_uca.test''

  mysql-test/t/ctype_utf16_uca.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +0 -0

  mysql-test/t/ctype_utf32.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +743 -0
    New BitKeeper file ``mysql-test/t/ctype_utf32.test''

  mysql-test/t/ctype_utf32.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +0 -0

  mysql-test/t/ctype_utf32_uca.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +288 -0
    New BitKeeper file ``mysql-test/t/ctype_utf32_uca.test''

  mysql-test/t/ctype_utf32_uca.test@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +0 -0

  mysql-test/t/ctype_utf8.test@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +12 -0
    Adding tests

  mysql-test/t/explain.test@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +7 -1
    Adding tests

  mysql-test/t/myisam.test@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +2 -2
    Modifying test, to keep error.

  mysys/charset-def.c@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +204 -49
    Adding new character sets

  mysys/charset.c@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +25 -4
    Adding LDML support for new character sets

  sql/item_strfunc.h@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +2 -2
    Fixing max_length formula

  sql/key.cc@stripped, 2007-09-12 17:41:14+05:00, bar@stripped +19 -0
    Adding alignment for multy-byte character boundaries

  sql/mysql_priv.h@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +16 -0
    Adding check_identifier_name() helper functions,
    for shorter code.

  sql/sp_head.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +1 -6
    Replacing check_string_char_length() to
    check_identifier_name().

  sql/sql_class.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +3 -1
    Fixing formula. The previous one was incorrect.
    (discussed with Sergey Petrunia)

  sql/sql_parse.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +42 -5
    Addint implementation of check_identifier_name().
    Replacing check_string_char_length() to
    check_identifier_name().

  sql/sql_plugin.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +1 -2
    Replacing check_string_char_length() to
    check_identifier_name().

  sql/sql_show.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +1 -1
    Changing max length, to keep the column in VARCHAR limit 64K.
    (discussed with Gluh)

  sql/sql_table.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +9 -10
    Replacing check_string_char_length() to
    check_identifier_name().

  sql/sql_udf.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +2 -7
    Replacing check_string_char_length() to
    check_identifier_name().

  sql/sql_yacc.yy@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +5 -6
    Replacing check_string_char_length() to
    check_identifier_name().

  sql/table.cc@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +9 -56
    Reusing check_identifier_name().
    Disallow supplementary characters in column names.

  sql/unireg.h@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +2 -1
    - Introducing a new constant for "key_len" width in "explain select" results.
    - Changing constant from 3 to 4

  strings/ctype-mb.c@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +12 -4
    Changes to support supplementary characters.

  strings/ctype-uca.c@stripped, 2007-09-12 17:41:15+05:00, bar@stripped +2218 -103
    - Changes to support supplementary characters
    - Adding UCA collations for new character sets

  strings/ctype-ucs2.c@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +2589 -663
    - Adding utf16 and utf32 implementations
    - Adding "general_ci" and "bin" collation for the new character sets

  strings/ctype-utf8.c@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +1097 -150
    - Renaming old utf8 variables and function names to utf8mb3
    - Adding utf8mb4 implementation
    - Adding "general_ci" and "bin" collations for utf8mb4
    Note:
    3-byte utf8 name is "utf8mb3" in SQL
    4-byte utf8 name us "utf8" in SQL

  tests/mysql_client_test.c@stripped, 2007-09-12 17:41:16+05:00, bar@stripped +1 -1
    Fixing test, according to "explain select" changes

diff -Nrup a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
--- a/config/ac-macros/character_sets.m4	2007-08-31 03:41:06 +05:00
+++ b/config/ac-macros/character_sets.m4	2007-09-12 17:41:14 +05:00
@@ -10,11 +10,11 @@ define(CHARSETS_AVAILABLE1,armscii8 asci
 define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8)
 define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u)
 define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman)
-define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8)
+define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8 utf8mb3 utf16 utf32)
 
 DEFAULT_CHARSET=latin1
 CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5"
-CHARSETS_COMPLEX="big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8"
+CHARSETS_COMPLEX="big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb3 utf16 utf32"
 
 AC_DIVERT_POP
 
@@ -47,7 +47,7 @@ AC_ARG_WITH(extra-charsets,
 
 AC_MSG_CHECKING("character sets")
 
-CHARSETS="$default_charset latin1 utf8"
+CHARSETS="$default_charset latin1 utf8 utf8mb3"
 
 if test "$extra_charsets" = no; then
   CHARSETS="$CHARSETS"
@@ -193,7 +193,22 @@ do
       AC_DEFINE(USE_MB_IDENT, 1)
       ;;
     utf8)
-      AC_DEFINE(HAVE_CHARSET_utf8, 1, [Define to enable ut8])
+      AC_DEFINE(HAVE_CHARSET_utf8mb4, 1, [Define to enable ut8])
+      AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
+      AC_DEFINE(USE_MB_IDENT, 1)
+      ;;
+    utf8mb3)
+      AC_DEFINE(HAVE_CHARSET_utf8mb3, 1, [Define to enable ut8])
+      AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
+      AC_DEFINE(USE_MB_IDENT, 1)
+      ;;
+    utf16)
+      AC_DEFINE(HAVE_CHARSET_utf16, 1, [Define to enable utf16])
+      AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
+      AC_DEFINE(USE_MB_IDENT, 1)
+      ;;
+    utf32)
+      AC_DEFINE(HAVE_CHARSET_utf32, 1, [Define to enable utf32])
       AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
       AC_DEFINE(USE_MB_IDENT, 1)
       ;;
@@ -359,23 +374,65 @@ case $default_charset in 
       ;;
     utf8)
       default_charset_default_collation="utf8_general_ci"
-      if test "$default_collation" = "utf8_general_cs"; then
-        # For those who explicitly desire "utf8_general_cs", support it,
+      define(UTFC1, utf8_general_ci utf8_bin)
+      define(UTFC2, utf8_czech_ci utf8_danish_ci)
+      define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci)
+      define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
+      define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
+      define(UTFC6, utf8_sinhala_ci utf8_slovak_ci utf8_slovenian_ci)
+      define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
+      define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
+      define(UTFC9, utf8_unicode_ci)
+      UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
+      default_charset_collations="$UTFC"
+      ;;
+    utf8mb3)
+      default_charset_default_collation="utf8mb3_general_ci"
+      if test "$default_collation" = "utf8mb3_general_cs"; then
+        # For those who explicitly desire "utf8mb3_general_cs", support it,
         # and then also set the CPP switch enabling that code.
-        UTFC="utf8_general_cs"
+        UTFC="utf8mb3_general_cs"
         AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer])
       else
-        define(UTFC1, utf8_general_ci utf8_bin)
-        define(UTFC2, utf8_czech_ci utf8_danish_ci)
-        define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci)
-        define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
-        define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
-        define(UTFC6, utf8_sinhala_ci utf8_slovak_ci utf8_slovenian_ci)
-        define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
-        define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
-        define(UTFC9, utf8_unicode_ci)
+        define(UTFC1, utf8mb3_general_ci utf8mb3_bin)
+        define(UTFC2, utf8mb3_czech_ci utf8mb3_danish_ci)
+        define(UTFC3, utf8mb3_esperanto_ci utf8mb3_estonian_ci utf8mb3_icelandic_ci)
+        define(UTFC4, utf8mb3_latvian_ci utf8mb3_lithuanian_ci)
+        define(UTFC5, utf8mb3_persian_ci utf8mb3_polish_ci utf8mb3_romanian_ci)
+        define(UTFC6, utf8mb3_sinhala_ci utf8mb3_slovak_ci utf8mb3_slovenian_ci)
+        define(UTFC7, utf8mb3_spanish2_ci utf8mb3_spanish_ci)
+        define(UTFC8, utf8mb3_swedish_ci utf8mb3_turkish_ci)
+        define(UTFC9, utf8mb3_unicode_ci)
         UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
       fi
+      default_charset_collations="$UTFC"
+      ;;
+    utf16)
+      default_charset_default_collation="utf16_general_ci"
+      define(UTFC1, utf16_general_ci utf16_bin)
+      define(UTFC2, utf16_czech_ci utf16_danish_ci)
+      define(UTFC3, utf16_esperanto_ci utf16_estonian_ci utf16_icelandic_ci)
+      define(UTFC4, utf16_latvian_ci utf16_lithuanian_ci)
+      define(UTFC5, utf16_persian_ci utf16_polish_ci utf16_romanian_ci)
+      define(UTFC6, utf16_sinhala_ci utf16_slovak_ci utf16_slovenian_ci)
+      define(UTFC7, utf16_spanish2_ci utf16_spanish_ci)
+      define(UTFC8, utf16_swedish_ci utf16_turkish_ci)
+      define(UTFC9, utf16_unicode_ci)
+      UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
+      default_charset_collations="$UTFC"
+      ;;
+    utf32)
+      default_charset_default_collation="utf32_general_ci"
+      define(UTFC1, utf32_general_ci utf32_bin)
+      define(UTFC2, utf32_czech_ci utf32_danish_ci)
+      define(UTFC3, utf32_esperanto_ci utf32_estonian_ci utf32_icelandic_ci)
+      define(UTFC4, utf32_latvian_ci utf32_lithuanian_ci)
+      define(UTFC5, utf32_persian_ci utf32_polish_ci utf32_romanian_ci)
+      define(UTFC6, utf32_sinhala_ci utf32_slovak_ci utf32_slovenian_ci)
+      define(UTFC7, utf32_spanish2_ci utf32_spanish_ci)
+      define(UTFC8, utf32_swedish_ci utf32_turkish_ci)
+      define(UTFC9, utf32_unicode_ci)
+      UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
       default_charset_collations="$UTFC"
       ;;
     *)
diff -Nrup a/include/m_ctype.h b/include/m_ctype.h
--- a/include/m_ctype.h	2007-08-26 16:31:06 +05:00
+++ b/include/m_ctype.h	2007-09-12 17:41:14 +05:00
@@ -325,10 +325,12 @@ extern CHARSET_INFO my_charset_big5_chin
 extern CHARSET_INFO my_charset_big5_bin;
 extern CHARSET_INFO my_charset_cp932_japanese_ci;
 extern CHARSET_INFO my_charset_cp932_bin;
+extern CHARSET_INFO my_charset_cp1250_czech_ci;
 extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
 extern CHARSET_INFO my_charset_eucjpms_bin;
 extern CHARSET_INFO my_charset_euckr_korean_ci;
 extern CHARSET_INFO my_charset_euckr_bin;
+extern CHARSET_INFO my_charset_filename;
 extern CHARSET_INFO my_charset_gb2312_chinese_ci;
 extern CHARSET_INFO my_charset_gb2312_bin;
 extern CHARSET_INFO my_charset_gbk_chinese_ci;
@@ -346,11 +348,39 @@ extern CHARSET_INFO my_charset_ucs2_bin;
 extern CHARSET_INFO my_charset_ucs2_unicode_ci;
 extern CHARSET_INFO my_charset_ujis_japanese_ci;
 extern CHARSET_INFO my_charset_ujis_bin;
-extern CHARSET_INFO my_charset_utf8_general_ci;
-extern CHARSET_INFO my_charset_utf8_unicode_ci;
-extern CHARSET_INFO my_charset_utf8_bin;
-extern CHARSET_INFO my_charset_cp1250_czech_ci;
-extern CHARSET_INFO my_charset_filename;
+extern CHARSET_INFO my_charset_utf16_bin;
+extern CHARSET_INFO my_charset_utf16_general_ci;
+extern CHARSET_INFO my_charset_utf16_unicode_ci;
+extern CHARSET_INFO my_charset_utf32_bin;
+extern CHARSET_INFO my_charset_utf32_general_ci;
+extern CHARSET_INFO my_charset_utf32_unicode_ci;
+extern CHARSET_INFO my_charset_utf8mb3_bin;
+extern CHARSET_INFO my_charset_utf8mb3_general_ci;
+extern CHARSET_INFO my_charset_utf8mb3_unicode_ci;
+extern CHARSET_INFO my_charset_utf8mb4_bin;
+extern CHARSET_INFO my_charset_utf8mb4_general_ci;
+extern CHARSET_INFO my_charset_utf8mb4_unicode_ci;
+
+#ifndef HAVE_CHARSET_utf8mb4
+#define HAVE_CHARSET_utf8mb4
+#endif
+
+#ifndef HAVE_CHARSET_utf8mb3
+#define HAVE_CHARSET_utf8mb3
+#endif
+
+#ifdef MY_UTF8_IS_UTF8MB3
+#define MY_UTF8MB3                "utf8"
+#define MY_UTF8MB4                "utf8mb4"
+#define my_charset_utf8_general_ci my_charset_utf8mb3_general_ci
+#define my_charset_utf8_bin        my_charset_utf8mb3_bin
+#else
+#define MY_UTF8MB3                 "utf8mb3"
+#define MY_UTF8MB4                 "utf8"
+#define my_charset_utf8_general_ci my_charset_utf8mb4_general_ci
+#define my_charset_utf8_bin        my_charset_utf8mb4_bin
+#endif
+
 
 /* declarations for simple charsets */
 extern size_t my_strnxfrm_simple(CHARSET_INFO *,
@@ -447,6 +477,20 @@ my_bool  my_like_range_ucs2(CHARSET_INFO
 			    size_t res_length,
 			    char *min_str, char *max_str,
 			    size_t *min_length, size_t *max_length);
+
+my_bool  my_like_range_utf16(CHARSET_INFO *cs,
+			     const char *ptr, size_t ptr_length,
+			     pbool escape, pbool w_one, pbool w_many,
+			     size_t res_length,
+			     char *min_str, char *max_str,
+			     size_t *min_length, size_t *max_length);
+
+my_bool  my_like_range_utf32(CHARSET_INFO *cs,
+			     const char *ptr, size_t ptr_length,
+			     pbool escape, pbool w_one, pbool w_many,
+			     size_t res_length,
+			     char *min_str, char *max_str,
+			     size_t *min_length, size_t *max_length);
 
 
 int my_wildcmp_8bit(CHARSET_INFO *,
diff -Nrup a/include/my_global.h b/include/my_global.h
--- a/include/my_global.h	2007-09-03 16:12:25 +05:00
+++ b/include/my_global.h	2007-09-12 17:41:14 +05:00
@@ -1447,7 +1447,7 @@ do { doubleget_union _tmp; \
 #define statistic_sub(V,C,L)       (V)-=(C)
 #endif
 
-#ifdef HAVE_CHARSET_utf8
+#if defined(HAVE_CHARSET_utf8mb3) || defined(HAVE_CHARSET_utf8mb4)
 #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
 #else
 #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
diff -Nrup a/include/myisam.h b/include/myisam.h
--- a/include/myisam.h	2007-08-26 16:31:06 +05:00
+++ b/include/myisam.h	2007-09-12 17:41:14 +05:00
@@ -54,7 +54,7 @@ extern "C" {
   The following defines can be increased if necessary.
   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
 */
-#define MI_MAX_KEY_LENGTH           1000            /* Max length in bytes */
+#define MI_MAX_KEY_LENGTH           1332            /* Max length in bytes */
 #define MI_MAX_KEY_SEG              16              /* Max segments for key */
 
 #define MI_MAX_KEY_BUFF  (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
diff -Nrup a/include/mysql_com.h b/include/mysql_com.h
--- a/include/mysql_com.h	2007-08-26 00:13:27 +05:00
+++ b/include/mysql_com.h	2007-09-12 17:41:14 +05:00
@@ -21,7 +21,7 @@
 #define _mysql_com_h
 
 #define HOSTNAME_LENGTH 60
-#define SYSTEM_CHARSET_MBMAXLEN 3
+#define SYSTEM_CHARSET_MBMAXLEN 4
 #define NAME_CHAR_LEN	64              /* Field/table name length */
 #define USERNAME_CHAR_LENGTH 16
 #define NAME_LEN                (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
diff -Nrup a/mysql-test/include/have_utf16.inc b/mysql-test/include/have_utf16.inc
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/include/have_utf16.inc	2007-09-12 17:41:17 +05:00
@@ -0,0 +1,4 @@
+-- require r/have_utf16.require
+disable_query_log;
+show collation like "utf16_general_ci";
+enable_query_log;
diff -Nrup a/mysql-test/include/have_utf32.inc b/mysql-test/include/have_utf32.inc
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/include/have_utf32.inc	2007-09-12 17:41:17 +05:00
@@ -0,0 +1,4 @@
+-- require r/have_utf32.require
+disable_query_log;
+show collation like "utf32_general_ci";
+enable_query_log;
diff -Nrup a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
--- a/mysql-test/r/ctype_ldml.result	2007-06-07 17:55:53 +05:00
+++ b/mysql-test/r/ctype_ldml.result	2007-09-12 17:41:14 +05:00
@@ -5,7 +5,7 @@ Variable_name	Value
 character_sets_dir	MYSQL_TEST_DIR/std_data/
 show collation like 'utf8_test_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-utf8_test_ci	utf8	240			8
+utf8_test_ci	utf8	253			8
 create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
 insert into t1 values ('a');
 select * from t1 where c1='b';
@@ -14,16 +14,34 @@ a
 drop table t1;
 show collation like 'ucs2_test_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-ucs2_test_ci	ucs2	241			8
+ucs2_test_ci	ucs2	158			8
 create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci);
 insert into t1 values ('a');
 select * from t1 where c1='b';
 c1
 a
 drop table t1;
+show collation like 'utf16_test_ci';
+Collation	Charset	Id	Default	Compiled	Sortlen
+utf16_test_ci	utf16	127			8
+create table t1 (c1 char(1) character set utf16 collate utf16_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+c1
+a
+drop table t1;
+show collation like 'utf32_test_ci';
+Collation	Charset	Id	Default	Compiled	Sortlen
+utf32_test_ci	utf32	191			8
+create table t1 (c1 char(1) character set utf32 collate utf32_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+c1
+a
+drop table t1;
 show collation like 'ucs2_vn_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-ucs2_vn_ci	ucs2	242			8
+ucs2_vn_ci	ucs2	159			8
 create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
 insert into t1 values (0x0061),(0x0041),(0x00E0),(0x00C0),(0x1EA3),(0x1EA2),
 (0x00E3),(0x00C3),(0x00E1),(0x00C1),(0x1EA1),(0x1EA0);
diff -Nrup a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/ctype_utf16.result	2007-09-12 17:41:16 +05:00
@@ -0,0 +1,1042 @@
+DROP TABLE IF EXISTS t1;
+SET NAMES latin1;
+SET character_set_connection=utf16;
+select hex('a'), hex('a ');
+hex('a')	hex('a ')
+0061	00610020
+select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
+'a' = 'a'	'a' = 'a '	'a ' = 'a'
+1	1	1
+select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
+'a\0' = 'a'	'a\0' < 'a'	'a\0' > 'a'
+0	1	0
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+'a' = 'a\0'	'a' < 'a\0'	'a' > 'a\0'
+0	0	1
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+'a\0' = 'a '	'a\0' < 'a '	'a\0' > 'a '
+0	1	0
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+'a ' = 'a\0'	'a ' < 'a\0'	'a ' > 'a\0'
+0	0	1
+select 'a  a' > 'a', 'a  \0' < 'a';
+'a  a' > 'a'	'a  \0' < 'a'
+1	1
+select binary 'a  a' > 'a', binary 'a  \0' > 'a', binary 'a\0' > 'a';
+binary 'a  a' > 'a'	binary 'a  \0' > 'a'	binary 'a\0' > 'a'
+1	1	1
+select hex(_utf16 0x44);
+hex(_utf16 0x44)
+00000044
+select hex(_utf16 0x3344);
+hex(_utf16 0x3344)
+3344
+select hex(_utf16 0x113344);
+hex(_utf16 0x113344)
+000000113344
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+0420
+2004
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+0420
+2004
+DELETE FROM t1;
+INSERT INTO t1 VALUES (X'042000200020',X'042000200020'), (X'200400200020', X'200400200020');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+042000200020
+200400200020
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+0420
+2004
+DROP TABLE t1;
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'0421'));
+hex(LPAD(_utf16 X'0420',10,_utf16 X'0421'))
+0421042104210421042104210421042104210420
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422'))
+0421042204210422042104220421042204210420
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423'))
+0421042204230421042204230421042204230420
+SELECT hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'))
+0420042104220423042404250426042704280429
+SELECT hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'))
+042104210421042104210421042104210421D800DC00
+SELECT hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'))
+D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC000421
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'0421'));
+hex(RPAD(_utf16 X'0420',10,_utf16 X'0421'))
+0420042104210421042104210421042104210421
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422'))
+0420042104220421042204210422042104220421
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423'))
+0420042104220423042104220423042104220423
+SELECT hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'))
+0420042104220423042404250426042704280429
+SELECT hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'))
+D800DC00042104210421042104210421042104210421
+SELECT hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'))
+0421D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00
+CREATE TABLE t1 SELECT 
+LPAD(_utf16 X'0420',10,_utf16 X'0421') l,
+RPAD(_utf16 X'0420',10,_utf16 X'0421') r;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `l` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT '',
+  `r` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(l), hex(r) from t1;
+hex(l)	hex(r)
+0421042104210421042104210421042104210420	0420042104210421042104210421042104210421
+DROP TABLE t1;
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+lpad(f1, 12, "-o-/")
+-o-/-o103000
+-o-/22720000
+-o-/-3401200
+-o-/-o-78000
+drop table t1;
+SET NAMES latin1;
+SET character_set_connection=utf16;
+create table t1 (a varchar(10) character set utf16, key(a));
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	a	a	43	NULL	1	Using where; Using index
+explain select * from t1 where a like concat('abc','%');
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	a	a	43	NULL	1	Using where; Using index
+select * from t1 where a like "abc%";
+a
+abc
+abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
+select * from t1 where a like "ABC%";
+a
+abc
+abcd
+select * from t1 where a like "test%";
+a
+test
+select * from t1 where a like "te_t";
+a
+test
+select * from t1 where a like "%a%";
+a
+a
+abc
+abcd
+select * from t1 where a like "%abcd%";
+a
+abcd
+select * from t1 where a like "%abc\d%";
+a
+abcd
+drop table t1;
+select 'AA' like 'AA';
+'AA' like 'AA'
+1
+select 'AA' like 'A%A';
+'AA' like 'A%A'
+1
+select 'AA' like 'A%%A';
+'AA' like 'A%%A'
+1
+select 'AA' like 'AA%';
+'AA' like 'AA%'
+1
+select 'AA' like '%AA%';
+'AA' like '%AA%'
+1
+select 'AA' like '%A';
+'AA' like '%A'
+1
+select 'AA' like '%AA';
+'AA' like '%AA'
+1
+select 'AA' like 'A%A%';
+'AA' like 'A%A%'
+1
+select 'AA' like '_%_%';
+'AA' like '_%_%'
+1
+select 'AA' like '%A%A';
+'AA' like '%A%A'
+1
+select 'AAA'like 'A%A%A';
+'AAA'like 'A%A%A'
+1
+select 'AZ' like 'AZ';
+'AZ' like 'AZ'
+1
+select 'AZ' like 'A%Z';
+'AZ' like 'A%Z'
+1
+select 'AZ' like 'A%%Z';
+'AZ' like 'A%%Z'
+1
+select 'AZ' like 'AZ%';
+'AZ' like 'AZ%'
+1
+select 'AZ' like '%AZ%';
+'AZ' like '%AZ%'
+1
+select 'AZ' like '%Z';
+'AZ' like '%Z'
+1
+select 'AZ' like '%AZ';
+'AZ' like '%AZ'
+1
+select 'AZ' like 'A%Z%';
+'AZ' like 'A%Z%'
+1
+select 'AZ' like '_%_%';
+'AZ' like '_%_%'
+1
+select 'AZ' like '%A%Z';
+'AZ' like '%A%Z'
+1
+select 'AZ' like 'A_';
+'AZ' like 'A_'
+1
+select 'AZ' like '_Z';
+'AZ' like '_Z'
+1
+select 'AMZ'like 'A%M%Z';
+'AMZ'like 'A%M%Z'
+1
+SET NAMES utf8;
+SET character_set_connection=utf16;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
+INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
+INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ');
+SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапролдЖ
+фывапролДж
+фывапроЛдж
+фывапрОлдж
+фывапРолдж
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапролдЖ
+фывапролДж
+фывапроЛдж
+фывапрОлдж
+фывапРолдж
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a;
+a
+ФЫВА
+ФЫВАПРОЛДЖ
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фыВа
+фыВапролдж
+фывА
+фывАпролдж
+фыва
+фываПролдж
+фывапролдЖ
+фывапролДж
+фывапроЛдж
+фывапрОлдж
+фывапРолдж
+фывапролдж
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf16_bin ORDER BY BINARY a;
+a
+фЫва
+фЫвапролдж
+DROP TABLE t1;
+CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
+ENGINE=MyISAM CHARACTER SET utf16;
+INSERT INTO t1 (word) VALUES ("cat");
+SELECT * FROM t1 WHERE word LIKE "c%";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "ca_";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "cat";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630025';
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630061005F';
+word
+cat
+DROP TABLE t1;
+select insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066);
+insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066)
+abc
+select insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066);
+insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066)
+defc
+SET NAMES latin1;
+CREATE TABLE t1 (
+word VARCHAR(64),
+bar INT(11) default 0,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf16
+COLLATE utf16_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
+SELECT * FROM t1 ORDER BY word;
+word	bar
+a	0
+aar	0
+aardvar	0
+aardvara	0
+aardvark	0
+aardvarz	0
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	PRIMARY	258	NULL	6	Using index
+SELECT word FROM t1 ORDER by word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word VARCHAR(64) ,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf16
+COLLATE utf16_general_ci;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY WORD;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	PRIMARY	258	NULL	6	Using index
+SELECT * FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word TEXT,
+bar INT(11) AUTO_INCREMENT,
+PRIMARY KEY (bar))
+ENGINE=MyISAM
+CHARSET utf16
+COLLATE utf16_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a" );
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
+SELECT * FROM t1 ORDER BY word;
+word	bar
+a	2
+aar	1
+aardvar	3
+aardvara	5
+aardvark	4
+aardvarz	6
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
+SELECT word FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+SELECT hex(cast(0xAA as char character set utf16));
+hex(cast(0xAA as char character set utf16))
+000000AA
+SELECT hex(convert(0xAA using utf16));
+hex(convert(0xAA using utf16))
+000000AA
+CREATE TABLE t1 (a char(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a text character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a mediumtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a longtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0001
+0011
+0111
+1111
+00011111
+DROP TABLE t1;
+create table t1(a char(1)) default charset utf16;
+insert into t1 values ('a'),('b'),('c');
+alter table t1 modify a char(5);
+select a, hex(a) from t1;
+a	hex(a)
+a	0061
+b	0062
+c	0063
+drop table t1;
+set @ivar= 1234;
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using utf16);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+?
+1234
+set names utf8;
+create table t1 (a enum('x','y','z') character set utf16);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` enum('x','y','z') CHARACTER SET utf16 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+select a, hex(a) from t1 order by a;
+a	hex(a)
+x	0078
+y	0079
+z	007A
+alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set utf16;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf16 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('D');
+insert into t1 values ('E ');
+insert into t1 values ('ä');
+insert into t1 values ('ö');
+insert into t1 values ('ü');
+select a, hex(a) from t1 order by a;
+a	hex(a)
+x	0078
+y	0079
+z	007A
+d	0064
+e	0065
+ä	00E4
+ö	00F6
+ü	00FC
+drop table t1;
+create table t1 (a set ('x','y','z','ä','ö','ü') character set utf16);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` set('x','y','z','ä','ö','ü') CHARACTER SET utf16 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+insert into t1 values ('x,y');
+insert into t1 values ('x,y,z,ä,ö,ü');
+select a, hex(a) from t1 order by a;
+a	hex(a)
+x	0078
+y	0079
+x,y	0078002C0079
+z	007A
+x,y,z,ä,ö,ü	0078002C0079002C007A002C00E4002C00F6002C00FC
+drop table t1;
+create table t1(a enum('a','b','c')) default character set utf16;
+insert into t1 values('a'),('b'),('c');
+alter table t1 add b char(1);
+show warnings;
+Level	Code	Message
+select * from t1 order by a;
+a	b
+a	NULL
+b	NULL
+c	NULL
+drop table t1;
+SET NAMES latin1;
+SET collation_connection='utf16_general_ci';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a)	hex(a)
+utf16_general_ci	00610009
+utf16_general_ci	0061
+utf16_general_ci	00610020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf16_general_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+SET NAMES latin1;
+SET collation_connection='utf16_bin';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a)	hex(a)
+utf16_bin	00610009
+utf16_bin	0061
+utf16_bin	00610020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf16_bin
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+select hex(substr(_utf16 0x00e400e50068,1));
+hex(substr(_utf16 0x00e400e50068,1))
+00E400E50068
+select hex(substr(_utf16 0x00e400e50068,2));
+hex(substr(_utf16 0x00e400e50068,2))
+00E50068
+select hex(substr(_utf16 0x00e400e50068,3));
+hex(substr(_utf16 0x00e400e50068,3))
+0068
+select hex(substr(_utf16 0x00e400e50068,-1));
+hex(substr(_utf16 0x00e400e50068,-1))
+0068
+select hex(substr(_utf16 0x00e400e50068,-2));
+hex(substr(_utf16 0x00e400e50068,-2))
+00E50068
+select hex(substr(_utf16 0x00e400e50068,-3));
+hex(substr(_utf16 0x00e400e50068,-3))
+00E400E50068
+select hex(substr(_utf16 0x00e400e5D800DC00,1));
+hex(substr(_utf16 0x00e400e5D800DC00,1))
+00E400E5D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,2));
+hex(substr(_utf16 0x00e400e5D800DC00,2))
+00E5D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,3));
+hex(substr(_utf16 0x00e400e5D800DC00,3))
+D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,-1));
+hex(substr(_utf16 0x00e400e5D800DC00,-1))
+D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,-2));
+hex(substr(_utf16 0x00e400e5D800DC00,-2))
+00E5D800DC00
+select hex(substr(_utf16 0x00e400e5D800DC00,-3));
+hex(substr(_utf16 0x00e400e5D800DC00,-3))
+00E400E5D800DC00
+SET NAMES latin1;
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+create table t1 (
+a char(10) character set utf16 not null, 
+index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+explain select hex(a) from t1 order by a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	a	40	NULL	3	Using index
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+drop table t1;
+CREATE TABLE t1 (
+status enum('active','passive') character set utf16 collate utf16_general_ci 
+NOT NULL default 'passive'
+);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `status` enum('active','passive') CHARACTER SET utf16 NOT NULL DEFAULT 'passive'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD a int NOT NULL AFTER status;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `status` enum('active','passive') CHARACTER SET utf16 NOT NULL DEFAULT 'passive',
+  `a` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+End of 4.1 tests
+CREATE TABLE t1 (a varchar(64) character set utf16, b decimal(10,3));
+INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
+update t1 set b=a;
+SELECT *, hex(a) FROM t1;
+a	b	hex(a)
+1.1	1.100	0031002E0031
+2.1	2.100	0032002E0031
+DROP TABLE t1;
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+set names latin1;
+set character_set_connection=utf16;
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+soundex('')	soundex('he')	soundex('hello all folks')	soundex('#3556 in bugdb')
+	H000	H4142	I51231
+select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
+hex(soundex(''))	hex(soundex('he'))	hex(soundex('hello all folks'))	hex(soundex('#3556 in bugdb'))
+	0048003000300030	00480034003100340032	004900350031003200330031
+select 'mood' sounds like 'mud';
+'mood' sounds like 'mud'
+1
+select hex(soundex(_utf16 0x041004110412));
+hex(soundex(_utf16 0x041004110412))
+0410003000300030
+select hex(soundex(_utf16 0x00BF00C0));
+hex(soundex(_utf16 0x00BF00C0))
+00C0003000300030
+set names latin1;
+create table t1(a blob, b text charset utf16);
+select data_type, character_octet_length, character_maximum_length
+from information_schema.columns where table_name='t1';
+data_type	character_octet_length	character_maximum_length
+blob	65535	65535
+text	65535	32767
+drop table t1;
+End of 5.0 tests
+set collation_connection=utf16_general_ci;
+select @@collation_connection;
+@@collation_connection
+utf16_general_ci
+select hex(weight_string('a'));
+hex(weight_string('a'))
+0041
+select hex(weight_string('A'));
+hex(weight_string('A'))
+0041
+select hex(weight_string('abc'));
+hex(weight_string('abc'))
+004100420043
+select hex(weight_string('abc' as char(2)));
+hex(weight_string('abc' as char(2)))
+00410042
+select hex(weight_string('abc' as char(3)));
+hex(weight_string('abc' as char(3)))
+004100420043
+select hex(weight_string('abc' as char(5)));
+hex(weight_string('abc' as char(5)))
+00410042004300200020
+select hex(weight_string(_utf16 0xD800DC00));
+hex(weight_string(_utf16 0xD800DC00))
+FFFD
+select hex(weight_string(_utf16 0xD800DC01));
+hex(weight_string(_utf16 0xD800DC01))
+FFFD
+select @@collation_connection;
+@@collation_connection
+utf16_general_ci
+select hex(weight_string('a' LEVEL 1));
+hex(weight_string('a' LEVEL 1))
+0041
+select hex(weight_string('A' LEVEL 1));
+hex(weight_string('A' LEVEL 1))
+0041
+select hex(weight_string('abc' LEVEL 1));
+hex(weight_string('abc' LEVEL 1))
+004100420043
+select hex(weight_string('abc' as char(2) LEVEL 1));
+hex(weight_string('abc' as char(2) LEVEL 1))
+00410042
+select hex(weight_string('abc' as char(3) LEVEL 1));
+hex(weight_string('abc' as char(3) LEVEL 1))
+004100420043
+select hex(weight_string('abc' as char(5) LEVEL 1));
+hex(weight_string('abc' as char(5) LEVEL 1))
+00410042004300200020
+select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
+20002000430042004100
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC))
+FFBEFFBDFFBCFFDFFFDF
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
+DFFFDFFFBCFFBDFFBEFF
+set collation_connection=utf16_bin;
+select @@collation_connection;
+@@collation_connection
+utf16_bin
+select hex(weight_string('a'));
+hex(weight_string('a'))
+0061
+select hex(weight_string('A'));
+hex(weight_string('A'))
+0041
+select hex(weight_string('abc'));
+hex(weight_string('abc'))
+006100620063
+select hex(weight_string('abc' as char(2)));
+hex(weight_string('abc' as char(2)))
+00610062
+select hex(weight_string('abc' as char(3)));
+hex(weight_string('abc' as char(3)))
+006100620063
+select hex(weight_string('abc' as char(5)));
+hex(weight_string('abc' as char(5)))
+00610062006300200020
+select @@collation_connection;
+@@collation_connection
+utf16_bin
+select hex(weight_string('a' LEVEL 1));
+hex(weight_string('a' LEVEL 1))
+0061
+select hex(weight_string('A' LEVEL 1));
+hex(weight_string('A' LEVEL 1))
+0041
+select hex(weight_string('abc' LEVEL 1));
+hex(weight_string('abc' LEVEL 1))
+006100620063
+select hex(weight_string('abc' as char(2) LEVEL 1));
+hex(weight_string('abc' as char(2) LEVEL 1))
+00610062
+select hex(weight_string('abc' as char(3) LEVEL 1));
+hex(weight_string('abc' as char(3) LEVEL 1))
+006100620063
+select hex(weight_string('abc' as char(5) LEVEL 1));
+hex(weight_string('abc' as char(5) LEVEL 1))
+00610062006300200020
+select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
+20002000630062006100
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC))
+FF9EFF9DFF9CFFDFFFDF
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
+DFFFDFFF9CFF9DFF9EFF
+set names latin1;
+set collation_connection=utf16_general_ci;
+select position('bb' in 'abba');
+position('bb' in 'abba')
+2
+create table t1 (a varchar(10) character set utf16) engine=heap;
+insert into t1 values ('a'),('A'),('b'),('B');
+select * from t1 where a='a' order by binary a;
+a
+A
+a
+select hex(min(binary a)),count(*) from t1 group by a;
+hex(min(binary a))	count(*)
+0041	2
+0042	2
+drop table t1;
+select char_length('abcd'), octet_length('abcd');
+char_length('abcd')	octet_length('abcd')
+4	8
+select char_length(_utf16 0xD800DC00), octet_length(_utf16 0xD800DC00);
+char_length(_utf16 0xD800DC00)	octet_length(_utf16 0xD800DC00)
+1	4
+select char_length(_utf16 0xD87FDFFF), octet_length(_utf16 0xD87FDFFF);
+char_length(_utf16 0xD87FDFFF)	octet_length(_utf16 0xD87FDFFF)
+1	4
+select left('abcd',2);
+left('abcd',2)
+ab
+select hex(left(_utf16 0xD800DC00D87FDFFF, 1));
+hex(left(_utf16 0xD800DC00D87FDFFF, 1))
+D800DC00
+select hex(right(_utf16 0xD800DC00D87FDFFF, 1));
+hex(right(_utf16 0xD800DC00D87FDFFF, 1))
+D87FDFFF
+create table t1 (a varchar(10) character set utf16);
+insert into t1 values (_utf16 0xD800);
+Warnings:
+Warning	1366	Incorrect string value: '\xD8\x00' for column 'a' at row 1
+insert into t1 values (_utf16 0xDC00);
+Warnings:
+Warning	1366	Incorrect string value: '\xDC\x00' for column 'a' at row 1
+insert into t1 values (_utf16 0xD800D800);
+Warnings:
+Warning	1366	Incorrect string value: '\xD8\x00\xD8\x00' for column 'a' at row 1
+insert into t1 values (_utf16 0xD800E800);
+Warnings:
+Warning	1366	Incorrect string value: '\xD8\x00\xE8\x00' for column 'a' at row 1
+insert into t1 values (_utf16 0xD8000800);
+Warnings:
+Warning	1366	Incorrect string value: '\xD8\x00\x08\x00' for column 'a' at row 1
+insert into t1 values (_utf16 0xD800DC00);
+insert into t1 values (_utf16 0xD800DCFF);
+insert into t1 values (_utf16 0xDBFFDC00);
+insert into t1 values (_utf16 0xDBFFDCFF);
+select hex(a) from t1;
+hex(a)
+
+
+
+
+
+D800DC00
+D800DCFF
+DBFFDC00
+DBFFDCFF
+drop table t1;
+create table t1 (a char(10)) character set utf16;
+insert into t1 values ('a   ');
+select hex(a) from t1;
+hex(a)
+0061
+drop table t1;
+select upper('abcd'), lower('ABCD');
+upper('abcd')	lower('ABCD')
+ABCD	abcd
+create table t1 (a varchar(10) character set utf16);
+insert into t1 values (123456);
+select a, hex(a) from t1;
+a	hex(a)
+123456	003100320033003400350036
+drop table t1;
+select hex(soundex('a'));
+hex(soundex('a'))
+0041003000300030
+create table t1 (a enum ('a','b','c')) character set utf16;
+insert into t1 values ('1');
+select * from t1;
+a
+a
+drop table t1;
+set names latin1;
+select hex(conv(convert('123' using utf16), -10, 16));
+hex(conv(convert('123' using utf16), -10, 16))
+3742
+select hex(conv(convert('123' using utf16), 10, 16));
+hex(conv(convert('123' using utf16), 10, 16))
+3742
+set names latin1;
+set character_set_connection=utf16;
+select 1.1 + '1.2';
+1.1 + '1.2'
+2.3
+select 1.1 + '1.2xxx';
+1.1 + '1.2xxx'
+2.3
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: ''
+select left('aaa','1');
+left('aaa','1')
+a
+create table t1 (a int);
+insert into t1 values ('-1234.1e2');
+insert into t1 values ('-1234.1e2xxxx');
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+insert into t1 values ('-1234.1e2    ');
+select * from t1;
+a
+-123410
+-123410
+-123410
+drop table t1;
+create table t1 (a int);
+insert into t1 values ('1 ');
+insert into t1 values ('1 x');
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+select * from t1;
+a
+1
+1
+drop table t1;
+create table t1 (a varchar(17000) character set utf16);
+Warnings:
+Note	1246	Converting column 'a' from VARCHAR to TEXT
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` mediumtext CHARACTER SET utf16
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(250) character set utf16 primary key);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` varchar(250) CHARACTER SET utf16 NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(334) character set utf16 primary key);
+ERROR 42000: Specified key was too long; max key length is 1332 bytes
+create table t1 (a char(1) character set utf16);
+insert into t1 values (0xD800DC00),(0xD800DCFF),(0xDB7FDC00),(0xDB7FDCFF);
+insert into t1 values (0x00C0), (0x00FF),(0xE000), (0xFFFF);
+select hex(a), hex(@a:=convert(a using utf8)), hex(convert(@a using utf16)) from t1;
+hex(a)	hex(@a:=convert(a using utf8))	hex(convert(@a using utf16))
+D800DC00	F0908080	D800DC00
+D800DCFF	F09083BF	D800DCFF
+DB7FDC00	F3AFB080	DB7FDC00
+DB7FDCFF	F3AFB3BF	DB7FDCFF
+00C0	C380	00C0
+00FF	C3BF	00FF
+E000	EE8080	E000
+FFFF	EFBFBF	FFFF
+drop table t1;
diff -Nrup a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/ctype_utf16_uca.result	2007-09-12 17:41:16 +05:00
@@ -0,0 +1,2405 @@
+DROP TABLE IF EXISTS t1;
+set names utf8;
+set collation_connection=utf16_unicode_ci;
+select hex('a'), hex('a ');
+hex('a')	hex('a ')
+0061	00610020
+select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
+'a' = 'a'	'a' = 'a '	'a ' = 'a'
+1	1	1
+select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
+'a\0' = 'a'	'a\0' < 'a'	'a\0' > 'a'
+1	0	0
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+'a' = 'a\0'	'a' < 'a\0'	'a' > 'a\0'
+1	0	0
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+'a\0' = 'a '	'a\0' < 'a '	'a\0' > 'a '
+1	0	0
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+'a ' = 'a\0'	'a ' < 'a\0'	'a ' > 'a\0'
+1	0	0
+select 'a  a' > 'a', 'a  \0' < 'a';
+'a  a' > 'a'	'a  \0' < 'a'
+1	0
+select binary 'a  a' > 'a', binary 'a  \0' > 'a', binary 'a\0' > 'a';
+binary 'a  a' > 'a'	binary 'a  \0' > 'a'	binary 'a\0' > 'a'
+1	1	1
+select 'c' like '\_' as want0;
+want0
+0
+CREATE TABLE t (
+c char(20) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARACTER SET utf16 COLLATE utf16_unicode_ci;
+INSERT INTO t VALUES ('a'),('ab'),('aba');
+ALTER TABLE t ADD INDEX (c);
+SELECT c FROM t WHERE c LIKE 'a%';
+c
+a
+ab
+aba
+DROP TABLE t;
+create table t1 (c1 char(10) character set utf16 collate utf16_bin);
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+insert into t1 values (0x00e0),(0x00c0);
+insert into t1 values (0x00e1),(0x00c1);
+insert into t1 values (0x00e2),(0x00c2);
+insert into t1 values (0x00e3),(0x00c3);
+insert into t1 values (0x00e4),(0x00c4);
+insert into t1 values (0x00e5),(0x00c5);
+insert into t1 values (0x00e6),(0x00c6);
+insert into t1 values (0x00e7),(0x00c7);
+insert into t1 values (0x00e8),(0x00c8);
+insert into t1 values (0x00e9),(0x00c9);
+insert into t1 values (0x00ea),(0x00ca);
+insert into t1 values (0x00eb),(0x00cb);
+insert into t1 values (0x00ec),(0x00cc);
+insert into t1 values (0x00ed),(0x00cd);
+insert into t1 values (0x00ee),(0x00ce);
+insert into t1 values (0x00ef),(0x00cf);
+insert into t1 values (0x00f0),(0x00d0);
+insert into t1 values (0x00f1),(0x00d1);
+insert into t1 values (0x00f2),(0x00d2);
+insert into t1 values (0x00f3),(0x00d3);
+insert into t1 values (0x00f4),(0x00d4);
+insert into t1 values (0x00f5),(0x00d5);
+insert into t1 values (0x00f6),(0x00d6);
+insert into t1 values (0x00f7),(0x00d7);
+insert into t1 values (0x00f8),(0x00d8);
+insert into t1 values (0x00f9),(0x00d9);
+insert into t1 values (0x00fa),(0x00da);
+insert into t1 values (0x00fb),(0x00db);
+insert into t1 values (0x00fc),(0x00dc);
+insert into t1 values (0x00fd),(0x00dd);
+insert into t1 values (0x00fe),(0x00de);
+insert into t1 values (0x00ff),(0x00df);
+insert into t1 values (0x0100),(0x0101),(0x0102),(0x0103);
+insert into t1 values (0x0104),(0x0105),(0x0106),(0x0107);
+insert into t1 values (0x0108),(0x0109),(0x010a),(0x010b);
+insert into t1 values (0x010c),(0x010d),(0x010e),(0x010f);
+insert into t1 values (0x0110),(0x0111),(0x0112),(0x0113);
+insert into t1 values (0x0114),(0x0115),(0x0116),(0x0117);
+insert into t1 values (0x0118),(0x0119),(0x011a),(0x011b);
+insert into t1 values (0x011c),(0x011d),(0x011e),(0x011f);
+insert into t1 values (0x0120),(0x0121),(0x0122),(0x0123);
+insert into t1 values (0x0124),(0x0125),(0x0126),(0x0127);
+insert into t1 values (0x0128),(0x0129),(0x012a),(0x012b);
+insert into t1 values (0x012c),(0x012d),(0x012e),(0x012f);
+insert into t1 values (0x0130),(0x0131),(0x0132),(0x0133);
+insert into t1 values (0x0134),(0x0135),(0x0136),(0x0137);
+insert into t1 values (0x0138),(0x0139),(0x013a),(0x013b);
+insert into t1 values (0x013c),(0x013d),(0x013e),(0x013f);
+insert into t1 values (0x0140),(0x0141),(0x0142),(0x0143);
+insert into t1 values (0x0144),(0x0145),(0x0146),(0x0147);
+insert into t1 values (0x0148),(0x0149),(0x014a),(0x014b);
+insert into t1 values (0x014c),(0x014d),(0x014e),(0x014f);
+insert into t1 values (0x0150),(0x0151),(0x0152),(0x0153);
+insert into t1 values (0x0154),(0x0155),(0x0156),(0x0157);
+insert into t1 values (0x0158),(0x0159),(0x015a),(0x015b);
+insert into t1 values (0x015c),(0x015d),(0x015e),(0x015f);
+insert into t1 values (0x0160),(0x0161),(0x0162),(0x0163);
+insert into t1 values (0x0164),(0x0165),(0x0166),(0x0167);
+insert into t1 values (0x0168),(0x0169),(0x016a),(0x016b);
+insert into t1 values (0x016c),(0x016d),(0x016e),(0x016f);
+insert into t1 values (0x0170),(0x0171),(0x0172),(0x0173);
+insert into t1 values (0x0174),(0x0175),(0x0176),(0x0177);
+insert into t1 values (0x0178),(0x0179),(0x017a),(0x017b);
+insert into t1 values (0x017c),(0x017d),(0x017e),(0x017f);
+insert into t1 values (0x0180),(0x0181),(0x0182),(0x0183);
+insert into t1 values (0x0184),(0x0185),(0x0186),(0x0187);
+insert into t1 values (0x0188),(0x0189),(0x018a),(0x018b);
+insert into t1 values (0x018c),(0x018d),(0x018e),(0x018f);
+insert into t1 values (0x0190),(0x0191),(0x0192),(0x0193);
+insert into t1 values (0x0194),(0x0195),(0x0196),(0x0197);
+insert into t1 values (0x0198),(0x0199),(0x019a),(0x019b);
+insert into t1 values (0x019c),(0x019d),(0x019e),(0x019f);
+insert into t1 values (0x01a0),(0x01a1),(0x01a2),(0x01a3);
+insert into t1 values (0x01a4),(0x01a5),(0x01a6),(0x01a7);
+insert into t1 values (0x01a8),(0x01a9),(0x01aa),(0x01ab);
+insert into t1 values (0x01ac),(0x01ad),(0x01ae),(0x01af);
+insert into t1 values (0x01b0),(0x01b1),(0x01b2),(0x01b3);
+insert into t1 values (0x01b4),(0x01b5),(0x01b6),(0x01b7);
+insert into t1 values (0x01b8),(0x01b9),(0x01ba),(0x01bb);
+insert into t1 values (0x01bc),(0x01bd),(0x01be),(0x01bf);
+insert into t1 values (0x01c0),(0x01c1),(0x01c2),(0x01c3);
+insert into t1 values (0x01c4),(0x01c5),(0x01c6),(0x01c7);
+insert into t1 values (0x01c8),(0x01c9),(0x01ca),(0x01cb);
+insert into t1 values (0x01cc),(0x01cd),(0x01ce),(0x01cf);
+insert into t1 values (0x01d0),(0x01d1),(0x01d2),(0x01d3);
+insert into t1 values (0x01d4),(0x01d5),(0x01d6),(0x01d7);
+insert into t1 values (0x01d8),(0x01d9),(0x01da),(0x01db);
+insert into t1 values (0x01dc),(0x01dd),(0x01de),(0x01df);
+insert into t1 values (0x01e0),(0x01e1),(0x01e2),(0x01e3);
+insert into t1 values (0x01e4),(0x01e5),(0x01e6),(0x01e7);
+insert into t1 values (0x01e8),(0x01e9),(0x01ea),(0x01eb);
+insert into t1 values (0x01ec),(0x01ed),(0x01ee),(0x01ef);
+insert into t1 values (0x01f0),(0x01f1),(0x01f2),(0x01f3);
+insert into t1 values (0x01f4),(0x01f5),(0x01f6),(0x01f7);
+insert into t1 values (0x01f8),(0x01f9),(0x01fa),(0x01fb);
+insert into t1 values (0x01fc),(0x01fd),(0x01fe),(0x01ff);
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_icelandic_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÂÃàâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Áá
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Ðð
+Đđ
+Ƌƌ
+EeÈÊËèêëĒēĔĕĖėĘęĚě
+Éé
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÎÏìîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Íí
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÔÕòôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÛÜùûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Úú
+Vv
+WwŴŵ
+Xx
+YyÿŶŷŸ
+Ýý
+Ƴƴ
+ZzŹźŻżŽž
+Þþ
+ÄÆäæ
+ÖØöø
+Åå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_latvian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġǦǧǴǵ
+Ģģ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Yy
+JjĴĵǰ
+KkǨǩ
+Ķķ
+Ƙƙ
+LlĹ弾
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Ļļ
+Łł
+Mm
+NnÑñŃńŇňǸǹ
+NJNjnJnjNJNjnj
+Ņņ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŘř
+RRRrrRrr
+Ŗŗ
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_romanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ăă
+Ââ
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÏìíïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Îî
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŤť
+Ţţ
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovenian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_polish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂăǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ąą
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĈĉĊċČč
+CHChcHch
+Ćć
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĚě
+Ęę
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ńń
+Ŋŋ
+OoÒÔÕÖòôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŜŝŞşŠšſ
+SSSssSssß
+Śś
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŽž
+Źź
+Żż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_estonian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdz
+DŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔòóôŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+Zz
+Žž
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Õõ
+Ää
+Öö
+Üü
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ŹźŻż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_swedish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Åå
+ÄÆäæ
+ÖØöø
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_turkish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcĆćĈĉĊċČč
+CHChcHch
+Çç
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĠġĢģǦǧǴǵ
+Ğğ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+Iı
+IJIj
+ƕǶ
+Ħħ
+iÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+iJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Öö
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Üü
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_czech_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗ
+RRRrrRrr
+Řř
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_danish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+aA
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŰűŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+ÄÆäæ
+ÖØöøŐő
+AAAaaaÅå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_lithuanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CCHChcchÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IYiyÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovak_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ää
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÕÖòóõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ôô
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish2_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+cH
+CHChch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+lL
+LLLlll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IJijÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJij
+IJij
+Ĵĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJlj
+LJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnj
+NJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+ÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+UVuv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĊċČč
+CHChcHch
+Ĉĉ
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĞğĠġĢģǦǧǴǵ
+Ĝĝ
+Ǥǥ
+Ƣƣ
+Hh
+Ĥĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Jjǰ
+Ĵĵ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŞşŠšſ
+SSSssSssß
+Ŝŝ
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Ŭŭ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ÖöŐő
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+ÜüŰű
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+drop table t1;
+SET NAMES utf8;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_general_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_general_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+SET NAMES utf8;
+SET @test_character_set='utf16';
+SET @test_collation='utf16_swedish_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET character_set_server= @test_character_set;
+SET collation_server= @test_collation;
+CREATE DATABASE d1;
+USE d1;
+CREATE TABLE t1 (c CHAR(10), KEY(c));
+SHOW FULL COLUMNS FROM t1;
+Field	Type	Collation	Null	Key	Default	Extra	Privileges	Comment
+c	char(10)	utf16_swedish_ci	YES	MUL	NULL			
+INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
+SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
+want3results
+aaa
+aaaa
+aaaaa
+DROP TABLE t1;
+CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
+SHOW FULL COLUMNS FROM t1;
+Field	Type	Collation	Null	Key	Default	Extra	Privileges	Comment
+c1	varchar(15)	utf16_swedish_ci	YES	MUL	NULL			
+INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
+SELECT c1 as want3results from t1 where c1 like 'l%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want3results from t1 where c1 like 'lo%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want1result  from t1 where c1 like 'loc%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'loca%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'locat%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'locati%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'locatio%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'location%';
+want1result
+location
+DROP TABLE t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
+SET collation_connection='utf16_unicode_ci';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a)	hex(a)
+utf16_unicode_ci	00610009
+utf16_unicode_ci	0061
+utf16_unicode_ci	00610020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf16_unicode_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+End of 4.1 tests
+CREATE TABLE t1 (id int, a varchar(30) character set utf16);
+INSERT INTO t1 VALUES (1, 0x01310069), (2, 0x01310131);
+INSERT INTO t1 VALUES (3, 0x00690069), (4, 0x01300049);
+INSERT INTO t1 VALUES (5, 0x01300130), (6, 0x00490049);
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a	la	l	ll	u	lu
+ıi	4	ıi	4	II	4
+ıı	4	ıı	4	II	4
+ii	4	ii	4	II	4
+İI	4	ii	4	İI	4
+İİ	4	ii	4	İİ	4
+II	4	ii	4	II	4
+ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf16 collate utf16_turkish_ci;
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a	la	l	ll	u	lu
+ıi	4	ıi	4	Iİ	4
+ıı	4	ıı	4	II	4
+ii	4	ii	4	İİ	4
+İI	4	iı	4	İI	4
+İİ	4	ii	4	İİ	4
+II	4	ıı	4	II	4
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 text character set utf16 collate utf16_polish_ci NOT NULL
+) ENGINE=MyISAM;
+insert into t1 values (''),('a');
+SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
+COUNT(*)	c1
+1	
+1	a
+DROP TABLE IF EXISTS t1;
+End of 5.1 tests
+set collation_connection=utf16_unicode_ci;
+select @@collation_connection;
+@@collation_connection
+utf16_unicode_ci
+select hex(weight_string('a'));
+hex(weight_string('a'))
+0E33
+select hex(weight_string('A'));
+hex(weight_string('A'))
+0E33
+select hex(weight_string('abc'));
+hex(weight_string('abc'))
+0E330E4A0E60
+select hex(weight_string('abc' as char(2)));
+hex(weight_string('abc' as char(2)))
+0E330E4A
+select hex(weight_string('abc' as char(3)));
+hex(weight_string('abc' as char(3)))
+0E330E4A0E60
+select hex(weight_string('abc' as char(5)));
+hex(weight_string('abc' as char(5)))
+0E330E4A0E6002090209
+select hex(weight_string(_utf16 0xD800DC00 collate utf16_unicode_ci));
+hex(weight_string(_utf16 0xD800DC00 collate utf16_unicode_ci))
+0DC6
+select hex(weight_string(_utf16 0xD800DC01 collate utf16_unicode_ci));
+hex(weight_string(_utf16 0xD800DC01 collate utf16_unicode_ci))
+0DC6
+select @@collation_connection;
+@@collation_connection
+utf16_unicode_ci
+select hex(weight_string('a' LEVEL 1));
+hex(weight_string('a' LEVEL 1))
+0E33
+select hex(weight_string('A' LEVEL 1));
+hex(weight_string('A' LEVEL 1))
+0E33
+select hex(weight_string('abc' LEVEL 1));
+hex(weight_string('abc' LEVEL 1))
+0E330E4A0E60
+select hex(weight_string('abc' as char(2) LEVEL 1));
+hex(weight_string('abc' as char(2) LEVEL 1))
+0E330E4A
+select hex(weight_string('abc' as char(3) LEVEL 1));
+hex(weight_string('abc' as char(3) LEVEL 1))
+0E330E4A0E60
+select hex(weight_string('abc' as char(5) LEVEL 1));
+hex(weight_string('abc' as char(5) LEVEL 1))
+0E330E4A0E6002090209
+select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
+09020902600E4A0E330E
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC))
+F1CCF1B5F19FFDF6FDF6
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
+F6FDF6FD9FF1B5F1CCF1
+set @@collation_connection=utf16_czech_ci;
+select @@collation_connection;
+@@collation_connection
+utf16_czech_ci
+select collation(cast(_latin1 0xDF as char));
+collation(cast(_latin1 0xDF as char))
+utf16_czech_ci
+select hex(weight_string('s'));
+hex(weight_string('s'))
+0FEA
+select hex(weight_string(cast(_latin1 0xDF as char)));
+hex(weight_string(cast(_latin1 0xDF as char)))
+0FEA0FEA
+select hex(weight_string(cast(_latin1 0xDF as char) as char(1)));
+hex(weight_string(cast(_latin1 0xDF as char) as char(1)))
+0FEA
+select hex(weight_string('c'));
+hex(weight_string('c'))
+0E60
+select hex(weight_string('h'));
+hex(weight_string('h'))
+0EE1
+select hex(weight_string('ch'));
+hex(weight_string('ch'))
+0EE2
+select hex(weight_string('i'));
+hex(weight_string('i'))
+0EFB
+select hex(weight_string(cast(_latin1 0x6368DF as char)));
+hex(weight_string(cast(_latin1 0x6368DF as char)))
+0EE20FEA0FEA
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(1)))
+0EE2
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(2)))
+0EE20FEA
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(3)))
+0EE20FEA0FEA
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(4)))
+0EE20FEA0FEA0209
+select hex(weight_string(cast(_latin1 0xDF6368 as char)));
+hex(weight_string(cast(_latin1 0xDF6368 as char)))
+0FEA0FEA0EE2
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1)))
+0FEA
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2)))
+0FEA0FEA
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3)))
+0FEA0FEA0EE2
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4)))
+0FEA0FEA0EE20209
+End of 5.2 tests
diff -Nrup a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/ctype_utf32.result	2007-09-12 17:41:17 +05:00
@@ -0,0 +1,997 @@
+DROP TABLE IF EXISTS t1;
+SET NAMES latin1;
+SET character_set_connection=utf32;
+select hex('a'), hex('a ');
+hex('a')	hex('a ')
+00000061	0000006100000020
+select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
+'a' = 'a'	'a' = 'a '	'a ' = 'a'
+1	1	1
+select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
+'a\0' = 'a'	'a\0' < 'a'	'a\0' > 'a'
+0	1	0
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+'a' = 'a\0'	'a' < 'a\0'	'a' > 'a\0'
+0	0	1
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+'a\0' = 'a '	'a\0' < 'a '	'a\0' > 'a '
+0	1	0
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+'a ' = 'a\0'	'a ' < 'a\0'	'a ' > 'a\0'
+0	0	1
+select 'a  a' > 'a', 'a  \0' < 'a';
+'a  a' > 'a'	'a  \0' < 'a'
+1	1
+select binary 'a  a' > 'a', binary 'a  \0' > 'a', binary 'a\0' > 'a';
+binary 'a  a' > 'a'	binary 'a  \0' > 'a'	binary 'a\0' > 'a'
+1	1	1
+select hex(_utf32 0x44);
+hex(_utf32 0x44)
+00000044
+select hex(_utf32 0x3344);
+hex(_utf32 0x3344)
+00003344
+select hex(_utf32 0x113344);
+hex(_utf32 0x113344)
+00113344
+select hex(_utf32 X'44');
+hex(_utf32 X'44')
+00000044
+select hex(_utf32 X'3344');
+hex(_utf32 X'3344')
+00003344
+select hex(_utf32 X'113344');
+hex(_utf32 X'113344')
+00113344
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+00000420
+00002004
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+00000420
+00002004
+DELETE FROM t1;
+INSERT INTO t1 VALUES
+(X'000004200000002000000020',X'000004200000002000000020'),
+(X'000020040000002000000020',X'000020040000002000000020');
+SELECT hex(word) FROM t1 ORDER BY word;
+hex(word)
+000004200000002000000020
+000020040000002000000020
+SELECT hex(word2) FROM t1 ORDER BY word2;
+hex(word2)
+00000420
+00002004
+DROP TABLE t1;
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0421'));
+hex(LPAD(_utf32 X'0420',10,_utf32 X'0421'))
+00000421000004210000042100000421000004210000042100000421000004210000042100000420
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'))
+00000421000004220000042100000422000004210000042200000421000004220000042100000420
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'))
+00000421000004220000042300000421000004220000042300000421000004220000042300000420
+SELECT hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'))
+00000420000004210000042200000423000004240000042500000426000004270000042800000429
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0421'));
+hex(RPAD(_utf32 X'0420',10,_utf32 X'0421'))
+00000420000004210000042100000421000004210000042100000421000004210000042100000421
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'))
+00000420000004210000042200000421000004220000042100000422000004210000042200000421
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'))
+00000420000004210000042200000423000004210000042200000423000004210000042200000423
+SELECT hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'))
+00000420000004210000042200000423000004240000042500000426000004270000042800000429
+CREATE TABLE t1 SELECT 
+LPAD(_utf32 X'0420',10,_utf32 X'0421') l,
+RPAD(_utf32 X'0420',10,_utf32 X'0421') r;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `l` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT '',
+  `r` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select hex(l), hex(r) from t1;
+hex(l)	hex(r)
+00000421000004210000042100000421000004210000042100000421000004210000042100000420	00000420000004210000042100000421000004210000042100000421000004210000042100000421
+DROP TABLE t1;
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+lpad(f1, 12, "-o-/")
+-o-/-o103000
+-o-/22720000
+-o-/-3401200
+-o-/-o-78000
+drop table t1;
+SET NAMES latin1;
+SET character_set_connection=utf32;
+create table t1 (a varchar(10) character set utf32, key(a));
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	a	a	43	NULL	1	Using where; Using index
+explain select * from t1 where a like concat('abc','%');
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	a	a	43	NULL	1	Using where; Using index
+select * from t1 where a like "abc%";
+a
+abc
+abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
+select * from t1 where a like "ABC%";
+a
+abc
+abcd
+select * from t1 where a like "test%";
+a
+test
+select * from t1 where a like "te_t";
+a
+test
+select * from t1 where a like "%a%";
+a
+a
+abc
+abcd
+select * from t1 where a like "%abcd%";
+a
+abcd
+select * from t1 where a like "%abc\d%";
+a
+abcd
+drop table t1;
+select 'AA' like 'AA';
+'AA' like 'AA'
+1
+select 'AA' like 'A%A';
+'AA' like 'A%A'
+1
+select 'AA' like 'A%%A';
+'AA' like 'A%%A'
+1
+select 'AA' like 'AA%';
+'AA' like 'AA%'
+1
+select 'AA' like '%AA%';
+'AA' like '%AA%'
+1
+select 'AA' like '%A';
+'AA' like '%A'
+1
+select 'AA' like '%AA';
+'AA' like '%AA'
+1
+select 'AA' like 'A%A%';
+'AA' like 'A%A%'
+1
+select 'AA' like '_%_%';
+'AA' like '_%_%'
+1
+select 'AA' like '%A%A';
+'AA' like '%A%A'
+1
+select 'AAA'like 'A%A%A';
+'AAA'like 'A%A%A'
+1
+select 'AZ' like 'AZ';
+'AZ' like 'AZ'
+1
+select 'AZ' like 'A%Z';
+'AZ' like 'A%Z'
+1
+select 'AZ' like 'A%%Z';
+'AZ' like 'A%%Z'
+1
+select 'AZ' like 'AZ%';
+'AZ' like 'AZ%'
+1
+select 'AZ' like '%AZ%';
+'AZ' like '%AZ%'
+1
+select 'AZ' like '%Z';
+'AZ' like '%Z'
+1
+select 'AZ' like '%AZ';
+'AZ' like '%AZ'
+1
+select 'AZ' like 'A%Z%';
+'AZ' like 'A%Z%'
+1
+select 'AZ' like '_%_%';
+'AZ' like '_%_%'
+1
+select 'AZ' like '%A%Z';
+'AZ' like '%A%Z'
+1
+select 'AZ' like 'A_';
+'AZ' like 'A_'
+1
+select 'AZ' like '_Z';
+'AZ' like '_Z'
+1
+select 'AMZ'like 'A%M%Z';
+'AMZ'like 'A%M%Z'
+1
+SET NAMES utf8;
+SET character_set_connection=utf32;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
+INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
+INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ');
+SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a;
+a
+ФЫВАПРОЛДЖ
+ФЫВА
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фывапролдЖ
+фывапролДж
+фывапроЛдж
+фывапрОлдж
+фывапРолдж
+фываПролдж
+фывАпролдж
+фыВапролдж
+фывапролдж
+фывА
+фыВа
+фыва
+SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a;
+a
+ФЫВАПРОЛДЖ
+ФЫВА
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фывапролдЖ
+фывапролДж
+фывапроЛдж
+фывапрОлдж
+фывапРолдж
+фываПролдж
+фывАпролдж
+фыВапролдж
+фывапролдж
+фывА
+фыВа
+фыва
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a;
+a
+ФЫВАПРОЛДЖ
+ФЫВА
+Фыва
+Фывапролдж
+фЫва
+фЫвапролдж
+фывапролдЖ
+фывапролДж
+фывапроЛдж
+фывапрОлдж
+фывапРолдж
+фываПролдж
+фывАпролдж
+фыВапролдж
+фывапролдж
+фывА
+фыВа
+фыва
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf32_bin ORDER BY BINARY a;
+a
+фЫва
+фЫвапролдж
+DROP TABLE t1;
+CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
+ENGINE=MyISAM CHARACTER SET utf32;
+INSERT INTO t1 (word) VALUES ("cat");
+SELECT * FROM t1 WHERE word LIKE "c%";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "ca_";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE "cat";
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf32 x'0000006300000025';
+word
+cat
+SELECT * FROM t1 WHERE word LIKE _utf32 x'00000063000000610000005F';
+word
+cat
+DROP TABLE t1;
+select insert(_utf32 0x000000610000006200000063,10,2,_utf32 0x000000640000006500000066);
+insert(_utf32 0x000000610000006200000063,10,2,_utf32 0x000000640000006500000066)
+abc
+select insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066);
+insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066)
+defc
+SET NAMES latin1;
+CREATE TABLE t1 (
+word VARCHAR(64),
+bar INT(11) default 0,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf32
+COLLATE utf32_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
+SELECT * FROM t1 ORDER BY word;
+word	bar
+a	0
+aar	0
+aardvar	0
+aardvara	0
+aardvark	0
+aardvarz	0
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	PRIMARY	258	NULL	6	Using index
+SELECT word FROM t1 ORDER by word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word VARCHAR(64) ,
+PRIMARY KEY (word))
+ENGINE=MyISAM
+CHARSET utf32
+COLLATE utf32_general_ci;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY WORD;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	PRIMARY	258	NULL	6	Using index
+SELECT * FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+CREATE TABLE t1 (
+word TEXT,
+bar INT(11) AUTO_INCREMENT,
+PRIMARY KEY (bar))
+ENGINE=MyISAM
+CHARSET utf32
+COLLATE utf32_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a" );
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
+SELECT * FROM t1 ORDER BY word;
+word	bar
+a	2
+aar	1
+aardvar	3
+aardvara	5
+aardvark	4
+aardvarz	6
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
+SELECT word FROM t1 ORDER BY word;
+word
+a
+aar
+aardvar
+aardvara
+aardvark
+aardvarz
+DROP TABLE t1;
+SELECT hex(cast(0xAA as char character set utf32));
+hex(cast(0xAA as char character set utf32))
+000000AA
+SELECT hex(convert(0xAA using utf32));
+hex(convert(0xAA using utf32))
+000000AA
+CREATE TABLE t1 (a char(10) character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a varchar(10) character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a text character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a mediumtext character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+CREATE TABLE t1 (a longtext character set utf32);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000001
+00000011
+00000111
+00001111
+00011111
+DROP TABLE t1;
+create table t1(a char(1)) default charset utf32;
+insert into t1 values ('a'),('b'),('c');
+alter table t1 modify a char(5);
+select a, hex(a) from t1;
+a	hex(a)
+a	00000061
+b	00000062
+c	00000063
+drop table t1;
+set @ivar= 1234;
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using utf32);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+?
+1234
+set names utf8;
+create table t1 (a enum('x','y','z') character set utf32);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` enum('x','y','z') CHARACTER SET utf32 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+select a, hex(a) from t1 order by a;
+a	hex(a)
+x	00000078
+y	00000079
+z	0000007A
+alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set utf32;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf32 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('D');
+insert into t1 values ('E ');
+insert into t1 values ('ä');
+insert into t1 values ('ö');
+insert into t1 values ('ü');
+select a, hex(a) from t1 order by a;
+a	hex(a)
+x	00000078
+y	00000079
+z	0000007A
+d	00000064
+e	00000065
+ä	000000E4
+ö	000000F6
+ü	000000FC
+drop table t1;
+create table t1 (a set ('x','y','z','ä','ö','ü') character set utf32);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` set('x','y','z','ä','ö','ü') CHARACTER SET utf32 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+insert into t1 values ('x,y');
+insert into t1 values ('x,y,z,ä,ö,ü');
+select a, hex(a) from t1 order by a;
+a	hex(a)
+x	00000078
+y	00000079
+x,y	000000780000002C00000079
+z	0000007A
+x,y,z,ä,ö,ü	000000780000002C000000790000002C0000007A0000002C000000E40000002C000000F60000002C000000FC
+drop table t1;
+create table t1(a enum('a','b','c')) default character set utf32;
+insert into t1 values('a'),('b'),('c');
+alter table t1 add b char(1);
+show warnings;
+Level	Code	Message
+select * from t1 order by a;
+a	b
+a	NULL
+b	NULL
+c	NULL
+drop table t1;
+SET NAMES latin1;
+SET collation_connection='utf32_general_ci';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a)	hex(a)
+utf32_general_ci	0000006100000009
+utf32_general_ci	00000061
+utf32_general_ci	0000006100000020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf32_general_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+SET NAMES latin1;
+SET collation_connection='utf32_bin';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a)	hex(a)
+utf32_bin	0000006100000009
+utf32_bin	00000061
+utf32_bin	0000006100000020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf32_bin
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+select hex(substr(_utf32 0x000000e4000000e500000068,1));
+hex(substr(_utf32 0x000000e4000000e500000068,1))
+000000E4000000E500000068
+select hex(substr(_utf32 0x000000e4000000e500000068,2));
+hex(substr(_utf32 0x000000e4000000e500000068,2))
+000000E500000068
+select hex(substr(_utf32 0x000000e4000000e500000068,3));
+hex(substr(_utf32 0x000000e4000000e500000068,3))
+00000068
+select hex(substr(_utf32 0x000000e4000000e500000068,-1));
+hex(substr(_utf32 0x000000e4000000e500000068,-1))
+00000068
+select hex(substr(_utf32 0x000000e4000000e500000068,-2));
+hex(substr(_utf32 0x000000e4000000e500000068,-2))
+000000E500000068
+select hex(substr(_utf32 0x000000e4000000e500000068,-3));
+hex(substr(_utf32 0x000000e4000000e500000068,-3))
+000000E4000000E500000068
+CREATE TABLE t1 (
+a varchar(250) NOT NULL default '',
+KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE utf32_general_ci;
+insert into t1 values (0x803d);
+insert into t1 values (0x005b);
+select hex(a) from t1;
+hex(a)
+0000005B
+0000803D
+drop table t1;
+create table t1 (utext varchar(20) character set utf32);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+create table t1 (
+a char(10) character set utf32 not null, 
+index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x0000201f, 10));
+insert into t1 values (repeat(0x00002020, 10));
+insert into t1 values (repeat(0x00002021, 10));
+explain select hex(a) from t1 order by a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	a	40	NULL	3	Using index
+select hex(a) from t1 order by a;
+hex(a)
+0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F
+00002020000020200000202000002020000020200000202000002020000020200000202000002020
+00002021000020210000202100002021000020210000202100002021000020210000202100002021
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+hex(a)
+0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F0000201F
+00002020000020200000202000002020000020200000202000002020000020200000202000002020
+00002021000020210000202100002021000020210000202100002021000020210000202100002021
+drop table t1;
+CREATE TABLE t1 (
+status enum('active','passive') character set utf32 collate utf32_general_ci 
+NOT NULL default 'passive'
+);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `status` enum('active','passive') CHARACTER SET utf32 NOT NULL DEFAULT 'passive'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD a int NOT NULL AFTER status;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `status` enum('active','passive') CHARACTER SET utf32 NOT NULL DEFAULT 'passive',
+  `a` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+End of 4.1 tests
+CREATE TABLE t1 (a varchar(64) character set utf32, b decimal(10,3));
+INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
+update t1 set b=a;
+SELECT *, hex(a) FROM t1;
+a	b	hex(a)
+1.1	1.100	000000310000002E00000031
+2.1	2.100	000000320000002E00000031
+DROP TABLE t1;
+create table t1 (utext varchar(20) character set utf32);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+utext
+lily
+river
+execute stmt using @param1;
+utext
+lily
+river
+select utext from t1 where utext like '%%';
+utext
+lily
+river
+drop table t1;
+deallocate prepare stmt;
+set names latin1;
+set character_set_connection=utf32;
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+soundex('')	soundex('he')	soundex('hello all folks')	soundex('#3556 in bugdb')
+	H000	H4142	I51231
+select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
+hex(soundex(''))	hex(soundex('he'))	hex(soundex('hello all folks'))	hex(soundex('#3556 in bugdb'))
+	00000048000000300000003000000030	0000004800000034000000310000003400000032	000000490000003500000031000000320000003300000031
+select 'mood' sounds like 'mud';
+'mood' sounds like 'mud'
+1
+select hex(soundex(_utf32 0x000004100000041100000412));
+hex(soundex(_utf32 0x000004100000041100000412))
+00000410000000300000003000000030
+select hex(soundex(_utf32 0x000000BF000000C0));
+hex(soundex(_utf32 0x000000BF000000C0))
+000000C0000000300000003000000030
+set names latin1;
+create table t1(a blob, b text charset utf32);
+select data_type, character_octet_length, character_maximum_length
+from information_schema.columns where table_name='t1';
+data_type	character_octet_length	character_maximum_length
+blob	65535	65535
+text	65535	16383
+drop table t1;
+End of 5.0 tests
+set collation_connection=utf32_general_ci;
+select @@collation_connection;
+@@collation_connection
+utf32_general_ci
+select hex(weight_string('a'));
+hex(weight_string('a'))
+0041
+select hex(weight_string('A'));
+hex(weight_string('A'))
+0041
+select hex(weight_string('abc'));
+hex(weight_string('abc'))
+004100420043
+select hex(weight_string('abc' as char(2)));
+hex(weight_string('abc' as char(2)))
+00410042
+select hex(weight_string('abc' as char(3)));
+hex(weight_string('abc' as char(3)))
+004100420043
+select hex(weight_string('abc' as char(5)));
+hex(weight_string('abc' as char(5)))
+00410042004300200020
+select hex(weight_string(_utf32 0x10000));
+hex(weight_string(_utf32 0x10000))
+FFFD
+select hex(weight_string(_utf32 0x10001));
+hex(weight_string(_utf32 0x10001))
+FFFD
+select @@collation_connection;
+@@collation_connection
+utf32_general_ci
+select hex(weight_string('a' LEVEL 1));
+hex(weight_string('a' LEVEL 1))
+0041
+select hex(weight_string('A' LEVEL 1));
+hex(weight_string('A' LEVEL 1))
+0041
+select hex(weight_string('abc' LEVEL 1));
+hex(weight_string('abc' LEVEL 1))
+004100420043
+select hex(weight_string('abc' as char(2) LEVEL 1));
+hex(weight_string('abc' as char(2) LEVEL 1))
+00410042
+select hex(weight_string('abc' as char(3) LEVEL 1));
+hex(weight_string('abc' as char(3) LEVEL 1))
+004100420043
+select hex(weight_string('abc' as char(5) LEVEL 1));
+hex(weight_string('abc' as char(5) LEVEL 1))
+00410042004300200020
+select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
+20002000430042004100
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC))
+FFBEFFBDFFBCFFDFFFDF
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
+DFFFDFFFBCFFBDFFBEFF
+set collation_connection=utf32_bin;
+select @@collation_connection;
+@@collation_connection
+utf32_bin
+select hex(weight_string('a'));
+hex(weight_string('a'))
+0061
+select hex(weight_string('A'));
+hex(weight_string('A'))
+0041
+select hex(weight_string('abc'));
+hex(weight_string('abc'))
+006100620063
+select hex(weight_string('abc' as char(2)));
+hex(weight_string('abc' as char(2)))
+00610062
+select hex(weight_string('abc' as char(3)));
+hex(weight_string('abc' as char(3)))
+006100620063
+select hex(weight_string('abc' as char(5)));
+hex(weight_string('abc' as char(5)))
+00610062006300200020
+select @@collation_connection;
+@@collation_connection
+utf32_bin
+select hex(weight_string('a' LEVEL 1));
+hex(weight_string('a' LEVEL 1))
+0061
+select hex(weight_string('A' LEVEL 1));
+hex(weight_string('A' LEVEL 1))
+0041
+select hex(weight_string('abc' LEVEL 1));
+hex(weight_string('abc' LEVEL 1))
+006100620063
+select hex(weight_string('abc' as char(2) LEVEL 1));
+hex(weight_string('abc' as char(2) LEVEL 1))
+00610062
+select hex(weight_string('abc' as char(3) LEVEL 1));
+hex(weight_string('abc' as char(3) LEVEL 1))
+006100620063
+select hex(weight_string('abc' as char(5) LEVEL 1));
+hex(weight_string('abc' as char(5) LEVEL 1))
+00610062006300200020
+select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
+20002000630062006100
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC))
+FF9EFF9DFF9CFFDFFFDF
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
+DFFFDFFF9CFF9DFF9EFF
+set names latin1;
+set collation_connection=utf32_general_ci;
+select position('bb' in 'abba');
+position('bb' in 'abba')
+2
+create table t1 (a varchar(10) character set utf32) engine=heap;
+insert into t1 values ('a'),('A'),('b'),('B');
+select * from t1 where a='a' order by binary a;
+a
+A
+a
+select hex(min(binary a)),count(*) from t1 group by a;
+hex(min(binary a))	count(*)
+00000041	2
+00000042	2
+drop table t1;
+select char_length('abcd'), octet_length('abcd');
+char_length('abcd')	octet_length('abcd')
+4	16
+select left('abcd',2);
+left('abcd',2)
+ab
+create table t1 (a varchar(10) character set utf32);
+insert into t1 values (_utf32 0x0010FFFF);
+insert into t1 values (_utf32 0x00110000);
+Warnings:
+Warning	1366	Incorrect string value: '\x00\x11\x00\x00' for column 'a' at row 1
+insert into t1 values (_utf32 0x00110101);
+Warnings:
+Warning	1366	Incorrect string value: '\x00\x11\x01\x01' for column 'a' at row 1
+insert into t1 values (_utf32 0x01000101);
+Warnings:
+Warning	1366	Incorrect string value: '\x01\x00\x01\x01' for column 'a' at row 1
+insert into t1 values (_utf32 0x11000101);
+Warnings:
+Warning	1366	Incorrect string value: '\x11\x00\x01\x01' for column 'a' at row 1
+select hex(a) from t1;
+hex(a)
+0010FFFF
+
+
+
+
+drop table t1;
+create table t1 (a char(10)) character set utf32;
+insert into t1 values ('a   ');
+select hex(a) from t1;
+hex(a)
+00000061
+drop table t1;
+select upper('abcd'), lower('ABCD');
+upper('abcd')	lower('ABCD')
+ABCD	abcd
+create table t1 (a varchar(10) character set utf32);
+insert into t1 values (123456);
+select a, hex(a) from t1;
+a	hex(a)
+123456	000000310000003200000033000000340000003500000036
+drop table t1;
+select hex(soundex('a'));
+hex(soundex('a'))
+00000041000000300000003000000030
+create table t1 (a enum ('a','b','c')) character set utf32;
+insert into t1 values ('1');
+select * from t1;
+a
+a
+drop table t1;
+set names latin1;
+select hex(conv(convert('123' using utf32), -10, 16));
+hex(conv(convert('123' using utf32), -10, 16))
+3742
+select hex(conv(convert('123' using utf32), 10, 16));
+hex(conv(convert('123' using utf32), 10, 16))
+3742
+set names latin1;
+set character_set_connection=utf32;
+select 1.1 + '1.2';
+1.1 + '1.2'
+2.3
+select 1.1 + '1.2xxx';
+1.1 + '1.2xxx'
+2.3
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: ''
+select left('aaa','1');
+left('aaa','1')
+a
+create table t1 (a int);
+insert into t1 values ('-1234.1e2');
+insert into t1 values ('-1234.1e2xxxx');
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+insert into t1 values ('-1234.1e2    ');
+select * from t1;
+a
+-123410
+-123410
+-123410
+drop table t1;
+create table t1 (a int);
+insert into t1 values ('1 ');
+insert into t1 values ('1 x');
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+select * from t1;
+a
+1
+1
+drop table t1;
+create table t1 (a varchar(17000) character set utf32);
+Warnings:
+Note	1246	Converting column 'a' from VARCHAR to TEXT
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` mediumtext CHARACTER SET utf32
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(250) character set utf32 primary key);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` varchar(250) CHARACTER SET utf32 NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a varchar(334) character set utf32 primary key);
+ERROR 42000: Specified key was too long; max key length is 1332 bytes
diff -Nrup a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/ctype_utf32_uca.result	2007-09-12 17:41:17 +05:00
@@ -0,0 +1,2405 @@
+DROP TABLE IF EXISTS t1;
+set names utf8;
+set collation_connection=utf32_unicode_ci;
+select hex('a'), hex('a ');
+hex('a')	hex('a ')
+00000061	0000006100000020
+select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
+'a' = 'a'	'a' = 'a '	'a ' = 'a'
+1	1	1
+select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
+'a\0' = 'a'	'a\0' < 'a'	'a\0' > 'a'
+1	0	0
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+'a' = 'a\0'	'a' < 'a\0'	'a' > 'a\0'
+1	0	0
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+'a\0' = 'a '	'a\0' < 'a '	'a\0' > 'a '
+1	0	0
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+'a ' = 'a\0'	'a ' < 'a\0'	'a ' > 'a\0'
+1	0	0
+select 'a  a' > 'a', 'a  \0' < 'a';
+'a  a' > 'a'	'a  \0' < 'a'
+1	0
+select binary 'a  a' > 'a', binary 'a  \0' > 'a', binary 'a\0' > 'a';
+binary 'a  a' > 'a'	binary 'a  \0' > 'a'	binary 'a\0' > 'a'
+1	1	1
+select 'c' like '\_' as want0;
+want0
+0
+CREATE TABLE t (
+c char(20) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARACTER SET utf32 COLLATE=utf32_unicode_ci;
+INSERT INTO t VALUES ('a'),('ab'),('aba');
+ALTER TABLE t ADD INDEX (c);
+SELECT c FROM t WHERE c LIKE 'a%';
+c
+a
+ab
+aba
+DROP TABLE t;
+create table t1 (c1 char(10) character set utf32 collate utf32_bin);
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
+insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
+insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
+insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
+insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
+insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
+insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
+insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
+insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
+insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
+insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
+insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
+insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
+insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
+insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
+insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
+insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
+insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
+insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
+insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
+insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
+insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
+insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
+insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
+insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
+insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
+insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
+insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
+insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
+insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
+insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
+insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
+insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
+insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
+insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
+insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
+insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
+insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
+insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
+insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
+insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
+insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
+insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
+insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
+insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
+insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
+insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
+insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
+insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
+insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
+insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
+insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
+insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
+insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
+insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
+insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
+insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
+insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
+insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
+insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
+insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
+insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
+insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
+insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
+insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
+insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
+insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
+insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
+insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
+insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
+insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
+insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
+insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
+insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
+insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
+insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
+insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
+insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
+insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
+insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
+insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
+insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
+insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
+insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
+insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
+insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
+insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
+insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
+insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
+insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
+insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
+insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
+insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
+insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
+insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
+insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_unicode_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_icelandic_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÂÃàâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Áá
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Ðð
+Đđ
+Ƌƌ
+EeÈÊËèêëĒēĔĕĖėĘęĚě
+Éé
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÎÏìîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Íí
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÔÕòôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÛÜùûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Úú
+Vv
+WwŴŵ
+Xx
+YyÿŶŷŸ
+Ýý
+Ƴƴ
+ZzŹźŻżŽž
+Þþ
+ÄÆäæ
+ÖØöø
+Åå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_latvian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġǦǧǴǵ
+Ģģ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Yy
+JjĴĵǰ
+KkǨǩ
+Ķķ
+Ƙƙ
+LlĹ弾
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Ļļ
+Łł
+Mm
+NnÑñŃńŇňǸǹ
+NJNjnJnjNJNjnj
+Ņņ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŘř
+RRRrrRrr
+Ŗŗ
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_romanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ăă
+Ââ
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÏìíïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Îî
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŤť
+Ţţ
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovenian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+CHChcHch
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_polish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂăǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ąą
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĈĉĊċČč
+CHChcHch
+Ćć
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĚě
+Ęę
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ńń
+Ŋŋ
+OoÒÔÕÖòôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Óó
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŜŝŞşŠšſ
+SSSssSssß
+Śś
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŽž
+Źź
+Żż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_estonian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdz
+DŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔòóôŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+Zz
+Žž
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Õõ
+Ää
+Öö
+Üü
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ŹźŻż
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_swedish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Åå
+ÄÆäæ
+ÖØöø
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_turkish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcĆćĈĉĊċČč
+CHChcHch
+Çç
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĠġĢģǦǧǴǵ
+Ğğ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+Iı
+IJIj
+ƕǶ
+Ħħ
+iÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+iJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Öö
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŠšſ
+SSSssSssß
+Şş
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Üü
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_czech_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗ
+RRRrrRrr
+Řř
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_danish_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
+aA
+ǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ǿǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÜÝüýÿŰűŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+ÄÆäæ
+ÖØöøŐő
+AAAaaaÅå
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_lithuanian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CCHChcchÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IYiyÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+ÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovak_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+Ää
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċ
+cH
+Čč
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+CHChch
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÕÖòóõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+Ôô
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşſ
+SSSssSssß
+Šš
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻż
+Žž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish2_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+cH
+CHChch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+lL
+LLLlll
+Łł
+Mm
+NnŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ññ
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_roman_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IJijÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJij
+IJij
+Ĵĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJlj
+LJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnj
+NJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+ÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+UVuv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_esperanto_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĊċČč
+CHChcHch
+Ĉĉ
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĞğĠġĢģǦǧǴǵ
+Ĝĝ
+Ǥǥ
+Ƣƣ
+Hh
+Ĥĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+Jjǰ
+Ĵĵ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŞşŠšſ
+SSSssSssß
+Ŝŝ
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛÜùúûüŨũŪūŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
+Ŭŭ
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_hungarian_ci;
+group_concat(c1 order by binary c1 separator '')
+AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
+AAAaaAaa
+ÆæǢǣǼǽ
+Bb
+Ƃƃ
+CcÇçĆćĈĉĊċČč
+CHChcHch
+Ƈƈ
+DdĎď
+DZDzdZdzDŽDždžDZDzdz
+Đđ
+Ƌƌ
+Ðð
+EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
+Ǝǝ
+Ff
+Ƒƒ
+GgĜĝĞğĠġĢģǦǧǴǵ
+Ǥǥ
+Ƣƣ
+HhĤĥ
+ƕǶ
+Ħħ
+IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
+IJIjiJijIJij
+JjĴĵǰ
+KkĶķǨǩ
+Ƙƙ
+LlĹĺĻļĽľ
+Ŀŀ
+LJLjlJljLJLjlj
+LLLllLll
+Łł
+Mm
+NnÑñŃńŅņŇňǸǹ
+NJNjnJnjNJNjnj
+Ŋŋ
+OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
+OEOeoEoeŒœ
+ÖöŐő
+ØøǾǿ
+Pp
+Ƥƥ
+Qq
+RrŔŕŖŗŘř
+RRRrrRrr
+SsŚśŜŝŞşŠšſ
+SSSssSssß
+TtŢţŤť
+Ŧŧ
+Ƭƭ
+UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
+ÜüŰű
+Vv
+WwŴŵ
+Xx
+YyÝýÿŶŷŸ
+Ƴƴ
+ZzŹźŻżŽž
+Ƶƶ
+ƷǮǯ
+Ƹƹ
+Þþ
+ƿǷ
+Ƨƨ
+Ƽƽ
+Ƅƅ
+drop table t1;
+SET NAMES utf8;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_general_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025
+COLLATE utf32_general_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4);
+SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025
+COLLATE utf32_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
+SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32) COLLATE utf32_unicode_ci;
+c
+Μωδαί̈
+INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
+SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32)
+COLLATE utf32_unicode_ci ORDER BY c;
+c
+Μωδ
+Μωδαί̈
+DROP TABLE t1;
+SET NAMES utf8;
+SET @test_character_set='utf32';
+SET @test_collation='utf32_swedish_ci';
+SET @safe_character_set_server= @@character_set_server;
+SET @safe_collation_server= @@collation_server;
+SET character_set_server= @test_character_set;
+SET collation_server= @test_collation;
+CREATE DATABASE d1;
+USE d1;
+CREATE TABLE t1 (c CHAR(10), KEY(c));
+SHOW FULL COLUMNS FROM t1;
+Field	Type	Collation	Null	Key	Default	Extra	Privileges	Comment
+c	char(10)	utf32_swedish_ci	YES	MUL	NULL			
+INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
+SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
+want3results
+aaa
+aaaa
+aaaaa
+DROP TABLE t1;
+CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
+SHOW FULL COLUMNS FROM t1;
+Field	Type	Collation	Null	Key	Default	Extra	Privileges	Comment
+c1	varchar(15)	utf32_swedish_ci	YES	MUL	NULL			
+INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
+SELECT c1 as want3results from t1 where c1 like 'l%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want3results from t1 where c1 like 'lo%';
+want3results
+location
+loberge
+lotre
+SELECT c1 as want1result  from t1 where c1 like 'loc%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'loca%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'locat%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'locati%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'locatio%';
+want1result
+location
+SELECT c1 as want1result  from t1 where c1 like 'location%';
+want1result
+location
+DROP TABLE t1;
+DROP DATABASE d1;
+USE test;
+SET character_set_server= @safe_character_set_server;
+SET collation_server= @safe_collation_server;
+SET collation_connection='utf32_unicode_ci';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a)	hex(a)
+utf32_unicode_ci	0000006100000009
+utf32_unicode_ci	00000061
+utf32_unicode_ci	0000006100000020
+drop table t1;
+select @@collation_connection;
+@@collation_connection
+utf32_unicode_ci
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+select c1 as c1u from t1 where c1 like 'ab\_def';
+c1u
+ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+c2h
+ab_def
+drop table t1;
+End of 4.1 tests
+CREATE TABLE t1 (id int, a varchar(30) character set utf32);
+INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131);
+INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049);
+INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049);
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a	la	l	ll	u	lu
+ıi	8	ıi	8	II	8
+ıı	8	ıı	8	II	8
+ii	8	ii	8	II	8
+İI	8	ii	8	İI	8
+İİ	8	ii	8	İİ	8
+II	8	ii	8	II	8
+ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf32 collate utf32_turkish_ci;
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+a	la	l	ll	u	lu
+ıi	8	ıi	8	Iİ	8
+ıı	8	ıı	8	II	8
+ii	8	ii	8	İİ	8
+İI	8	iı	8	İI	8
+İİ	8	ii	8	İİ	8
+II	8	ıı	8	II	8
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 text character set utf32 collate utf32_polish_ci NOT NULL
+) ENGINE=MyISAM;
+insert into t1 values (''),('a');
+SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
+COUNT(*)	c1
+1	
+1	a
+DROP TABLE IF EXISTS t1;
+End of 5.1 tests
+set collation_connection=utf32_unicode_ci;
+select @@collation_connection;
+@@collation_connection
+utf32_unicode_ci
+select hex(weight_string('a'));
+hex(weight_string('a'))
+0E33
+select hex(weight_string('A'));
+hex(weight_string('A'))
+0E33
+select hex(weight_string('abc'));
+hex(weight_string('abc'))
+0E330E4A0E60
+select hex(weight_string('abc' as char(2)));
+hex(weight_string('abc' as char(2)))
+0E330E4A
+select hex(weight_string('abc' as char(3)));
+hex(weight_string('abc' as char(3)))
+0E330E4A0E60
+select hex(weight_string('abc' as char(5)));
+hex(weight_string('abc' as char(5)))
+0E330E4A0E6002090209
+select hex(weight_string(_utf32 0x10000 collate utf32_unicode_ci));
+hex(weight_string(_utf32 0x10000 collate utf32_unicode_ci))
+0DC6
+select hex(weight_string(_utf32 0x10001 collate utf32_unicode_ci));
+hex(weight_string(_utf32 0x10001 collate utf32_unicode_ci))
+0DC6
+select @@collation_connection;
+@@collation_connection
+utf32_unicode_ci
+select hex(weight_string('a' LEVEL 1));
+hex(weight_string('a' LEVEL 1))
+0E33
+select hex(weight_string('A' LEVEL 1));
+hex(weight_string('A' LEVEL 1))
+0E33
+select hex(weight_string('abc' LEVEL 1));
+hex(weight_string('abc' LEVEL 1))
+0E330E4A0E60
+select hex(weight_string('abc' as char(2) LEVEL 1));
+hex(weight_string('abc' as char(2) LEVEL 1))
+0E330E4A
+select hex(weight_string('abc' as char(3) LEVEL 1));
+hex(weight_string('abc' as char(3) LEVEL 1))
+0E330E4A0E60
+select hex(weight_string('abc' as char(5) LEVEL 1));
+hex(weight_string('abc' as char(5) LEVEL 1))
+0E330E4A0E6002090209
+select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
+09020902600E4A0E330E
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC))
+F1CCF1B5F19FFDF6FDF6
+select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
+hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
+F6FDF6FD9FF1B5F1CCF1
+set @@collation_connection=utf32_czech_ci;
+select @@collation_connection;
+@@collation_connection
+utf32_czech_ci
+select collation(cast(_latin1 0xDF as char));
+collation(cast(_latin1 0xDF as char))
+utf32_czech_ci
+select hex(weight_string('s'));
+hex(weight_string('s'))
+0FEA
+select hex(weight_string(cast(_latin1 0xDF as char)));
+hex(weight_string(cast(_latin1 0xDF as char)))
+0FEA0FEA
+select hex(weight_string(cast(_latin1 0xDF as char) as char(1)));
+hex(weight_string(cast(_latin1 0xDF as char) as char(1)))
+0FEA
+select hex(weight_string('c'));
+hex(weight_string('c'))
+0E60
+select hex(weight_string('h'));
+hex(weight_string('h'))
+0EE1
+select hex(weight_string('ch'));
+hex(weight_string('ch'))
+0EE2
+select hex(weight_string('i'));
+hex(weight_string('i'))
+0EFB
+select hex(weight_string(cast(_latin1 0x6368DF as char)));
+hex(weight_string(cast(_latin1 0x6368DF as char)))
+0EE20FEA0FEA
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(1)))
+0EE2
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(2)))
+0EE20FEA
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(3)))
+0EE20FEA0FEA
+select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4)));
+hex(weight_string(cast(_latin1 0x6368DF as char) as char(4)))
+0EE20FEA0FEA0209
+select hex(weight_string(cast(_latin1 0xDF6368 as char)));
+hex(weight_string(cast(_latin1 0xDF6368 as char)))
+0FEA0FEA0EE2
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1)))
+0FEA
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2)))
+0FEA0FEA
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3)))
+0FEA0FEA0EE2
+select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4)));
+hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4)))
+0FEA0FEA0EE20209
+End of 5.2 tests
diff -Nrup a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
--- a/mysql-test/r/ctype_utf8.result	2007-08-31 03:41:06 +05:00
+++ b/mysql-test/r/ctype_utf8.result	2007-09-12 17:41:14 +05:00
@@ -241,7 +241,7 @@ hex(s1)
 41
 drop table t1;
 create table t1 (a text character set utf8, primary key(a(360)));
-ERROR 42000: Specified key was too long; max key length is 1000 bytes
+ERROR 42000: Specified key was too long; max key length is 1332 bytes
 CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8;
 INSERT INTO t1 VALUES ( 'test' );
 SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a;
@@ -318,9 +318,9 @@ create table t1 (c varchar(30) character
 insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
 insert into t1 values ('aaaaaaaaaa');
 insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
 insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
 insert into t1 values (repeat('b',20));
 select c c1 from t1 where c='1';
 c1
@@ -351,9 +351,9 @@ create table t1 (c varchar(30) character
 insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
 insert into t1 values ('aaaaaaaaaa');
 insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
 insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
 insert into t1 values (repeat('b',20));
 select c c1 from t1 where c='1';
 c1
@@ -385,19 +385,19 @@ insert into t1 values ('1'),('2'),('3'),
 insert into t1 values ('a');
 insert into t1 values ('aa');
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
 insert into t1 values ('b');
 insert into t1 values ('bb');
 insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
 insert into t1 values ('а');
 insert into t1 values ('аа');
 insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
 insert into t1 values ('б');
 insert into t1 values ('бб');
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
 insert into t1 values ('ꪪ');
 insert into t1 values ('ꪪꪪ');
 insert into t1 values ('ꪪꪪꪪ');
@@ -408,19 +408,19 @@ insert into t1 values ('1'),('2'),('3'),
 insert into t1 values ('a');
 insert into t1 values ('aa');
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
 insert into t1 values ('b');
 insert into t1 values ('bb');
 insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
 insert into t1 values ('а');
 insert into t1 values ('аа');
 insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
 insert into t1 values ('б');
 insert into t1 values ('бб');
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
 insert into t1 values ('ꪪ');
 insert into t1 values ('ꪪꪪ');
 insert into t1 values ('ꪪꪪꪪ');
@@ -438,14 +438,14 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MEMORY DEFAULT CHARSET=latin1
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('б');
 insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 select c as c_all from t1 order by c;
 c_all
 a
@@ -474,14 +474,14 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MEMORY DEFAULT CHARSET=latin1
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('б');
 insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 select c as c_all from t1 order by c;
 c_all
 a
@@ -504,14 +504,14 @@ unique key a (c(1))
 ) engine=innodb;
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('б');
 insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 select c as c_all from t1 order by c;
 c_all
 a
@@ -532,9 +532,9 @@ create table t1 (c varchar(30) character
 insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
 insert into t1 values ('aaaaaaaaaa');
 insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
 insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
 insert into t1 values (repeat('b',20));
 select c c1 from t1 where c='1';
 c1
@@ -566,19 +566,19 @@ insert into t1 values ('1'),('2'),('3'),
 insert into t1 values ('a');
 insert into t1 values ('aa');
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
 insert into t1 values ('b');
 insert into t1 values ('bb');
 insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
 insert into t1 values ('а');
 insert into t1 values ('аа');
 insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
 insert into t1 values ('б');
 insert into t1 values ('бб');
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
 insert into t1 values ('ꪪ');
 insert into t1 values ('ꪪꪪ');
 insert into t1 values ('ꪪꪪꪪ');
@@ -596,14 +596,14 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MEMORY DEFAULT CHARSET=latin1
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('б');
 insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 select c as c_all from t1 order by c;
 c_all
 a
@@ -632,14 +632,14 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MEMORY DEFAULT CHARSET=latin1
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('б');
 insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 select c as c_all from t1 order by c;
 c_all
 a
@@ -662,14 +662,14 @@ unique key a (c(1))
 ) engine=innodb;
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
 insert into t1 values ('б');
 insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'б' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
 select c as c_all from t1 order by c;
 c_all
 a
@@ -1337,10 +1337,10 @@ Kali Kali 2+4
 Kali Kali 2+4
 EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	a	a	40	NULL	4	Using where; Using index
+1	SIMPLE	t1	range	a	a	53	NULL	4	Using where; Using index
 EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ref	a	a	40	const	4	Using where; Using index
+1	SIMPLE	t1	ref	a	a	53	const	4	Using where; Using index
 EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	range	a	a	14	NULL	4	Using where; Using index
@@ -1964,4 +1964,12 @@ predicted_order	hex(utf8_encoding)
 100	E0B78AE2808DE0B6BA
 101	E0B78AE2808DE0B6BB
 DROP TABLE t1;
+CREATE DATABASE `𐀀`;
+ERROR HY000: Invalid identifier character string: '𐀀'
+CREATE TABLE `𐀀` (a int);
+ERROR HY000: Invalid identifier character string: '𐀀'
+CREATE TABLE test.t1 SELECT '𐀀';
+ERROR 42000: Incorrect column name '𐀀'
+CREATE USER `𐀀`;
+ERROR HY000: Invalid identifier character string: '𐀀'
 End of tests
diff -Nrup a/mysql-test/r/explain.result b/mysql-test/r/explain.result
--- a/mysql-test/r/explain.result	2007-04-04 23:51:42 +05:00
+++ b/mysql-test/r/explain.result	2007-09-12 17:41:14 +05:00
@@ -87,3 +87,19 @@ Warnings:
 Note	1003	select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1
 drop view v1;
 drop table t1;
+End of 5.0 tests.
+explain select 1;
+Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
+def					id	8	3	1	N	32929	0	63
+def					select_type	253	19	6	N	1	31	8
+def					table	253	64	0	Y	0	31	8
+def					type	253	10	0	Y	0	31	8
+def					possible_keys	253	4096	0	Y	0	31	8
+def					key	253	64	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
+def					ref	253	1024	0	Y	0	31	8
+def					rows	8	10	0	Y	32928	0	63
+def					Extra	253	255	14	N	1	31	8
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
+End of 5.2 tests.
diff -Nrup a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
--- a/mysql-test/r/group_by.result	2007-08-26 11:11:29 +05:00
+++ b/mysql-test/r/group_by.result	2007-09-12 17:41:14 +05:00
@@ -696,7 +696,7 @@ from t1 x3, t1 x4, t1 C, t1 D where x3.a
 delete from t2  where a = 2 and b = 'val-2' order by a,b,c,d limit 30;
 explain select c from t2 where a = 2 and b = 'val-2' group by c;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t2	ref	PRIMARY,a	PRIMARY	402	const,const	6	Using where
+1	SIMPLE	t2	ref	PRIMARY,a	PRIMARY	534	const,const	6	Using where
 select c from t2 where a = 2 and b = 'val-2' group by c;
 c
 val-74
diff -Nrup a/mysql-test/r/have_utf16.require b/mysql-test/r/have_utf16.require
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/have_utf16.require	2007-09-12 17:41:17 +05:00
@@ -0,0 +1,2 @@
+Collation	Charset	Id	Default	Compiled	Sortlen
+utf16_general_ci	utf16	54	Yes	Yes	1
diff -Nrup a/mysql-test/r/have_utf32.require b/mysql-test/r/have_utf32.require
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/have_utf32.require	2007-09-12 17:41:17 +05:00
@@ -0,0 +1,2 @@
+Collation	Charset	Id	Default	Compiled	Sortlen
+utf32_general_ci	utf32	60	Yes	Yes	1
diff -Nrup a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
--- a/mysql-test/r/information_schema.result	2007-08-26 16:31:07 +05:00
+++ b/mysql-test/r/information_schema.result	2007-09-12 17:41:14 +05:00
@@ -1139,8 +1139,8 @@ default character set utf8;
 select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
 information_schema.columns where table_schema='test' and table_name = 't1';
 CHARACTER_MAXIMUM_LENGTH	CHARACTER_OCTET_LENGTH
-1	3
-9	27
+1	4
+9	36
 drop table t1;
 use mysql;
 INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL',
diff -Nrup a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
--- a/mysql-test/r/innodb_mysql.result	2007-08-26 16:31:07 +05:00
+++ b/mysql-test/r/innodb_mysql.result	2007-09-12 17:41:14 +05:00
@@ -1120,7 +1120,7 @@ show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` text,
-  KEY `a` (`a`(255))
+  KEY `a` (`a`(191))
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8
 drop table t1;
 CREATE TABLE t1 (
diff -Nrup a/mysql-test/r/join.result b/mysql-test/r/join.result
--- a/mysql-test/r/join.result	2007-07-12 16:47:59 +05:00
+++ b/mysql-test/r/join.result	2007-09-12 17:41:14 +05:00
@@ -750,8 +750,8 @@ ERROR 42S22: Unknown column 't1.b' in 'o
 select * from information_schema.statistics join information_schema.columns
 using(table_name,column_name) where table_name='user';
 TABLE_NAME	COLUMN_NAME	TABLE_CATALOG	TABLE_SCHEMA	NON_UNIQUE	INDEX_SCHEMA	INDEX_NAME	SEQ_IN_INDEX	COLLATION	CARDINALITY	SUB_PART	PACKED	NULLABLE	INDEX_TYPE	COMMENT	INDEX_COMMENT	TABLE_CATALOG	TABLE_SCHEMA	ORDINAL_POSITION	COLUMN_DEFAULT	IS_NULLABLE	DATA_TYPE	CHARACTER_MAXIMUM_LENGTH	CHARACTER_OCTET_LENGTH	NUMERIC_PRECISION	NUMERIC_SCALE	CHARACTER_SET_NAME	COLLATION_NAME	COLUMN_TYPE	COLUMN_KEY	EXTRA	PRIVILEGES	COLUMN_COMMENT	STORAGE	FORMAT
-user	Host	NULL	mysql	0	mysql	PRIMARY	1	A	NULL	NULL	NULL		BTREE			NULL	mysql	1		NO	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)	PRI	#	select,insert,update,references		Default	Default
-user	User	NULL	mysql	0	mysql	PRIMARY	2	A	3	NULL	NULL		BTREE			NULL	mysql	2		NO	char	16	48	NULL	NULL	utf8	utf8_bin	char(16)	PRI	#	select,insert,update,references		Default	Default
+user	Host	NULL	mysql	0	mysql	PRIMARY	1	A	NULL	NULL	NULL		BTREE			NULL	mysql	1		NO	char	60	240	NULL	NULL	utf8	utf8_bin	char(60)	PRI	#	select,insert,update,references		Default	Default
+user	User	NULL	mysql	0	mysql	PRIMARY	2	A	3	NULL	NULL		BTREE			NULL	mysql	2		NO	char	16	64	NULL	NULL	utf8	utf8_bin	char(16)	PRI	#	select,insert,update,references		Default	Default
 drop table t1;
 drop table t2;
 drop table t3;
diff -Nrup a/mysql-test/r/key.result b/mysql-test/r/key.result
--- a/mysql-test/r/key.result	2007-06-30 21:07:27 +05:00
+++ b/mysql-test/r/key.result	2007-09-12 17:41:14 +05:00
@@ -251,13 +251,13 @@ insert t1 values ('cccc', 'tttt'),
 (0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1),
 (0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1);
 insert t1 (c) values ('cc22');
-ERROR 23000: Duplicate entry 'cc22' for key 'c'
+ERROR 23000: Duplicate entry 'cc' for key 'c'
 insert t1 (t) values ('ttt22');
-ERROR 23000: Duplicate entry 'ttt22' for key 't'
+ERROR 23000: Duplicate entry 'ttt' for key 't'
 insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1);
-ERROR 23000: Duplicate entry 'б!#"' for key 'c'
+ERROR 23000: Duplicate entry 'б!' for key 'c'
 insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1);
-ERROR 23000: Duplicate entry 'бб!#"б' for key 't'
+ERROR 23000: Duplicate entry 'бб!' for key 't'
 select c from t1 where c='cccc';
 c
 cccc
diff -Nrup a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result
--- a/mysql-test/r/mix2_myisam.result	2007-06-27 22:47:51 +05:00
+++ b/mysql-test/r/mix2_myisam.result	2007-09-12 17:41:14 +05:00
@@ -1979,7 +1979,7 @@ a	b
 drop table t1;
 create table t1 (v varchar(65530), key(v));
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 drop table t1;
 create table t1 (v varchar(65536));
 Warnings:
diff -Nrup a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
--- a/mysql-test/r/myisam.result	2007-06-27 22:47:51 +05:00
+++ b/mysql-test/r/myisam.result	2007-09-12 17:41:14 +05:00
@@ -322,11 +322,11 @@ CHECK TABLE t1;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 drop table t1;
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e));
-ERROR 42000: Specified key was too long; max key length is 1000 bytes
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255));
+CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300), KEY t1 (a, b, c, d, e));
+ERROR 42000: Specified key was too long; max key length is 1332 bytes
+CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300));
 ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
-ERROR 42000: Specified key was too long; max key length is 1000 bytes
+ERROR 42000: Specified key was too long; max key length is 1332 bytes
 DROP TABLE t1;
 CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
 INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
@@ -1668,7 +1668,7 @@ a	b
 drop table t1;
 create table t1 (v varchar(65530), key(v));
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 drop table if exists t1;
 create table t1 (v varchar(65536));
 Warnings:
@@ -1813,34 +1813,34 @@ t1	CREATE TABLE `t1` (
 drop table t1;
 create table t1 (a varchar(2048), key `a` (a));
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` varchar(2048) DEFAULT NULL,
-  KEY `a` (`a`(1000))
+  KEY `a` (`a`(1332))
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 create table t1 (a varchar(2048), key `a` (a) key_block_size=1024);
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` varchar(2048) DEFAULT NULL,
-  KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=4096
+  KEY `a` (`a`(1332)) KEY_BLOCK_SIZE=6144
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024;
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` int(11) NOT NULL,
   `b` varchar(2048) DEFAULT NULL,
   KEY `a` (`a`),
-  KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096
+  KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=6144
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024
 alter table t1 key_block_size=2048;
 show create table t1;
@@ -1849,7 +1849,7 @@ t1	CREATE TABLE `t1` (
   `a` int(11) NOT NULL,
   `b` varchar(2048) DEFAULT NULL,
   KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
-  KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096
+  KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=6144
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2048
 alter table t1 add c int, add key (c);
 show create table t1;
@@ -1859,7 +1859,7 @@ t1	CREATE TABLE `t1` (
   `b` varchar(2048) DEFAULT NULL,
   `c` int(11) DEFAULT NULL,
   KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
-  KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096,
+  KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=8192,
   KEY `c` (`c`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2048
 alter table t1 key_block_size=0;
@@ -1872,33 +1872,33 @@ t1	CREATE TABLE `t1` (
   `c` int(11) DEFAULT NULL,
   `d` int(11) DEFAULT NULL,
   KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
-  KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096,
+  KEY `b` (`b`(1332)) KEY_BLOCK_SIZE=8192,
   KEY `c` (`c`) KEY_BLOCK_SIZE=2048,
   KEY `d` (`d`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192;
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` int(11) NOT NULL,
   `b` varchar(2048) DEFAULT NULL,
   KEY `a` (`a`),
-  KEY `b` (`b`(1000))
+  KEY `b` (`b`(1332))
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
 drop table t1;
 create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192;
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` int(11) NOT NULL,
   `b` varchar(2048) DEFAULT NULL,
   KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
-  KEY `b` (`b`(1000))
+  KEY `b` (`b`(1332))
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
 drop table t1;
 create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384;
@@ -1921,12 +1921,12 @@ t1	CREATE TABLE `t1` (
 drop table t1;
 create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` varchar(2048) DEFAULT NULL,
-  KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=4096
+  KEY `a` (`a`(1332)) KEY_BLOCK_SIZE=6144
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 create table t1 (a int not null, key `a` (a) key_block_size=1025);
diff -Nrup a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
--- a/mysql-test/r/ps_1general.result	2007-07-06 15:19:41 +05:00
+++ b/mysql-test/r/ps_1general.result	2007-09-12 17:41:14 +05:00
@@ -442,7 +442,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
-def					key_len	253	1365	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	14	N	1	31	8
@@ -458,7 +458,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	5	Y	0	31	8
 def					possible_keys	253	4096	7	Y	0	31	8
 def					key	253	64	7	Y	0	31	8
-def					key_len	253	1365	1	Y	0	31	8
+def					key_len	253	320	1	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	48	N	1	31	8
diff -Nrup a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
--- a/mysql-test/r/ps_2myisam.result	2007-07-06 15:19:41 +05:00
+++ b/mysql-test/r/ps_2myisam.result	2007-09-12 17:41:14 +05:00
@@ -1160,7 +1160,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
-def					key_len	253	1365	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
diff -Nrup a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
--- a/mysql-test/r/ps_3innodb.result	2007-07-02 02:46:51 +05:00
+++ b/mysql-test/r/ps_3innodb.result	2007-09-12 17:41:14 +05:00
@@ -1158,7 +1158,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
-def					key_len	253	1365	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
diff -Nrup a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
--- a/mysql-test/r/ps_4heap.result	2007-07-02 02:46:51 +05:00
+++ b/mysql-test/r/ps_4heap.result	2007-09-12 17:41:14 +05:00
@@ -1159,7 +1159,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
-def					key_len	253	1365	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
diff -Nrup a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
--- a/mysql-test/r/ps_5merge.result	2007-07-02 02:46:51 +05:00
+++ b/mysql-test/r/ps_5merge.result	2007-09-12 17:41:14 +05:00
@@ -1201,7 +1201,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
-def					key_len	253	1365	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
@@ -4222,7 +4222,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
-def					key_len	253	1365	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
diff -Nrup a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
--- a/mysql-test/r/show_check.result	2007-08-31 03:49:09 +05:00
+++ b/mysql-test/r/show_check.result	2007-09-12 17:41:14 +05:00
@@ -12,51 +12,51 @@ insert into t1 values (1,2,2),(2,2,3),(3
 -- after Bug#29394 is implemented.
 check table t1 fast;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	5	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	27	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	5	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	27	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	Table is already up to date
 check table t1 fast;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	5	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	27	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	5	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	27	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	Table is already up to date
 check table t1 changed;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	5	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	2	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	5	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	2	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 insert into t1 values (5,5,5);
 check table t1 changed;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	5	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	2	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	5	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	2	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 check table t1 medium;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	5	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	2	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	5	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	2	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 check table t1 extended;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	5	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	2	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	5	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	2	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 show index from t1;
@@ -85,10 +85,10 @@ ERROR 23000: Duplicate entry '5' for key
 -- after Bug#29394 is implemented.
 optimize table t1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	8	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	2	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	8	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	2	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	optimize	status	OK
 optimize table t1;
@@ -101,19 +101,19 @@ drop table t1;
 show variables like "wait_timeout%";
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def			VARIABLES	VARIABLE_NAME	Variable_name	253	64	12	N	1	0	8
-def			VARIABLES	VARIABLE_VALUE	Value	253	20480	5	Y	0	0	8
+def			VARIABLES	VARIABLE_VALUE	Value	253	16300	5	Y	0	0	8
 Variable_name	Value
 wait_timeout	28800
 show variables like "WAIT_timeout%";
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def			VARIABLES	VARIABLE_NAME	Variable_name	253	64	12	N	1	0	8
-def			VARIABLES	VARIABLE_VALUE	Value	253	20480	5	Y	0	0	8
+def			VARIABLES	VARIABLE_VALUE	Value	253	16300	5	Y	0	0	8
 Variable_name	Value
 wait_timeout	28800
 show variables like "this_doesn't_exists%";
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def			VARIABLES	VARIABLE_NAME	Variable_name	253	64	0	N	1	0	8
-def			VARIABLES	VARIABLE_VALUE	Value	253	20480	0	Y	0	0	8
+def			VARIABLES	VARIABLE_VALUE	Value	253	16300	0	Y	0	0	8
 Variable_name	Value
 show table status from test like "this_doesn't_exists%";
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
@@ -155,10 +155,10 @@ insert into t1 values (1,1,1,0),(1,1,2,0
 -- after Bug#29394 is implemented.
 analyze table t1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	7	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	2	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	7	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	2	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	analyze	status	OK
 show index from t1;
@@ -172,10 +172,10 @@ t1	0	PRIMARY	4	f4	A	18	NULL	NULL		BTREE	
 -- after Bug#29394 is implemented.
 repair table t1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	42	7	Y	0	31	8
-def					Op	253	3	6	Y	0	31	8
-def					Msg_type	253	3	6	Y	0	31	8
-def					Msg_text	253	85	2	Y	0	31	8
+def					Table	253	128	7	Y	0	31	8
+def					Op	253	10	6	Y	0	31	8
+def					Msg_type	253	10	6	Y	0	31	8
+def					Msg_text	253	255	2	Y	0	31	8
 Table	Op	Msg_type	Msg_text
 test.t1	repair	status	OK
 show index from t1;
@@ -868,41 +868,41 @@ set names utf8;
 ----------------------------------------------------------------
 SHOW CHARACTER SET LIKE 'utf8';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			CHARACTER_SETS	CHARACTER_SET_NAME	Charset	253	192	4	N	1	0	33
-def			CHARACTER_SETS	DESCRIPTION	Description	253	180	13	N	1	0	33
-def			CHARACTER_SETS	DEFAULT_COLLATE_NAME	Default collation	253	192	15	N	1	0	33
+def			CHARACTER_SETS	CHARACTER_SET_NAME	Charset	253	256	4	N	1	0	45
+def			CHARACTER_SETS	DESCRIPTION	Description	253	240	13	N	1	0	45
+def			CHARACTER_SETS	DEFAULT_COLLATE_NAME	Default collation	253	256	15	N	1	0	45
 def			CHARACTER_SETS	MAXLEN	Maxlen	8	3	1	N	32769	0	63
 Charset	Description	Default collation	Maxlen
-utf8	UTF-8 Unicode	utf8_general_ci	3
+utf8	UTF-8 Unicode	utf8_general_ci	4
 ----------------------------------------------------------------
 SHOW COLLATION LIKE 'latin1_bin';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			COLLATIONS	COLLATION_NAME	Collation	253	192	10	N	1	0	33
-def			COLLATIONS	CHARACTER_SET_NAME	Charset	253	192	6	N	1	0	33
+def			COLLATIONS	COLLATION_NAME	Collation	253	256	10	N	1	0	45
+def			COLLATIONS	CHARACTER_SET_NAME	Charset	253	256	6	N	1	0	45
 def			COLLATIONS	ID	Id	8	11	2	N	32769	0	63
-def			COLLATIONS	IS_DEFAULT	Default	253	9	0	N	1	0	33
-def			COLLATIONS	IS_COMPILED	Compiled	253	9	3	N	1	0	33
+def			COLLATIONS	IS_DEFAULT	Default	253	12	0	N	1	0	45
+def			COLLATIONS	IS_COMPILED	Compiled	253	12	3	N	1	0	45
 def			COLLATIONS	SORTLEN	Sortlen	8	3	1	N	32769	0	63
 Collation	Charset	Id	Default	Compiled	Sortlen
 latin1_bin	latin1	47		Yes	1
 ----------------------------------------------------------------
 SHOW CREATE DATABASE mysqltest1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Database	253	63	10	N	1	31	33
-def					Create Database	253	1023	69	N	1	31	33
+def					Database	253	64	10	N	1	31	45
+def					Create Database	253	1024	69	N	1	31	45
 Database	Create Database
 mysqltest1	CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */
 ----------------------------------------------------------------
 SHOW DATABASES LIKE 'mysqltest1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			SCHEMATA	SCHEMA_NAME	Database (mysqltest1)	253	192	10	N	1	0	33
+def			SCHEMATA	SCHEMA_NAME	Database (mysqltest1)	253	256	10	N	1	0	45
 Database (mysqltest1)
 mysqltest1
 ----------------------------------------------------------------
 SHOW CREATE TABLE t1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Table	253	63	2	N	1	31	33
-def					Create Table	253	1023	102	N	1	31	33
+def					Table	253	64	2	N	1	31	45
+def					Create Table	253	1024	102	N	1	31	45
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `c` int(11) NOT NULL,
@@ -911,19 +911,19 @@ t1	CREATE TABLE `t1` (
 ----------------------------------------------------------------
 SHOW INDEX FROM t1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			STATISTICS	TABLE_NAME	Table	253	192	2	N	1	0	33
+def			STATISTICS	TABLE_NAME	Table	253	256	2	N	1	0	45
 def			STATISTICS	NON_UNIQUE	Non_unique	8	1	1	N	32769	0	63
-def			STATISTICS	INDEX_NAME	Key_name	253	192	7	N	1	0	33
+def			STATISTICS	INDEX_NAME	Key_name	253	256	7	N	1	0	45
 def			STATISTICS	SEQ_IN_INDEX	Seq_in_index	8	2	1	N	32769	0	63
-def			STATISTICS	COLUMN_NAME	Column_name	253	192	1	N	1	0	33
-def			STATISTICS	COLLATION	Collation	253	3	1	Y	0	0	33
+def			STATISTICS	COLUMN_NAME	Column_name	253	256	1	N	1	0	45
+def			STATISTICS	COLLATION	Collation	253	4	1	Y	0	0	45
 def			STATISTICS	CARDINALITY	Cardinality	8	21	1	Y	32768	0	63
 def			STATISTICS	SUB_PART	Sub_part	8	3	0	Y	32768	0	63
-def			STATISTICS	PACKED	Packed	253	30	0	Y	0	0	33
-def			STATISTICS	NULLABLE	Null	253	9	0	N	1	0	33
-def			STATISTICS	INDEX_TYPE	Index_type	253	48	5	N	1	0	33
-def			STATISTICS	COMMENT	Comment	253	48	0	Y	0	0	33
-def			STATISTICS	INDEX_COMMENT	Index_Comment	253	3072	0	N	1	0	33
+def			STATISTICS	PACKED	Packed	253	40	0	Y	0	0	45
+def			STATISTICS	NULLABLE	Null	253	12	0	N	1	0	45
+def			STATISTICS	INDEX_TYPE	Index_type	253	64	5	N	1	0	45
+def			STATISTICS	COMMENT	Comment	253	64	0	Y	0	0	45
+def			STATISTICS	INDEX_COMMENT	Index_Comment	253	4096	0	N	1	0	45
 Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
 t1	0	PRIMARY	1	c	A	0	NULL	NULL		BTREE		
 ----------------------------------------------------------------
@@ -940,15 +940,15 @@ TABLE_COMMENT
 FROM INFORMATION_SCHEMA.TABLES
 WHERE table_name = 't1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			TABLES	TABLE_CATALOG	TABLE_CATALOG	253	1536	0	Y	0	0	33
-def			TABLES	TABLE_SCHEMA	TABLE_SCHEMA	253	192	4	N	1	0	33
-def			TABLES	TABLE_NAME	TABLE_NAME	253	192	2	N	1	0	33
-def			TABLES	TABLE_TYPE	TABLE_TYPE	253	192	10	N	1	0	33
-def			TABLES	ENGINE	ENGINE	253	192	6	Y	0	0	33
-def			TABLES	ROW_FORMAT	ROW_FORMAT	253	30	5	Y	0	0	33
-def			TABLES	TABLE_COLLATION	TABLE_COLLATION	253	192	17	Y	0	0	33
-def			TABLES	CREATE_OPTIONS	CREATE_OPTIONS	253	765	0	Y	0	0	33
-def			TABLES	TABLE_COMMENT	TABLE_COMMENT	253	6144	0	N	1	0	33
+def			TABLES	TABLE_CATALOG	TABLE_CATALOG	253	2048	0	Y	0	0	45
+def			TABLES	TABLE_SCHEMA	TABLE_SCHEMA	253	256	4	N	1	0	45
+def			TABLES	TABLE_NAME	TABLE_NAME	253	256	2	N	1	0	45
+def			TABLES	TABLE_TYPE	TABLE_TYPE	253	256	10	N	1	0	45
+def			TABLES	ENGINE	ENGINE	253	256	6	Y	0	0	45
+def			TABLES	ROW_FORMAT	ROW_FORMAT	253	40	5	Y	0	0	45
+def			TABLES	TABLE_COLLATION	TABLE_COLLATION	253	256	17	Y	0	0	45
+def			TABLES	CREATE_OPTIONS	CREATE_OPTIONS	253	1020	0	Y	0	0	45
+def			TABLES	TABLE_COMMENT	TABLE_COMMENT	253	8192	0	N	1	0	45
 TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	TABLE_TYPE	ENGINE	ROW_FORMAT	TABLE_COLLATION	CREATE_OPTIONS	TABLE_COMMENT
 NULL	test	t1	BASE TABLE	MyISAM	Fixed	latin1_swedish_ci		
 ----------------------------------------------------------------
@@ -970,53 +970,53 @@ COLUMN_COMMENT
 FROM INFORMATION_SCHEMA.COLUMNS
 WHERE table_name = 't1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			COLUMNS	TABLE_CATALOG	TABLE_CATALOG	253	1536	0	Y	0	0	33
-def			COLUMNS	TABLE_SCHEMA	TABLE_SCHEMA	253	192	4	N	1	0	33
-def			COLUMNS	TABLE_NAME	TABLE_NAME	253	192	2	N	1	0	33
-def			COLUMNS	COLUMN_NAME	COLUMN_NAME	253	192	1	N	1	0	33
-def			COLUMNS	COLUMN_DEFAULT	COLUMN_DEFAULT	252	589815	0	Y	16	0	33
-def			COLUMNS	IS_NULLABLE	IS_NULLABLE	253	9	2	N	1	0	33
-def			COLUMNS	DATA_TYPE	DATA_TYPE	253	192	3	N	1	0	33
-def			COLUMNS	CHARACTER_SET_NAME	CHARACTER_SET_NAME	253	192	0	Y	0	0	33
-def			COLUMNS	COLLATION_NAME	COLLATION_NAME	253	192	0	Y	0	0	33
-def			COLUMNS	COLUMN_TYPE	COLUMN_TYPE	252	589815	7	N	17	0	33
-def			COLUMNS	COLUMN_KEY	COLUMN_KEY	253	9	3	N	1	0	33
-def			COLUMNS	EXTRA	EXTRA	253	60	0	N	1	0	33
-def			COLUMNS	PRIVILEGES	PRIVILEGES	253	240	31	N	1	0	33
-def			COLUMNS	COLUMN_COMMENT	COLUMN_COMMENT	253	3072	0	N	1	0	33
+def			COLUMNS	TABLE_CATALOG	TABLE_CATALOG	253	2048	0	Y	0	0	45
+def			COLUMNS	TABLE_SCHEMA	TABLE_SCHEMA	253	256	4	N	1	0	45
+def			COLUMNS	TABLE_NAME	TABLE_NAME	253	256	2	N	1	0	45
+def			COLUMNS	COLUMN_NAME	COLUMN_NAME	253	256	1	N	1	0	45
+def			COLUMNS	COLUMN_DEFAULT	COLUMN_DEFAULT	252	1048560	0	Y	16	0	45
+def			COLUMNS	IS_NULLABLE	IS_NULLABLE	253	12	2	N	1	0	45
+def			COLUMNS	DATA_TYPE	DATA_TYPE	253	256	3	N	1	0	45
+def			COLUMNS	CHARACTER_SET_NAME	CHARACTER_SET_NAME	253	256	0	Y	0	0	45
+def			COLUMNS	COLLATION_NAME	COLLATION_NAME	253	256	0	Y	0	0	45
+def			COLUMNS	COLUMN_TYPE	COLUMN_TYPE	252	1048560	7	N	17	0	45
+def			COLUMNS	COLUMN_KEY	COLUMN_KEY	253	12	3	N	1	0	45
+def			COLUMNS	EXTRA	EXTRA	253	80	0	N	1	0	45
+def			COLUMNS	PRIVILEGES	PRIVILEGES	253	320	31	N	1	0	45
+def			COLUMNS	COLUMN_COMMENT	COLUMN_COMMENT	253	4096	0	N	1	0	45
 TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	COLUMN_NAME	COLUMN_DEFAULT	IS_NULLABLE	DATA_TYPE	CHARACTER_SET_NAME	COLLATION_NAME	COLUMN_TYPE	COLUMN_KEY	EXTRA	PRIVILEGES	COLUMN_COMMENT
 NULL	test	t1	c	NULL	NO	int	NULL	NULL	int(11)	PRI		select,insert,update,references	
 ----------------------------------------------------------------
 SHOW TABLES LIKE 't1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			TABLE_NAMES	TABLE_NAME	Tables_in_test (t1)	253	192	2	N	1	0	33
+def			TABLE_NAMES	TABLE_NAME	Tables_in_test (t1)	253	256	2	N	1	0	45
 Tables_in_test (t1)
 t1
 ----------------------------------------------------------------
 SHOW COLUMNS FROM t1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			COLUMNS	COLUMN_NAME	Field	253	192	1	N	1	0	33
-def			COLUMNS	COLUMN_TYPE	Type	252	589815	7	N	17	0	33
-def			COLUMNS	IS_NULLABLE	Null	253	9	2	N	1	0	33
-def			COLUMNS	COLUMN_KEY	Key	253	9	3	N	1	0	33
-def			COLUMNS	COLUMN_DEFAULT	Default	252	589815	0	Y	16	0	33
-def			COLUMNS	EXTRA	Extra	253	60	0	N	1	0	33
+def			COLUMNS	COLUMN_NAME	Field	253	256	1	N	1	0	45
+def			COLUMNS	COLUMN_TYPE	Type	252	1048560	7	N	17	0	45
+def			COLUMNS	IS_NULLABLE	Null	253	12	2	N	1	0	45
+def			COLUMNS	COLUMN_KEY	Key	253	12	3	N	1	0	45
+def			COLUMNS	COLUMN_DEFAULT	Default	252	1048560	0	Y	16	0	45
+def			COLUMNS	EXTRA	Extra	253	80	0	N	1	0	45
 Field	Type	Null	Key	Default	Extra
 c	int(11)	NO	PRI		
 ----------------------------------------------------------------
 SHOW TRIGGERS LIKE 't1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			TRIGGERS	TRIGGER_NAME	Trigger	253	192	5	N	1	0	33
-def			TRIGGERS	EVENT_MANIPULATION	Event	253	18	6	N	1	0	33
-def			TRIGGERS	EVENT_OBJECT_TABLE	Table	253	192	2	N	1	0	33
-def			TRIGGERS	ACTION_STATEMENT	Statement	252	589815	10	N	17	0	33
-def			TRIGGERS	ACTION_TIMING	Timing	253	18	6	N	1	0	33
+def			TRIGGERS	TRIGGER_NAME	Trigger	253	256	5	N	1	0	45
+def			TRIGGERS	EVENT_MANIPULATION	Event	253	24	6	N	1	0	45
+def			TRIGGERS	EVENT_OBJECT_TABLE	Table	253	256	2	N	1	0	45
+def			TRIGGERS	ACTION_STATEMENT	Statement	252	1048560	10	N	17	0	45
+def			TRIGGERS	ACTION_TIMING	Timing	253	24	6	N	1	0	45
 def			TRIGGERS	CREATED	Created	12	19	0	Y	128	0	63
-def			TRIGGERS	SQL_MODE	sql_mode	252	589815	0	N	17	0	33
-def			TRIGGERS	DEFINER	Definer	252	589815	14	N	17	0	33
-def			TRIGGERS	CHARACTER_SET_CLIENT	character_set_client	253	96	6	N	1	0	33
-def			TRIGGERS	COLLATION_CONNECTION	collation_connection	253	96	6	N	1	0	33
-def			TRIGGERS	DATABASE_COLLATION	Database Collation	253	96	17	N	1	0	33
+def			TRIGGERS	SQL_MODE	sql_mode	252	1048560	0	N	17	0	45
+def			TRIGGERS	DEFINER	Definer	252	1048560	14	N	17	0	45
+def			TRIGGERS	CHARACTER_SET_CLIENT	character_set_client	253	128	6	N	1	0	45
+def			TRIGGERS	COLLATION_CONNECTION	collation_connection	253	128	6	N	1	0	45
+def			TRIGGERS	DATABASE_COLLATION	Database Collation	253	128	17	N	1	0	45
 Trigger	Event	Table	Statement	Timing	Created	sql_mode	Definer	character_set_client	collation_connection	Database Collation
 t1_bi	INSERT	t1	SET @a = 1	BEFORE	NULL		root@localhost	binary	binary	latin1_swedish_ci
 ----------------------------------------------------------------
@@ -1041,32 +1041,32 @@ DEFINER
 FROM INFORMATION_SCHEMA.TRIGGERS
 WHERE trigger_name = 't1_bi';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			TRIGGERS	TRIGGER_CATALOG	TRIGGER_CATALOG	253	1536	0	Y	0	0	33
-def			TRIGGERS	TRIGGER_SCHEMA	TRIGGER_SCHEMA	253	192	4	N	1	0	33
-def			TRIGGERS	TRIGGER_NAME	TRIGGER_NAME	253	192	5	N	1	0	33
-def			TRIGGERS	EVENT_MANIPULATION	EVENT_MANIPULATION	253	18	6	N	1	0	33
-def			TRIGGERS	EVENT_OBJECT_CATALOG	EVENT_OBJECT_CATALOG	253	1536	0	Y	0	0	33
-def			TRIGGERS	EVENT_OBJECT_SCHEMA	EVENT_OBJECT_SCHEMA	253	192	4	N	1	0	33
-def			TRIGGERS	EVENT_OBJECT_TABLE	EVENT_OBJECT_TABLE	253	192	2	N	1	0	33
-def			TRIGGERS	ACTION_CONDITION	ACTION_CONDITION	252	589815	0	Y	16	0	33
-def			TRIGGERS	ACTION_STATEMENT	ACTION_STATEMENT	252	589815	10	N	17	0	33
-def			TRIGGERS	ACTION_ORIENTATION	ACTION_ORIENTATION	253	27	3	N	1	0	33
-def			TRIGGERS	ACTION_TIMING	ACTION_TIMING	253	18	6	N	1	0	33
-def			TRIGGERS	ACTION_REFERENCE_OLD_TABLE	ACTION_REFERENCE_OLD_TABLE	253	192	0	Y	0	0	33
-def			TRIGGERS	ACTION_REFERENCE_NEW_TABLE	ACTION_REFERENCE_NEW_TABLE	253	192	0	Y	0	0	33
-def			TRIGGERS	ACTION_REFERENCE_OLD_ROW	ACTION_REFERENCE_OLD_ROW	253	9	3	N	1	0	33
-def			TRIGGERS	ACTION_REFERENCE_NEW_ROW	ACTION_REFERENCE_NEW_ROW	253	9	3	N	1	0	33
-def			TRIGGERS	SQL_MODE	SQL_MODE	252	589815	0	N	17	0	33
-def			TRIGGERS	DEFINER	DEFINER	252	589815	14	N	17	0	33
+def			TRIGGERS	TRIGGER_CATALOG	TRIGGER_CATALOG	253	2048	0	Y	0	0	45
+def			TRIGGERS	TRIGGER_SCHEMA	TRIGGER_SCHEMA	253	256	4	N	1	0	45
+def			TRIGGERS	TRIGGER_NAME	TRIGGER_NAME	253	256	5	N	1	0	45
+def			TRIGGERS	EVENT_MANIPULATION	EVENT_MANIPULATION	253	24	6	N	1	0	45
+def			TRIGGERS	EVENT_OBJECT_CATALOG	EVENT_OBJECT_CATALOG	253	2048	0	Y	0	0	45
+def			TRIGGERS	EVENT_OBJECT_SCHEMA	EVENT_OBJECT_SCHEMA	253	256	4	N	1	0	45
+def			TRIGGERS	EVENT_OBJECT_TABLE	EVENT_OBJECT_TABLE	253	256	2	N	1	0	45
+def			TRIGGERS	ACTION_CONDITION	ACTION_CONDITION	252	1048560	0	Y	16	0	45
+def			TRIGGERS	ACTION_STATEMENT	ACTION_STATEMENT	252	1048560	10	N	17	0	45
+def			TRIGGERS	ACTION_ORIENTATION	ACTION_ORIENTATION	253	36	3	N	1	0	45
+def			TRIGGERS	ACTION_TIMING	ACTION_TIMING	253	24	6	N	1	0	45
+def			TRIGGERS	ACTION_REFERENCE_OLD_TABLE	ACTION_REFERENCE_OLD_TABLE	253	256	0	Y	0	0	45
+def			TRIGGERS	ACTION_REFERENCE_NEW_TABLE	ACTION_REFERENCE_NEW_TABLE	253	256	0	Y	0	0	45
+def			TRIGGERS	ACTION_REFERENCE_OLD_ROW	ACTION_REFERENCE_OLD_ROW	253	12	3	N	1	0	45
+def			TRIGGERS	ACTION_REFERENCE_NEW_ROW	ACTION_REFERENCE_NEW_ROW	253	12	3	N	1	0	45
+def			TRIGGERS	SQL_MODE	SQL_MODE	252	1048560	0	N	17	0	45
+def			TRIGGERS	DEFINER	DEFINER	252	1048560	14	N	17	0	45
 TRIGGER_CATALOG	TRIGGER_SCHEMA	TRIGGER_NAME	EVENT_MANIPULATION	EVENT_OBJECT_CATALOG	EVENT_OBJECT_SCHEMA	EVENT_OBJECT_TABLE	ACTION_CONDITION	ACTION_STATEMENT	ACTION_ORIENTATION	ACTION_TIMING	ACTION_REFERENCE_OLD_TABLE	ACTION_REFERENCE_NEW_TABLE	ACTION_REFERENCE_OLD_ROW	ACTION_REFERENCE_NEW_ROW	SQL_MODE	DEFINER
 NULL	test	t1_bi	INSERT	NULL	test	t1	NULL	SET @a = 1	ROW	BEFORE	NULL	NULL	OLD	NEW		root@localhost
 ----------------------------------------------------------------
 SHOW CREATE VIEW v1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					View	253	63	2	N	1	31	33
-def					Create View	253	1023	103	N	1	31	33
-def					character_set_client	253	30	6	N	1	31	33
-def					collation_connection	253	30	6	N	1	31	33
+def					View	253	64	2	N	1	31	45
+def					Create View	253	1024	103	N	1	31	45
+def					character_set_client	253	32	6	N	1	31	45
+def					collation_connection	253	32	6	N	1	31	45
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1`	binary	binary
 ----------------------------------------------------------------
@@ -1074,27 +1074,27 @@ SELECT *
 FROM INFORMATION_SCHEMA.VIEWS
 WHERE table_name = 'v1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			VIEWS	TABLE_CATALOG	TABLE_CATALOG	253	1536	0	Y	0	0	33
-def			VIEWS	TABLE_SCHEMA	TABLE_SCHEMA	253	192	4	N	1	0	33
-def			VIEWS	TABLE_NAME	TABLE_NAME	253	192	2	N	1	0	33
-def			VIEWS	VIEW_DEFINITION	VIEW_DEFINITION	252	589815	8	N	17	0	33
-def			VIEWS	CHECK_OPTION	CHECK_OPTION	253	24	4	N	1	0	33
-def			VIEWS	IS_UPDATABLE	IS_UPDATABLE	253	9	2	N	1	0	33
-def			VIEWS	DEFINER	DEFINER	253	231	14	N	1	0	33
-def			VIEWS	SECURITY_TYPE	SECURITY_TYPE	253	21	7	N	1	0	33
-def			VIEWS	CHARACTER_SET_CLIENT	CHARACTER_SET_CLIENT	253	96	6	N	1	0	33
-def			VIEWS	COLLATION_CONNECTION	COLLATION_CONNECTION	253	96	6	N	1	0	33
+def			VIEWS	TABLE_CATALOG	TABLE_CATALOG	253	2048	0	Y	0	0	45
+def			VIEWS	TABLE_SCHEMA	TABLE_SCHEMA	253	256	4	N	1	0	45
+def			VIEWS	TABLE_NAME	TABLE_NAME	253	256	2	N	1	0	45
+def			VIEWS	VIEW_DEFINITION	VIEW_DEFINITION	252	1048560	8	N	17	0	45
+def			VIEWS	CHECK_OPTION	CHECK_OPTION	253	32	4	N	1	0	45
+def			VIEWS	IS_UPDATABLE	IS_UPDATABLE	253	12	2	N	1	0	45
+def			VIEWS	DEFINER	DEFINER	253	308	14	N	1	0	45
+def			VIEWS	SECURITY_TYPE	SECURITY_TYPE	253	28	7	N	1	0	45
+def			VIEWS	CHARACTER_SET_CLIENT	CHARACTER_SET_CLIENT	253	128	6	N	1	0	45
+def			VIEWS	COLLATION_CONNECTION	COLLATION_CONNECTION	253	128	6	N	1	0	45
 TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	VIEW_DEFINITION	CHECK_OPTION	IS_UPDATABLE	DEFINER	SECURITY_TYPE	CHARACTER_SET_CLIENT	COLLATION_CONNECTION
 NULL	test	v1	SELECT 1	NONE	NO	root@localhost	DEFINER	binary	binary
 ----------------------------------------------------------------
 SHOW CREATE PROCEDURE p1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Procedure	253	63	2	N	1	31	33
-def					sql_mode	253	0	0	N	1	31	33
-def					Create Procedure	253	1023	59	Y	0	31	33
-def					character_set_client	253	30	6	N	1	31	33
-def					collation_connection	253	30	6	N	1	31	33
-def					Database Collation	253	30	17	N	1	31	33
+def					Procedure	253	64	2	N	1	31	45
+def					sql_mode	253	0	0	N	1	31	45
+def					Create Procedure	253	1024	59	Y	0	31	45
+def					character_set_client	253	32	6	N	1	31	45
+def					collation_connection	253	32	6	N	1	31	45
+def					Database Collation	253	32	17	N	1	31	45
 Procedure	sql_mode	Create Procedure	character_set_client	collation_connection	Database Collation
 p1		CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
 SELECT 1	binary	binary	latin1_swedish_ci
@@ -1121,35 +1121,35 @@ DEFINER
 FROM INFORMATION_SCHEMA.ROUTINES
 WHERE routine_name = 'p1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			ROUTINES	SPECIFIC_NAME	SPECIFIC_NAME	253	192	2	N	1	0	33
-def			ROUTINES	ROUTINE_CATALOG	ROUTINE_CATALOG	253	1536	0	Y	0	0	33
-def			ROUTINES	ROUTINE_SCHEMA	ROUTINE_SCHEMA	253	192	4	N	1	0	33
-def			ROUTINES	ROUTINE_NAME	ROUTINE_NAME	253	192	2	N	1	0	33
-def			ROUTINES	ROUTINE_TYPE	ROUTINE_TYPE	253	27	9	N	1	0	33
-def			ROUTINES	DTD_IDENTIFIER	DTD_IDENTIFIER	253	192	0	Y	0	0	33
-def			ROUTINES	ROUTINE_BODY	ROUTINE_BODY	253	24	3	N	1	0	33
-def			ROUTINES	ROUTINE_DEFINITION	ROUTINE_DEFINITION	252	589815	8	Y	16	0	33
-def			ROUTINES	EXTERNAL_NAME	EXTERNAL_NAME	253	192	0	Y	0	0	33
-def			ROUTINES	EXTERNAL_LANGUAGE	EXTERNAL_LANGUAGE	253	192	0	Y	0	0	33
-def			ROUTINES	PARAMETER_STYLE	PARAMETER_STYLE	253	24	3	N	1	0	33
-def			ROUTINES	IS_DETERMINISTIC	IS_DETERMINISTIC	253	9	2	N	1	0	33
-def			ROUTINES	SQL_DATA_ACCESS	SQL_DATA_ACCESS	253	192	12	N	1	0	33
-def			ROUTINES	SQL_PATH	SQL_PATH	253	192	0	Y	0	0	33
-def			ROUTINES	SECURITY_TYPE	SECURITY_TYPE	253	21	7	N	1	0	33
-def			ROUTINES	SQL_MODE	SQL_MODE	252	589815	0	N	17	0	33
-def			ROUTINES	ROUTINE_COMMENT	ROUTINE_COMMENT	253	192	0	N	1	0	33
-def			ROUTINES	DEFINER	DEFINER	253	231	14	N	1	0	33
+def			ROUTINES	SPECIFIC_NAME	SPECIFIC_NAME	253	256	2	N	1	0	45
+def			ROUTINES	ROUTINE_CATALOG	ROUTINE_CATALOG	253	2048	0	Y	0	0	45
+def			ROUTINES	ROUTINE_SCHEMA	ROUTINE_SCHEMA	253	256	4	N	1	0	45
+def			ROUTINES	ROUTINE_NAME	ROUTINE_NAME	253	256	2	N	1	0	45
+def			ROUTINES	ROUTINE_TYPE	ROUTINE_TYPE	253	36	9	N	1	0	45
+def			ROUTINES	DTD_IDENTIFIER	DTD_IDENTIFIER	253	256	0	Y	0	0	45
+def			ROUTINES	ROUTINE_BODY	ROUTINE_BODY	253	32	3	N	1	0	45
+def			ROUTINES	ROUTINE_DEFINITION	ROUTINE_DEFINITION	252	1048560	8	Y	16	0	45
+def			ROUTINES	EXTERNAL_NAME	EXTERNAL_NAME	253	256	0	Y	0	0	45
+def			ROUTINES	EXTERNAL_LANGUAGE	EXTERNAL_LANGUAGE	253	256	0	Y	0	0	45
+def			ROUTINES	PARAMETER_STYLE	PARAMETER_STYLE	253	32	3	N	1	0	45
+def			ROUTINES	IS_DETERMINISTIC	IS_DETERMINISTIC	253	12	2	N	1	0	45
+def			ROUTINES	SQL_DATA_ACCESS	SQL_DATA_ACCESS	253	256	12	N	1	0	45
+def			ROUTINES	SQL_PATH	SQL_PATH	253	256	0	Y	0	0	45
+def			ROUTINES	SECURITY_TYPE	SECURITY_TYPE	253	28	7	N	1	0	45
+def			ROUTINES	SQL_MODE	SQL_MODE	252	1048560	0	N	17	0	45
+def			ROUTINES	ROUTINE_COMMENT	ROUTINE_COMMENT	253	256	0	N	1	0	45
+def			ROUTINES	DEFINER	DEFINER	253	308	14	N	1	0	45
 SPECIFIC_NAME	ROUTINE_CATALOG	ROUTINE_SCHEMA	ROUTINE_NAME	ROUTINE_TYPE	DTD_IDENTIFIER	ROUTINE_BODY	ROUTINE_DEFINITION	EXTERNAL_NAME	EXTERNAL_LANGUAGE	PARAMETER_STYLE	IS_DETERMINISTIC	SQL_DATA_ACCESS	SQL_PATH	SECURITY_TYPE	SQL_MODE	ROUTINE_COMMENT	DEFINER
 p1	NULL	test	p1	PROCEDURE	NULL	SQL	SELECT 1	NULL	NULL	SQL	NO	CONTAINS SQL	NULL	DEFINER			root@localhost
 ----------------------------------------------------------------
 SHOW CREATE FUNCTION f1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def					Function	253	63	2	N	1	31	33
-def					sql_mode	253	0	0	N	1	31	33
-def					Create Function	253	1023	74	Y	0	31	33
-def					character_set_client	253	30	6	N	1	31	33
-def					collation_connection	253	30	6	N	1	31	33
-def					Database Collation	253	30	17	N	1	31	33
+def					Function	253	64	2	N	1	31	45
+def					sql_mode	253	0	0	N	1	31	45
+def					Create Function	253	1024	74	Y	0	31	45
+def					character_set_client	253	32	6	N	1	31	45
+def					collation_connection	253	32	6	N	1	31	45
+def					Database Collation	253	32	17	N	1	31	45
 Function	sql_mode	Create Function	character_set_client	collation_connection	Database Collation
 f1		CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
 RETURN 1	binary	binary	latin1_swedish_ci
@@ -1176,24 +1176,24 @@ DEFINER
 FROM INFORMATION_SCHEMA.ROUTINES
 WHERE routine_name = 'f1';
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
-def			ROUTINES	SPECIFIC_NAME	SPECIFIC_NAME	253	192	2	N	1	0	33
-def			ROUTINES	ROUTINE_CATALOG	ROUTINE_CATALOG	253	1536	0	Y	0	0	33
-def			ROUTINES	ROUTINE_SCHEMA	ROUTINE_SCHEMA	253	192	4	N	1	0	33
-def			ROUTINES	ROUTINE_NAME	ROUTINE_NAME	253	192	2	N	1	0	33
-def			ROUTINES	ROUTINE_TYPE	ROUTINE_TYPE	253	27	8	N	1	0	33
-def			ROUTINES	DTD_IDENTIFIER	DTD_IDENTIFIER	253	192	7	Y	0	0	33
-def			ROUTINES	ROUTINE_BODY	ROUTINE_BODY	253	24	3	N	1	0	33
-def			ROUTINES	ROUTINE_DEFINITION	ROUTINE_DEFINITION	252	589815	8	Y	16	0	33
-def			ROUTINES	EXTERNAL_NAME	EXTERNAL_NAME	253	192	0	Y	0	0	33
-def			ROUTINES	EXTERNAL_LANGUAGE	EXTERNAL_LANGUAGE	253	192	0	Y	0	0	33
-def			ROUTINES	PARAMETER_STYLE	PARAMETER_STYLE	253	24	3	N	1	0	33
-def			ROUTINES	IS_DETERMINISTIC	IS_DETERMINISTIC	253	9	2	N	1	0	33
-def			ROUTINES	SQL_DATA_ACCESS	SQL_DATA_ACCESS	253	192	12	N	1	0	33
-def			ROUTINES	SQL_PATH	SQL_PATH	253	192	0	Y	0	0	33
-def			ROUTINES	SECURITY_TYPE	SECURITY_TYPE	253	21	7	N	1	0	33
-def			ROUTINES	SQL_MODE	SQL_MODE	252	589815	0	N	17	0	33
-def			ROUTINES	ROUTINE_COMMENT	ROUTINE_COMMENT	253	192	0	N	1	0	33
-def			ROUTINES	DEFINER	DEFINER	253	231	14	N	1	0	33
+def			ROUTINES	SPECIFIC_NAME	SPECIFIC_NAME	253	256	2	N	1	0	45
+def			ROUTINES	ROUTINE_CATALOG	ROUTINE_CATALOG	253	2048	0	Y	0	0	45
+def			ROUTINES	ROUTINE_SCHEMA	ROUTINE_SCHEMA	253	256	4	N	1	0	45
+def			ROUTINES	ROUTINE_NAME	ROUTINE_NAME	253	256	2	N	1	0	45
+def			ROUTINES	ROUTINE_TYPE	ROUTINE_TYPE	253	36	8	N	1	0	45
+def			ROUTINES	DTD_IDENTIFIER	DTD_IDENTIFIER	253	256	7	Y	0	0	45
+def			ROUTINES	ROUTINE_BODY	ROUTINE_BODY	253	32	3	N	1	0	45
+def			ROUTINES	ROUTINE_DEFINITION	ROUTINE_DEFINITION	252	1048560	8	Y	16	0	45
+def			ROUTINES	EXTERNAL_NAME	EXTERNAL_NAME	253	256	0	Y	0	0	45
+def			ROUTINES	EXTERNAL_LANGUAGE	EXTERNAL_LANGUAGE	253	256	0	Y	0	0	45
+def			ROUTINES	PARAMETER_STYLE	PARAMETER_STYLE	253	32	3	N	1	0	45
+def			ROUTINES	IS_DETERMINISTIC	IS_DETERMINISTIC	253	12	2	N	1	0	45
+def			ROUTINES	SQL_DATA_ACCESS	SQL_DATA_ACCESS	253	256	12	N	1	0	45
+def			ROUTINES	SQL_PATH	SQL_PATH	253	256	0	Y	0	0	45
+def			ROUTINES	SECURITY_TYPE	SECURITY_TYPE	253	28	7	N	1	0	45
+def			ROUTINES	SQL_MODE	SQL_MODE	252	1048560	0	N	17	0	45
+def			ROUTINES	ROUTINE_COMMENT	ROUTINE_COMMENT	253	256	0	N	1	0	45
+def			ROUTINES	DEFINER	DEFINER	253	308	14	N	1	0	45
 SPECIFIC_NAME	ROUTINE_CATALOG	ROUTINE_SCHEMA	ROUTINE_NAME	ROUTINE_TYPE	DTD_IDENTIFIER	ROUTINE_BODY	ROUTINE_DEFINITION	EXTERNAL_NAME	EXTERNAL_LANGUAGE	PARAMETER_STYLE	IS_DETERMINISTIC	SQL_DATA_ACCESS	SQL_PATH	SECURITY_TYPE	SQL_MODE	ROUTINE_COMMENT	DEFINER
 f1	NULL	test	f1	FUNCTION	int(11)	SQL	RETURN 1	NULL	NULL	SQL	NO	CONTAINS SQL	NULL	DEFINER			root@localhost
 ----------------------------------------------------------------
diff -Nrup a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
--- a/mysql-test/r/type_blob.result	2007-03-07 13:24:08 +04:00
+++ b/mysql-test/r/type_blob.result	2007-09-12 17:41:14 +05:00
@@ -357,15 +357,15 @@ a	1
 hello	1
 drop table t1;
 create table t1 (a text, unique (a(2100)));
-ERROR 42000: Specified key was too long; max key length is 1000 bytes
+ERROR 42000: Specified key was too long; max key length is 1332 bytes
 create table t1 (a text, key (a(2100)));
 Warnings:
-Warning	1071	Specified key was too long; max key length is 1000 bytes
+Warning	1071	Specified key was too long; max key length is 1332 bytes
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `a` text,
-  KEY `a` (`a`(1000))
+  KEY `a` (`a`(1332))
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 CREATE TABLE t1 (
diff -Nrup a/mysql-test/std_data/Index.xml b/mysql-test/std_data/Index.xml
--- a/mysql-test/std_data/Index.xml	2007-06-07 17:55:53 +05:00
+++ b/mysql-test/std_data/Index.xml	2007-09-12 17:41:14 +05:00
@@ -1,7 +1,7 @@
 <charsets>
 
   <charset name="utf8">
-    <collation name="utf8_test_ci" id="240">
+    <collation name="utf8_test_ci" id="253">
       <rules>
         <reset>a</reset>
         <s>b</s>
@@ -10,14 +10,34 @@
 
   </charset>
 
+  <charset name="utf16">
+    <collation name="utf16_test_ci" id="127">
+      <rules>
+        <reset>a</reset>
+        <s>b</s>
+      </rules>
+    </collation>
+  </charset>
+
+  <charset name="utf32">
+    <collation name="utf32_test_ci" id="191">
+      <rules>
+        <reset>a</reset>
+        <s>b</s>
+      </rules>
+    </collation>
+  </charset>
+
+
+
   <charset name="ucs2">
-    <collation name="ucs2_test_ci" id="241">
+    <collation name="ucs2_test_ci" id="158">
       <rules>
         <reset>a</reset>
         <s>b</s>
       </rules>
     </collation>
-    <collation name="ucs2_vn_ci" id="242">
+    <collation name="ucs2_vn_ci" id="159">
       <!-- Vietnamese experimental collation -->
       <rules>
         <reset>A</reset>
diff -Nrup a/mysql-test/suite/ndb/r/ndb_index_unique.result b/mysql-test/suite/ndb/r/ndb_index_unique.result
--- a/mysql-test/suite/ndb/r/ndb_index_unique.result	2007-07-15 21:58:34 +05:00
+++ b/mysql-test/suite/ndb/r/ndb_index_unique.result	2007-09-12 17:41:14 +05:00
@@ -678,7 +678,7 @@ select * from t1 where code = '12' and m
 id	month	year	code
 1	4	2004	12
 drop table t1;
-create table t1 (a int primary key, b varchar(1000) not null, unique key (b))
+create table t1 (a int primary key, b varchar(700) not null, unique key (b))
 engine=ndb charset=utf8;
 insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200));
 insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200));
diff -Nrup a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
--- a/mysql-test/suite/ndb/r/ps_7ndb.result	2007-07-05 01:06:22 +05:00
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result	2007-09-12 17:41:14 +05:00
@@ -1158,7 +1158,7 @@ def					table	253	64	2	Y	0	31	8
 def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
-def					key_len	253	1365	0	Y	0	31	8
+def					key_len	253	320	0	Y	0	31	8
 def					ref	253	1024	0	Y	0	31	8
 def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
diff -Nrup a/mysql-test/suite/ndb/t/ndb_index_unique.test b/mysql-test/suite/ndb/t/ndb_index_unique.test
--- a/mysql-test/suite/ndb/t/ndb_index_unique.test	2007-07-05 01:06:23 +05:00
+++ b/mysql-test/suite/ndb/t/ndb_index_unique.test	2007-09-12 17:41:14 +05:00
@@ -338,7 +338,7 @@ drop table t1;
 
 # bug#15918 Unique Key Limit in NDB Engine
 
-create table t1 (a int primary key, b varchar(1000) not null, unique key (b))
+create table t1 (a int primary key, b varchar(700) not null, unique key (b))
 engine=ndb charset=utf8;
 
 insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200));
diff -Nrup a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
--- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result	2007-07-05 01:06:25 +05:00
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result	2007-09-12 17:41:14 +05:00
@@ -457,7 +457,7 @@ master-bin.000001	#	Query	#	#	use `mysql
 master-bin.000001	#	Table_map	#	#	table_id: # (mysqltest1.t2)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	use `mysqltest1`; CREATE TABLE `t3` (
-  `1` varbinary(108) NOT NULL DEFAULT ''
+  `1` varbinary(144) NOT NULL DEFAULT ''
 )
 master-bin.000001	#	Table_map	#	#	table_id: # (mysqltest1.t3)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
@@ -761,7 +761,7 @@ master-bin.000001	#	Query	#	#	use `mysql
 master-bin.000001	#	Table_map	#	#	table_id: # (mysqltest1.t2)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	use `mysqltest1`; CREATE TABLE `t3` (
-  `1` varbinary(108) NOT NULL DEFAULT ''
+  `1` varbinary(144) NOT NULL DEFAULT ''
 )
 master-bin.000001	#	Table_map	#	#	table_id: # (mysqltest1.t3)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
diff -Nrup a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
--- a/mysql-test/t/ctype_ldml.test	2007-06-07 17:55:53 +05:00
+++ b/mysql-test/t/ctype_ldml.test	2007-09-12 17:41:14 +05:00
@@ -1,4 +1,7 @@
 --source include/have_ucs2.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
+
 
 --disable_warnings
 drop table if exists t1;
@@ -17,6 +20,18 @@ drop table t1;
 
 show collation like 'ucs2_test_ci';
 create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+drop table t1;
+
+show collation like 'utf16_test_ci';
+create table t1 (c1 char(1) character set utf16 collate utf16_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+drop table t1;
+
+show collation like 'utf32_test_ci';
+create table t1 (c1 char(1) character set utf32 collate utf32_test_ci);
 insert into t1 values ('a');
 select * from t1 where c1='b';
 drop table t1;
diff -Nrup a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/ctype_utf16.test	2007-09-12 17:41:16 +05:00
@@ -0,0 +1,719 @@
+-- source include/have_utf16.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+SET NAMES latin1;
+SET character_set_connection=utf16;
+select hex('a'), hex('a ');
+-- source include/endspace.inc
+
+
+# Check that incomplete utf16 characters in HEX notation
+# are left-padded with zeros
+#
+select hex(_utf16 0x44);
+select hex(_utf16 0x3344);
+select hex(_utf16 0x113344);
+
+
+# Check that 0x20 is only trimmed when it is 
+# a part of real SPACE character, not just a part
+# of a multibyte sequence.
+# Note, CYRILLIC LETTER ER is used as an example, which
+# is stored as 0x0420 in utf16, thus contains 0x20 in the
+# low byte. The second character is THREE-PER-M, U+2004,
+# which contains 0x20 in the high byte.
+
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DELETE FROM t1;
+
+#
+# Check that real spaces are correctly trimmed.
+#
+INSERT INTO t1 VALUES (X'042000200020',X'042000200020'), (X'200400200020', X'200400200020');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DROP TABLE t1;
+
+
+#
+# Check LPAD/RPAD
+#
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'0421'));
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+SELECT hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+SELECT hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+SELECT hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'0421'));
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422'));
+SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423'));
+SELECT hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423'));
+SELECT hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421'));
+SELECT hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00'));
+
+CREATE TABLE t1 SELECT 
+LPAD(_utf16 X'0420',10,_utf16 X'0421') l,
+RPAD(_utf16 X'0420',10,_utf16 X'0421') r;
+SHOW CREATE TABLE t1;
+select hex(l), hex(r) from t1;
+DROP TABLE t1;
+
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+drop table t1;
+
+######################################################
+#
+# Test of like
+#
+
+SET NAMES latin1;
+SET character_set_connection=utf16;
+
+create table t1 (a varchar(10) character set utf16, key(a));
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+explain select * from t1 where a like concat('abc','%');
+select * from t1 where a like "abc%";
+select * from t1 where a like concat("abc","%");
+select * from t1 where a like "ABC%";
+select * from t1 where a like "test%";
+select * from t1 where a like "te_t";
+select * from t1 where a like "%a%";
+select * from t1 where a like "%abcd%";
+select * from t1 where a like "%abc\d%";
+drop table t1;
+
+#
+# More LIKE test
+#
+select 'AA' like 'AA'; 
+select 'AA' like 'A%A';
+select 'AA' like 'A%%A';
+select 'AA' like 'AA%';
+select 'AA' like '%AA%';
+select 'AA' like '%A';
+select 'AA' like '%AA';
+select 'AA' like 'A%A%';
+select 'AA' like '_%_%';
+select 'AA' like '%A%A';
+select 'AAA'like 'A%A%A';
+
+select 'AZ' like 'AZ'; 
+select 'AZ' like 'A%Z';
+select 'AZ' like 'A%%Z';
+select 'AZ' like 'AZ%';
+select 'AZ' like '%AZ%';
+select 'AZ' like '%Z';
+select 'AZ' like '%AZ';
+select 'AZ' like 'A%Z%';
+select 'AZ' like '_%_%';
+select 'AZ' like '%A%Z';
+select 'AZ' like 'A_';
+select 'AZ' like '_Z';
+select 'AMZ'like 'A%M%Z';
+
+SET NAMES utf8;
+SET character_set_connection=utf16;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
+INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
+INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ');
+SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a;
+SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf16_bin ORDER BY BINARY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
+ENGINE=MyISAM CHARACTER SET utf16;
+INSERT INTO t1 (word) VALUES ("cat");
+SELECT * FROM t1 WHERE word LIKE "c%";
+SELECT * FROM t1 WHERE word LIKE "ca_";
+SELECT * FROM t1 WHERE word LIKE "cat";
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630025';     # "c%"
+SELECT * FROM t1 WHERE word LIKE _utf16 x'00630061005F'; # "ca_"
+DROP TABLE t1;
+
+
+#
+# Check that INSERT() works fine. 
+# This invokes charpos() function.
+select insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066);
+select insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066);
+
+########################################################
+#
+# Bug 1264
+#
+# Description: 
+#
+# When using a ucs2 table in MySQL, 
+# either with ucs2_general_ci or ucs2_bin collation,
+# words are returned in an incorrect order when using ORDER BY
+# on an _indexed_ CHAR or VARCHAR column. They are sorted with
+# the longest word *first* instead of last. I.E. The word "aardvark"
+# is in the results before the word "a".
+#
+# If there is no index for the column, the problem does not occur.
+#
+# Interestingly, if there is no second column, the words are returned
+# in the correct order. 
+#
+# According to EXPLAIN, it looks like when the output includes columns that
+# are not part of the index sorted on, it does a filesort, which fails. 
+# Using a straight index yields correct results.
+
+SET NAMES latin1;
+
+#
+# Two fields, index
+#
+
+CREATE TABLE t1 (
+   word VARCHAR(64),
+   bar INT(11) default 0,
+   PRIMARY KEY (word))
+   ENGINE=MyISAM
+   CHARSET utf16
+   COLLATE utf16_general_ci ;
+
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+SELECT * FROM t1 ORDER BY word;
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+SELECT word FROM t1 ORDER by word;
+DROP TABLE t1;
+
+
+#
+# One field, index
+# 
+
+CREATE TABLE t1 (
+   word VARCHAR(64) ,
+   PRIMARY KEY (word))
+   ENGINE=MyISAM
+   CHARSET utf16
+   COLLATE utf16_general_ci;
+
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a");
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY WORD;
+SELECT * FROM t1 ORDER BY word;
+DROP TABLE t1;
+
+
+#
+# Two fields, no index
+#
+
+CREATE TABLE t1 (
+   word TEXT,
+   bar INT(11) AUTO_INCREMENT,
+   PRIMARY KEY (bar))
+   ENGINE=MyISAM
+   CHARSET utf16
+   COLLATE utf16_general_ci ;
+INSERT INTO t1 (word) VALUES ("aar");
+INSERT INTO t1 (word) VALUES ("a" );
+INSERT INTO t1 (word) VALUES ("aardvar");
+INSERT INTO t1 (word) VALUES ("aardvark");
+INSERT INTO t1 (word) VALUES ("aardvara");
+INSERT INTO t1 (word) VALUES ("aardvarz");
+EXPLAIN SELECT * FROM t1 ORDER BY word;
+SELECT * FROM t1 ORDER BY word;
+EXPLAIN SELECT word FROM t1 ORDER BY word;
+SELECT word FROM t1 ORDER BY word;
+DROP TABLE t1;
+
+#
+# END OF Bug 1264 test
+#
+########################################################
+
+
+#
+# Check alignment for from-binary-conversion with CAST and CONVERT
+#
+SELECT hex(cast(0xAA as char character set utf16));
+SELECT hex(convert(0xAA using utf16));
+
+#
+# Check alignment for string types
+#
+CREATE TABLE t1 (a char(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a varchar(10) character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a text character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a mediumtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a longtext character set utf16);
+INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+##
+## Bug #5024 Server crashes with queries on fields
+##  with certain charset/collation settings
+##
+##
+#create table t1 (s1 char character set utf16 collate utf16_czech_ci);
+#insert into t1 values ('0'),('1'),('2'),('a'),('b'),('c');
+#select s1 from t1 where s1 > 'a' order by s1;
+#drop table t1;
+#
+
+#
+# Bug #5081 : UCS2 fields are filled with '0x2020'
+# after extending field length
+#
+create table t1(a char(1)) default charset utf16;
+insert into t1 values ('a'),('b'),('c');
+alter table t1 modify a char(5);
+select a, hex(a) from t1;
+drop table t1;
+
+#
+# Check prepare statement from an UTF16 string
+#
+set @ivar= 1234;
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using utf16);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+
+#
+# Check that utf16 works with ENUM and SET type
+#
+set names utf8;
+create table t1 (a enum('x','y','z') character set utf16);
+show create table t1;
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+select a, hex(a) from t1 order by a;
+alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set utf16;
+show create table t1;
+insert into t1 values ('D');
+insert into t1 values ('E ');
+insert into t1 values ('ä');
+insert into t1 values ('ö');
+insert into t1 values ('ü');
+select a, hex(a) from t1 order by a;
+drop table t1;
+
+create table t1 (a set ('x','y','z','ä','ö','ü') character set utf16);
+show create table t1;
+insert into t1 values ('x');
+insert into t1 values ('y');
+insert into t1 values ('z');
+insert into t1 values ('x,y');
+insert into t1 values ('x,y,z,ä,ö,ü');
+select a, hex(a) from t1 order by a;
+drop table t1;
+
+#
+# Bug#7302 UCS2 data in ENUM fields get truncated when new column is added
+#
+create table t1(a enum('a','b','c')) default character set utf16;
+insert into t1 values('a'),('b'),('c');
+alter table t1 add b char(1);
+show warnings;
+select * from t1 order by a;
+drop table t1;
+
+SET NAMES latin1;
+SET collation_connection='utf16_general_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+SET NAMES latin1;
+SET collation_connection='utf16_bin';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+
+#
+# Bug#10344 Some string functions fail for UCS2
+#
+select hex(substr(_utf16 0x00e400e50068,1));
+select hex(substr(_utf16 0x00e400e50068,2));
+select hex(substr(_utf16 0x00e400e50068,3));
+select hex(substr(_utf16 0x00e400e50068,-1));
+select hex(substr(_utf16 0x00e400e50068,-2));
+select hex(substr(_utf16 0x00e400e50068,-3));
+select hex(substr(_utf16 0x00e400e5D800DC00,1));
+select hex(substr(_utf16 0x00e400e5D800DC00,2));
+select hex(substr(_utf16 0x00e400e5D800DC00,3));
+select hex(substr(_utf16 0x00e400e5D800DC00,-1));
+select hex(substr(_utf16 0x00e400e5D800DC00,-2));
+select hex(substr(_utf16 0x00e400e5D800DC00,-3));
+
+SET NAMES latin1;
+
+##
+## Bug#8235
+##
+## This bug also helped to find another problem that
+## INSERT of a UCS2 string containing a negative number
+## into a unsigned int column didn't produce warnings.
+## This test covers both problems.
+##
+##SET collation_connection='ucs2_swedish_ci';
+##CREATE TABLE t1 (Field1 int(10) default '0');
+### no warnings, negative numbers are allowed
+##INSERT INTO t1 VALUES ('-1');
+##SELECT * FROM t1;
+##DROP TABLE t1;
+##CREATE TABLE t1 (Field1 int(10) unsigned default '0');
+### this should generate a "Data truncated" warning
+##INSERT INTO t1 VALUES ('-1');
+##DROP TABLE t1;
+##SET NAMES latin1;
+
+###
+### Bug #14583 Bug on query using a LIKE on indexed field with ucs2_bin collation
+###
+##--disable_warnings
+##create table t1(f1 varchar(5) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL) engine=InnoDB;
+##--enable_warnings
+##insert into t1 values('a');
+##create index t1f1 on t1(f1);
+##select f1 from t1 where f1 like 'a%';
+##drop table t1;
+
+#
+# Bug#9442 Set parameter make query fail if column character set is UCS2
+#
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+execute stmt using @param1;
+select utext from t1 where utext like '%%';
+drop table t1;
+deallocate prepare stmt;
+
+#
+# Bug#22052 Trailing spaces are not removed from UNICODE fields in an index
+#
+create table t1 (
+  a char(10) character set utf16 not null, 
+  index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+# make sure "index read" is used
+explain select hex(a) from t1 order by a;
+select hex(a) from t1 order by a;
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+drop table t1;
+
+##
+## Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation
+##             over a 'ucs2' field uses a temporary table 
+##
+##CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
+##INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
+##SELECT id, MIN(s) FROM t1 GROUP BY id;
+##DROP TABLE t1;
+
+###
+### Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
+###
+##
+##--disable_warnings
+##drop table if exists bug20536;
+##--enable_warnings
+##
+##set names latin1;
+##create table bug20536 (id bigint not null auto_increment primary key, name
+##varchar(255) character set ucs2 not null);
+##insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431'), (2, "'test\\_2'");
+##select md5(name) from bug20536;
+##select sha1(name) from bug20536;
+##select make_set(3, name, upper(name)) from bug20536;
+##select export_set(5, name, upper(name)) from bug20536;
+##select export_set(5, name, upper(name), ",", 5) from bug20536;
+
+#
+# Bug #20108: corrupted default enum value for a ucs2 field              
+#
+
+CREATE TABLE t1 (
+  status enum('active','passive') character set utf16 collate utf16_general_ci 
+    NOT NULL default 'passive'
+);
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD a int NOT NULL AFTER status; 
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+##CREATE TABLE t2 (
+##  status enum('active','passive') collate ucs2_turkish_ci 
+##    NOT NULL default 'passive'
+##);
+##SHOW CREATE TABLE t2;
+##ALTER TABLE t2 ADD a int NOT NULL AFTER status; 
+##DROP TABLE t2;
+
+
+--echo End of 4.1 tests
+
+#
+# Conversion from an UTF16 string to a decimal column
+#
+CREATE TABLE t1 (a varchar(64) character set utf16, b decimal(10,3));
+INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
+update t1 set b=a;
+SELECT *, hex(a) FROM t1;
+DROP TABLE t1;
+
+#
+# Bug#9442 Set parameter make query fail if column character set is UCS2
+#
+create table t1 (utext varchar(20) character set utf16);
+insert into t1 values ("lily");
+insert into t1 values ("river");
+prepare stmt from 'select utext from t1 where utext like ?';
+set @param1='%%';
+execute stmt using @param1;
+execute stmt using @param1;
+select utext from t1 where utext like '%%';
+drop table t1;
+deallocate prepare stmt;
+
+#
+# Bug#22638 SOUNDEX broken for international characters
+#
+set names latin1;
+set character_set_connection=utf16;
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
+select 'mood' sounds like 'mud';
+# Cyrillic A, BE, VE
+select hex(soundex(_utf16 0x041004110412));
+# Make sure that "U+00BF INVERTED QUESTION MARK" is not considered as letter
+select hex(soundex(_utf16 0x00BF00C0));
+set names latin1;
+
+#
+# Bug #14290: character_maximum_length for text fields
+#
+create table t1(a blob, b text charset utf16);
+select data_type, character_octet_length, character_maximum_length
+  from information_schema.columns where table_name='t1';
+drop table t1;
+
+--echo End of 5.0 tests
+
+set collation_connection=utf16_general_ci;
+--source include/weight_string.inc
+select hex(weight_string(_utf16 0xD800DC00));
+select hex(weight_string(_utf16 0xD800DC01));
+--source include/weight_string_l1.inc
+
+set collation_connection=utf16_bin;
+--source include/weight_string.inc
+--source include/weight_string_l1.inc
+
+set names latin1;
+set collation_connection=utf16_general_ci;
+#
+# Testing cs->coll->instr()
+#
+select position('bb' in 'abba');
+
+#
+# Testing cs->coll->hash_sort()
+#
+create table t1 (a varchar(10) character set utf16) engine=heap;
+insert into t1 values ('a'),('A'),('b'),('B');
+select * from t1 where a='a' order by binary a;
+select hex(min(binary a)),count(*) from t1 group by a;
+drop table t1;
+
+#
+# Testing cs->cset->numchars()
+#
+select char_length('abcd'), octet_length('abcd');
+select char_length(_utf16 0xD800DC00), octet_length(_utf16 0xD800DC00);
+select char_length(_utf16 0xD87FDFFF), octet_length(_utf16 0xD87FDFFF);
+
+#
+# Testing cs->cset->charpos()
+#
+select left('abcd',2);
+select hex(left(_utf16 0xD800DC00D87FDFFF, 1));
+select hex(right(_utf16 0xD800DC00D87FDFFF, 1));
+
+#
+# Testing cs->cset->well_formed_length()
+#
+create table t1 (a varchar(10) character set utf16);
+# Bad sequences
+insert into t1 values (_utf16 0xD800);
+insert into t1 values (_utf16 0xDC00);
+insert into t1 values (_utf16 0xD800D800);
+insert into t1 values (_utf16 0xD800E800);
+insert into t1 values (_utf16 0xD8000800);
+# Good sequences
+insert into t1 values (_utf16 0xD800DC00);
+insert into t1 values (_utf16 0xD800DCFF);
+insert into t1 values (_utf16 0xDBFFDC00);
+insert into t1 values (_utf16 0xDBFFDCFF);
+select hex(a) from t1;
+drop table t1;
+
+#
+# Testing cs->cset->lengthsp()
+#
+create table t1 (a char(10)) character set utf16;
+insert into t1 values ('a   ');
+select hex(a) from t1;
+drop table t1;
+
+#
+# Testing cs->cset->caseup() and cs->cset->casedn()
+#
+select upper('abcd'), lower('ABCD');
+
+#
+# TODO: str_to_datetime() is broken and doesn't work with ucs2 and utf16
+# Testing cs->cset->snprintf()
+#
+#create table t1 (a date);
+#insert into t1 values ('2007-09-16');
+#select * from t1;
+#drop table t1;
+
+#
+# Testing cs->cset->l10tostr
+# !!! Not used in the code
+
+#
+# Testing cs->cset->ll10tostr
+#
+create table t1 (a varchar(10) character set utf16);
+insert into t1 values (123456);
+select a, hex(a) from t1;
+drop table t1;
+
+
+# Testing cs->cset->fill
+# SOUNDEX fills strings with DIGIT ZERO up to four characters
+select hex(soundex('a'));
+
+#
+# Testing cs->cset->strntol
+# !!! Not used in the code
+
+#
+# Testing cs->cset->strntoul
+#
+create table t1 (a enum ('a','b','c')) character set utf16;
+insert into t1 values ('1');
+select * from t1;
+drop table t1;
+
+#
+# Testing cs->cset->strntoll and cs->cset->strntoull
+#
+set names latin1;
+select hex(conv(convert('123' using utf16), -10, 16));
+select hex(conv(convert('123' using utf16), 10, 16));
+
+#
+# Testing cs->cset->strntod
+#
+set names latin1;
+set character_set_connection=utf16;
+select 1.1 + '1.2';
+select 1.1 + '1.2xxx';
+
+# Testing strntoll10_utf16
+# Testing cs->cset->strtoll10
+select left('aaa','1');
+
+#
+# Testing cs->cset->strntoull10rnd
+#
+create table t1 (a int);
+insert into t1 values ('-1234.1e2');
+insert into t1 values ('-1234.1e2xxxx');
+insert into t1 values ('-1234.1e2    ');
+select * from t1;
+drop table t1;
+
+#
+# Testing cs->cset->scan
+#
+create table t1 (a int);
+insert into t1 values ('1 ');
+insert into t1 values ('1 x');
+select * from t1;
+drop table t1;
+
+#
+# Testing auto-conversion to TEXT
+#
+create table t1 (a varchar(17000) character set utf16);
+show create table t1;
+drop table t1;
+
+#
+# Testing that maximim possible key length is 1000 bytes
+#
+create table t1 (a varchar(250) character set utf16 primary key);
+show create table t1;
+drop table t1;
+--error ER_TOO_LONG_KEY
+create table t1 (a varchar(334) character set utf16 primary key);
+
+#
+# Conversion to utf8
+#
+create table t1 (a char(1) character set utf16);
+insert into t1 values (0xD800DC00),(0xD800DCFF),(0xDB7FDC00),(0xDB7FDCFF);
+insert into t1 values (0x00C0), (0x00FF),(0xE000), (0xFFFF);
+select hex(a), hex(@a:=convert(a using utf8)), hex(convert(@a using utf16)) from t1;
+drop table t1;
+
+#
+## TODO: add tests for all engines
+#
diff -Nrup a/mysql-test/t/ctype_utf16_uca.test b/mysql-test/t/ctype_utf16_uca.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/ctype_utf16_uca.test	2007-09-12 17:41:16 +05:00
@@ -0,0 +1,287 @@
+-- source include/have_utf16.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+set names utf8;
+set collation_connection=utf16_unicode_ci;
+select hex('a'), hex('a ');
+-- source include/endspace.inc
+
+#
+# Bug #6787 LIKE not working properly with _ and utf8 data
+#
+select 'c' like '\_' as want0; 
+
+#
+# Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters
+#
+CREATE TABLE t (
+  c char(20) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARACTER SET utf16 COLLATE utf16_unicode_ci;
+INSERT INTO t VALUES ('a'),('ab'),('aba');
+ALTER TABLE t ADD INDEX (c);
+SELECT c FROM t WHERE c LIKE 'a%';
+DROP TABLE t;
+
+
+create table t1 (c1 char(10) character set utf16 collate utf16_bin);
+
+#
+# Basic Latin
+#
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+
+#
+# Latin1 suppliment
+#
+insert into t1 values (0x00e0),(0x00c0);
+insert into t1 values (0x00e1),(0x00c1);
+insert into t1 values (0x00e2),(0x00c2);
+insert into t1 values (0x00e3),(0x00c3);
+insert into t1 values (0x00e4),(0x00c4);
+insert into t1 values (0x00e5),(0x00c5);
+insert into t1 values (0x00e6),(0x00c6);
+insert into t1 values (0x00e7),(0x00c7);
+insert into t1 values (0x00e8),(0x00c8);
+insert into t1 values (0x00e9),(0x00c9);
+insert into t1 values (0x00ea),(0x00ca);
+insert into t1 values (0x00eb),(0x00cb);
+insert into t1 values (0x00ec),(0x00cc);
+insert into t1 values (0x00ed),(0x00cd);
+insert into t1 values (0x00ee),(0x00ce);
+insert into t1 values (0x00ef),(0x00cf);
+
+insert into t1 values (0x00f0),(0x00d0);
+insert into t1 values (0x00f1),(0x00d1);
+insert into t1 values (0x00f2),(0x00d2);
+insert into t1 values (0x00f3),(0x00d3);
+insert into t1 values (0x00f4),(0x00d4);
+insert into t1 values (0x00f5),(0x00d5);
+insert into t1 values (0x00f6),(0x00d6);
+insert into t1 values (0x00f7),(0x00d7);
+insert into t1 values (0x00f8),(0x00d8);
+insert into t1 values (0x00f9),(0x00d9);
+insert into t1 values (0x00fa),(0x00da);
+insert into t1 values (0x00fb),(0x00db);
+insert into t1 values (0x00fc),(0x00dc);
+insert into t1 values (0x00fd),(0x00dd);
+insert into t1 values (0x00fe),(0x00de);
+insert into t1 values (0x00ff),(0x00df);
+
+#
+# Latin extended-A, 0100-017F
+#
+insert into t1 values (0x0100),(0x0101),(0x0102),(0x0103);
+insert into t1 values (0x0104),(0x0105),(0x0106),(0x0107);
+insert into t1 values (0x0108),(0x0109),(0x010a),(0x010b);
+insert into t1 values (0x010c),(0x010d),(0x010e),(0x010f);
+insert into t1 values (0x0110),(0x0111),(0x0112),(0x0113);
+insert into t1 values (0x0114),(0x0115),(0x0116),(0x0117);
+insert into t1 values (0x0118),(0x0119),(0x011a),(0x011b);
+insert into t1 values (0x011c),(0x011d),(0x011e),(0x011f);
+insert into t1 values (0x0120),(0x0121),(0x0122),(0x0123);
+insert into t1 values (0x0124),(0x0125),(0x0126),(0x0127);
+insert into t1 values (0x0128),(0x0129),(0x012a),(0x012b);
+insert into t1 values (0x012c),(0x012d),(0x012e),(0x012f);
+insert into t1 values (0x0130),(0x0131),(0x0132),(0x0133);
+insert into t1 values (0x0134),(0x0135),(0x0136),(0x0137);
+insert into t1 values (0x0138),(0x0139),(0x013a),(0x013b);
+insert into t1 values (0x013c),(0x013d),(0x013e),(0x013f);
+insert into t1 values (0x0140),(0x0141),(0x0142),(0x0143);
+insert into t1 values (0x0144),(0x0145),(0x0146),(0x0147);
+insert into t1 values (0x0148),(0x0149),(0x014a),(0x014b);
+insert into t1 values (0x014c),(0x014d),(0x014e),(0x014f);
+insert into t1 values (0x0150),(0x0151),(0x0152),(0x0153);
+insert into t1 values (0x0154),(0x0155),(0x0156),(0x0157);
+insert into t1 values (0x0158),(0x0159),(0x015a),(0x015b);
+insert into t1 values (0x015c),(0x015d),(0x015e),(0x015f);
+insert into t1 values (0x0160),(0x0161),(0x0162),(0x0163);
+insert into t1 values (0x0164),(0x0165),(0x0166),(0x0167);
+insert into t1 values (0x0168),(0x0169),(0x016a),(0x016b);
+insert into t1 values (0x016c),(0x016d),(0x016e),(0x016f);
+insert into t1 values (0x0170),(0x0171),(0x0172),(0x0173);
+insert into t1 values (0x0174),(0x0175),(0x0176),(0x0177);
+insert into t1 values (0x0178),(0x0179),(0x017a),(0x017b);
+insert into t1 values (0x017c),(0x017d),(0x017e),(0x017f);
+
+#
+# Latin extended-B, 0180-024F
+#
+insert into t1 values (0x0180),(0x0181),(0x0182),(0x0183);
+insert into t1 values (0x0184),(0x0185),(0x0186),(0x0187);
+insert into t1 values (0x0188),(0x0189),(0x018a),(0x018b);
+insert into t1 values (0x018c),(0x018d),(0x018e),(0x018f);
+insert into t1 values (0x0190),(0x0191),(0x0192),(0x0193);
+insert into t1 values (0x0194),(0x0195),(0x0196),(0x0197);
+insert into t1 values (0x0198),(0x0199),(0x019a),(0x019b);
+insert into t1 values (0x019c),(0x019d),(0x019e),(0x019f);
+insert into t1 values (0x01a0),(0x01a1),(0x01a2),(0x01a3);
+insert into t1 values (0x01a4),(0x01a5),(0x01a6),(0x01a7);
+insert into t1 values (0x01a8),(0x01a9),(0x01aa),(0x01ab);
+insert into t1 values (0x01ac),(0x01ad),(0x01ae),(0x01af);
+insert into t1 values (0x01b0),(0x01b1),(0x01b2),(0x01b3);
+insert into t1 values (0x01b4),(0x01b5),(0x01b6),(0x01b7);
+insert into t1 values (0x01b8),(0x01b9),(0x01ba),(0x01bb);
+insert into t1 values (0x01bc),(0x01bd),(0x01be),(0x01bf);
+insert into t1 values (0x01c0),(0x01c1),(0x01c2),(0x01c3);
+insert into t1 values (0x01c4),(0x01c5),(0x01c6),(0x01c7);
+insert into t1 values (0x01c8),(0x01c9),(0x01ca),(0x01cb);
+insert into t1 values (0x01cc),(0x01cd),(0x01ce),(0x01cf);
+insert into t1 values (0x01d0),(0x01d1),(0x01d2),(0x01d3);
+insert into t1 values (0x01d4),(0x01d5),(0x01d6),(0x01d7);
+insert into t1 values (0x01d8),(0x01d9),(0x01da),(0x01db);
+insert into t1 values (0x01dc),(0x01dd),(0x01de),(0x01df);
+insert into t1 values (0x01e0),(0x01e1),(0x01e2),(0x01e3);
+insert into t1 values (0x01e4),(0x01e5),(0x01e6),(0x01e7);
+insert into t1 values (0x01e8),(0x01e9),(0x01ea),(0x01eb);
+insert into t1 values (0x01ec),(0x01ed),(0x01ee),(0x01ef);
+insert into t1 values (0x01f0),(0x01f1),(0x01f2),(0x01f3);
+insert into t1 values (0x01f4),(0x01f5),(0x01f6),(0x01f7);
+insert into t1 values (0x01f8),(0x01f9),(0x01fa),(0x01fb);
+insert into t1 values (0x01fc),(0x01fd),(0x01fe),(0x01ff);
+
+
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_icelandic_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_latvian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_romanian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovenian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_polish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_estonian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_swedish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_turkish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_czech_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_danish_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_lithuanian_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovak_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish2_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci;
+select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci;
+
+drop table t1;
+
+#
+# Bug#5324
+#
+SET NAMES utf8;
+
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+#Check one row
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_general_ci;
+INSERT INTO t1 VALUES (0x039C03C903B4);
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_general_ci ORDER BY c;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+#Check one row
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+INSERT INTO t1 VALUES (0x039C03C903B4);
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
+INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
+#Check one row row
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
+INSERT INTO t1 VALUES (0x039C03C903B4);
+#Check two rows
+SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
+COLLATE utf16_unicode_ci ORDER BY c;
+DROP TABLE t1;
+
+
+SET NAMES utf8;
+SET @test_character_set='utf16';
+SET @test_collation='utf16_swedish_ci';
+-- source include/ctype_common.inc
+
+
+SET collation_connection='utf16_unicode_ci';
+-- source include/ctype_filesort.inc
+-- source include/ctype_like_escape.inc
+
+--echo End of 4.1 tests
+
+#
+# Check UPPER/LOWER changing length
+#
+# Result shorter than argument
+CREATE TABLE t1 (id int, a varchar(30) character set utf16);
+INSERT INTO t1 VALUES (1, 0x01310069), (2, 0x01310131);
+INSERT INTO t1 VALUES (3, 0x00690069), (4, 0x01300049);
+INSERT INTO t1 VALUES (5, 0x01300130), (6, 0x00490049);
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf16 collate utf16_turkish_ci;
+SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
+FROM t1 ORDER BY id;
+DROP TABLE t1;
+
+#
+# Bug #27079 Crash while grouping empty ucs2 strings
+#
+CREATE TABLE t1 (
+ c1 text character set utf16 collate utf16_polish_ci NOT NULL
+) ENGINE=MyISAM;
+insert into t1 values (''),('a');
+SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
+DROP TABLE IF EXISTS t1;
+
+--echo End of 5.1 tests
+
+set collation_connection=utf16_unicode_ci;
+--source include/weight_string.inc
+select hex(weight_string(_utf16 0xD800DC00 collate utf16_unicode_ci));
+select hex(weight_string(_utf16 0xD800DC01 collate utf16_unicode_ci));
+--source include/weight_string_l1.inc
+
+set @@collation_connection=utf16_czech_ci;
+--source include/weight_string_chde.inc
+
+--echo End of 5.2 tests
diff -Nrup a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/ctype_utf32.test	2007-09-12 17:41:16 +05:00
@@ -0,0 +1,743 @@
+-- source include/have_utf32.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+SET NAMES latin1;
+SET character_set_connection=utf32;
+select hex('a'), hex('a ');
+-- source include/endspace.inc
+
+#
+# Check that incomplete utf32 characters in HEX notation
+# are left-padded with zeros
+#
+select hex(_utf32 0x44);
+select hex(_utf32 0x3344);
+select hex(_utf32 0x113344);
+
+select hex(_utf32 X'44');
+select hex(_utf32 X'3344');
+select hex(_utf32 X'113344');
+
+
+#
+# Check that 0x20 is only trimmed when it is 
+# a part of real SPACE character, not just a part
+# of a multibyte sequence.
+# Note, CYRILLIC LETTER ER is used as an example, which
+# is stored as 0x0420 in UCS2, thus contains 0x20 in the
+# low byte. The second character is THREE-PER-M, U+2004,
+# which contains 0x20 in the high byte.
+#
+
+CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32;
+INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DELETE FROM t1;
+
+#
+# Check that real spaces are correctly trimmed.
+#
+
+INSERT INTO t1 VALUES
+  (X'000004200000002000000020',X'000004200000002000000020'),
+  (X'000020040000002000000020',X'000020040000002000000020');
+SELECT hex(word) FROM t1 ORDER BY word;
+SELECT hex(word2) FROM t1 ORDER BY word2;
+DROP TABLE t1;
+
+#
+# Check LPAD/RPAD
+#
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0421'));
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+SELECT hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0421'));
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422'));
+SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423'));
+SELECT hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423'));
+
+CREATE TABLE t1 SELECT 
+LPAD(_utf32 X'0420',10,_utf32 X'0421') l,
+RPAD(_utf32 X'0420',10,_utf32 X'0421') r;
+SHOW CREATE TABLE t1;
+select hex(l), hex(r) from t1;
+DROP TABLE t1;
+
+create table t1 (f1 char(30));
+insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t1;
+drop table t1;
+
+######################################################
+#
+# Test of like
+#
+
+SET NAMES latin1;
+SET character_set_connection=utf32;
+
+create table t1 (a varchar(10) character set utf32, key(a));
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+explain select * from t1 where a like concat('abc','%');
+select * from t1 where a like "abc%";
+select * from t1 where a like concat("abc","%");
+select * from t1 where a like "ABC%";
+select * from t1 where a like "test%";
+select * from t1 where a like "te_t";
+select * from t1 where a like "%a%";
+select * from t1 where a like "%abcd%";
+select * from t1 where a like "%abc\d%";
+drop table t1;
+
+#
+# More LIKE test
+#
+select 'AA' like 'AA'; 
+select 'AA' like 'A%A';
+select 'AA' like 'A%%A';
+select 'AA' like 'AA%';
+select 'AA' like '%AA%';
+select 'AA' like '%A';
+select 'AA' like '%AA';
+select 'AA' like 'A%A%';
+select 'AA' like '_%_%';
+select 'AA' like '%A%A';
+select 'AAA'like 'A%A%A';
+
+select 'AZ' like 'AZ'; 
+select 'AZ' like 'A%Z';
+select 'AZ' like 'A%%Z';
+select 'AZ' like 'AZ%';
+select 'AZ' like '%AZ%';
+select 'AZ' like '%Z';
+select 'AZ' like '%AZ';
+select 'AZ' like 'A%Z%';
+select 'AZ' like '_%_%';
+select 'AZ' like '%A%Z';
+select 'AZ' like 'A_';
+select 'AZ' like '_Z';
+select 'AMZ'like 'A%M%Z';
+
+SET NAMES utf8;
+SET character_set_connection=utf32;
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
+INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВа