diff options
| author | Alexander Barkov <bar@mariadb.com> | 2020-01-26 20:27:13 +0400 |
|---|---|---|
| committer | Alexander Barkov <bar@mariadb.com> | 2020-01-28 12:29:23 +0400 |
| commit | f1e13fdc8d9e78f4529aa60b6a9b49c6ff063c66 (patch) | |
| tree | ce84da1deeea573be5be7db7d739a4c9ba9b40f8 /sql/sql_time.cc | |
| parent | dd68ba74f357aca074609cbd77491ed4ba390369 (diff) | |
| download | mariadb-git-f1e13fdc8d9e78f4529aa60b6a9b49c6ff063c66.tar.gz | |
MDEV-21581 Helper functions and methods for CHARSET_INFO
Diffstat (limited to 'sql/sql_time.cc')
| -rw-r--r-- | sql/sql_time.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index b128a7f7291..8a9311ae577 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. - Copyright (c) 2009, 2013 Monty Program Ab. + Copyright (c) 2009, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -338,9 +338,9 @@ to_ascii(CHARSET_INFO *cs, const char *srcend= src + src_length; char *dst0= dst, *dstend= dst + dst_length - 1; while (dst < dstend && - (cnvres= (cs->cset->mb_wc)(cs, &wc, - (const uchar*) src, - (const uchar*) srcend)) > 0 && + (cnvres= cs->mb_wc(&wc, + (const uchar*) src, + (const uchar*) srcend)) > 0 && wc < 128) { src+= cnvres; @@ -734,9 +734,7 @@ bool parse_date_time_format(timestamp_type format_type, this. If separators are used, they must be between each part */ if (format_length == 6 && !need_p && - !my_strnncoll(&my_charset_bin, - (const uchar *) format, 6, - (const uchar *) format_str, 6)) + !my_charset_bin.strnncoll(format, 6, format_str, 6)) return 0; if (separator_map == (1 | 2)) { @@ -757,9 +755,9 @@ bool parse_date_time_format(timestamp_type format_type, Between DATE and TIME we also allow space as separator */ if ((format_length == 12 && !need_p && - !my_strnncoll(&my_charset_bin, - (const uchar *) format, 12, - (const uchar*) known_date_time_formats[INTERNAL_FORMAT].datetime_format, + !my_charset_bin.strnncoll( + format, 12, + known_date_time_formats[INTERNAL_FORMAT].datetime_format, 12)) || (separators == 5 && separator_map == (1 | 2 | 8 | 16))) return 0; |
