diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-09-21 10:14:42 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-09-21 10:14:42 +0200 |
commit | 9af177042ed0e297b8f26f2c2f8ae00b3a814a90 (patch) | |
tree | 0d8d2fab7ebeb02f3c25c00ac1543754b625bde8 /strings | |
parent | a6add4ff43a905cee1bfd00b2ec2d276018866ce (diff) | |
parent | 2fe0836eed16ce5809c34064893681f12c77da9f (diff) | |
download | mariadb-git-9af177042ed0e297b8f26f2c2f8ae00b3a814a90.tar.gz |
10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6)
TokuDB does not compile (not updated to 10.0 SE API)
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-uca.c | 40 | ||||
-rw-r--r-- | strings/ctype-utf8.c | 8 |
2 files changed, 26 insertions, 22 deletions
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 8bfb6ac5e5a..109a233d62e 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -8981,10 +8981,12 @@ static uchar ctype_utf8[] = { extern MY_CHARSET_HANDLER my_charset_utf8_handler; +#define MY_CS_UTF8MB3_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE) + struct charset_info_st my_charset_utf8_unicode_ci= { 192,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_unicode_ci", /* name */ "", /* comment */ @@ -9049,7 +9051,7 @@ struct charset_info_st my_charset_utf8_icelandic_uca_ci= struct charset_info_st my_charset_utf8_latvian_uca_ci= { 194,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_latvian_ci", /* name */ "", /* comment */ @@ -9081,7 +9083,7 @@ struct charset_info_st my_charset_utf8_latvian_uca_ci= struct charset_info_st my_charset_utf8_romanian_uca_ci= { 195,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_romanian_ci", /* name */ "", /* comment */ @@ -9113,7 +9115,7 @@ struct charset_info_st my_charset_utf8_romanian_uca_ci= struct charset_info_st my_charset_utf8_slovenian_uca_ci= { 196,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_slovenian_ci",/* name */ "", /* comment */ @@ -9145,7 +9147,7 @@ struct charset_info_st my_charset_utf8_slovenian_uca_ci= struct charset_info_st my_charset_utf8_polish_uca_ci= { 197,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_polish_ci", /* name */ "", /* comment */ @@ -9177,7 +9179,7 @@ struct charset_info_st my_charset_utf8_polish_uca_ci= struct charset_info_st my_charset_utf8_estonian_uca_ci= { 198,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_estonian_ci", /* name */ "", /* comment */ @@ -9209,7 +9211,7 @@ struct charset_info_st my_charset_utf8_estonian_uca_ci= struct charset_info_st my_charset_utf8_spanish_uca_ci= { 199,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_spanish_ci", /* name */ "", /* comment */ @@ -9241,7 +9243,7 @@ struct charset_info_st my_charset_utf8_spanish_uca_ci= struct charset_info_st my_charset_utf8_swedish_uca_ci= { 200,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_swedish_ci", /* name */ "", /* comment */ @@ -9273,7 +9275,7 @@ struct charset_info_st my_charset_utf8_swedish_uca_ci= struct charset_info_st my_charset_utf8_turkish_uca_ci= { 201,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_turkish_ci", /* name */ "", /* comment */ @@ -9305,7 +9307,7 @@ struct charset_info_st my_charset_utf8_turkish_uca_ci= struct charset_info_st my_charset_utf8_czech_uca_ci= { 202,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_czech_ci", /* name */ "", /* comment */ @@ -9338,7 +9340,7 @@ struct charset_info_st my_charset_utf8_czech_uca_ci= struct charset_info_st my_charset_utf8_danish_uca_ci= { 203,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_danish_ci", /* name */ "", /* comment */ @@ -9370,7 +9372,7 @@ struct charset_info_st my_charset_utf8_danish_uca_ci= struct charset_info_st my_charset_utf8_lithuanian_uca_ci= { 204,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_lithuanian_ci",/* name */ "", /* comment */ @@ -9402,7 +9404,7 @@ struct charset_info_st my_charset_utf8_lithuanian_uca_ci= struct charset_info_st my_charset_utf8_slovak_uca_ci= { 205,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_slovak_ci", /* name */ "", /* comment */ @@ -9434,7 +9436,7 @@ struct charset_info_st my_charset_utf8_slovak_uca_ci= struct charset_info_st my_charset_utf8_spanish2_uca_ci= { 206,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_spanish2_ci", /* name */ "", /* comment */ @@ -9466,7 +9468,7 @@ struct charset_info_st my_charset_utf8_spanish2_uca_ci= struct charset_info_st my_charset_utf8_roman_uca_ci= { 207,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_roman_ci", /* name */ "", /* comment */ @@ -9498,7 +9500,7 @@ struct charset_info_st my_charset_utf8_roman_uca_ci= struct charset_info_st my_charset_utf8_persian_uca_ci= { 208,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_persian_ci", /* name */ "", /* comment */ @@ -9530,7 +9532,7 @@ struct charset_info_st my_charset_utf8_persian_uca_ci= struct charset_info_st my_charset_utf8_esperanto_uca_ci= { 209,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_esperanto_ci",/* name */ "", /* comment */ @@ -9562,7 +9564,7 @@ struct charset_info_st my_charset_utf8_esperanto_uca_ci= struct charset_info_st my_charset_utf8_hungarian_uca_ci= { 210,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_hungarian_ci",/* name */ "", /* comment */ @@ -9594,7 +9596,7 @@ struct charset_info_st my_charset_utf8_hungarian_uca_ci= struct charset_info_st my_charset_utf8_sinhala_uca_ci= { 211,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ "utf8", /* cs name */ "utf8_sinhala_ci", /* name */ "", /* comment */ diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 4e9724aed3c..fe25f288d5f 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. - Copyright (c) 2009, 2011, Monty Program Ab +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2013, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -4379,7 +4379,9 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), return MY_CS_TOOSMALL3; byte1= s[1]; - byte2= byte1 ? s[2] : 0; + if (byte1 == 0) + return MY_CS_ILSEQ; /* avoid possible out-of-bounds read */ + byte2= s[2]; if (byte1 >= 0x30 && byte1 <= 0x7F && byte2 >= 0x30 && byte2 <= 0x7F) |