diff options
author | unknown <bar@mysql.com> | 2005-02-12 16:27:22 +0400 |
---|---|---|
committer | unknown <bar@mysql.com> | 2005-02-12 16:27:22 +0400 |
commit | 2d619d7cadf45348614884d4cde7ded316e47412 (patch) | |
tree | aa6d8694606f182775199d4d1e5895786acdaf32 /strings | |
parent | a505845044cba059fb1c6579cb6ea5b78399d733 (diff) | |
download | mariadb-git-2d619d7cadf45348614884d4cde7ded316e47412.tar.gz |
Bug#8235 Connection collation change & table create with default result in crash
mysql-test/r/ctype_ucs.result:
Test case
mysql-test/t/ctype_ucs.test:
Test case
sql/field.cc:
Fixed minus check to be UCS2-compatible
strings/ctype-ucs2.c:
Missing my_scan_ucs2() was added.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-ucs2.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index ea11f8816a5..e92704b83d7 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1480,6 +1480,29 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs, return 0; } + +ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *end, int sequence_type) +{ + const char *str0= str; + end--; /* for easier loop condition, because of two bytes per character */ + + switch (sequence_type) + { + case MY_SEQ_SPACES: + for ( ; str < end; str+= 2) + { + if (str[0] != '\0' || str[1] != ' ') + break; + } + return str - str0; + default: + return 0; + } +} + + + static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = { NULL, /* init */ @@ -1534,7 +1557,7 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler= my_strntoull_ucs2, my_strntod_ucs2, my_strtoll10_ucs2, - my_scan_8bit + my_scan_ucs2 }; |