maria-developers team mailing list archive
Mailing list archive
Re: d221068ae8b: Change CHARSET_INFO character set and collaction names to LEX_CSTRING
On Apr 01, Michael Widenius wrote:
> revision-id: d221068ae8b (mariadb-10.5.2-540-gd221068ae8b)
> parent(s): 896c3b0a00a
> author: Michael Widenius <michael.widenius@xxxxxxxxx>
> committer: Michael Widenius <michael.widenius@xxxxxxxxx>
> timestamp: 2021-03-24 19:13:42 +0200
> Change CHARSET_INFO character set and collaction names to LEX_CSTRING
> This change removed 68 strlen() calls from the code.
> The following renames was to ensure we don't use the old names
> when merging code from earlier releases, as using the new variables
> for print function could result in crashes:
> - charset->csname renamed to charset->cs_name
> - charset->name renamed to charset->col_name
1. please, use coll_name.
in our codebase "cs" conventionally means "charset", "col"
is usually used for "column", "coll" - for "collation"
2. You changed the client api, as can be seen from
> diff --git a/client/mysql.cc b/client/mysql.cc
> index e6c7d0f091c..8c64d01539d 100644
> --- a/client/mysql.cc
> +++ b/client/mysql.cc
> @@ -4719,9 +4719,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
> return -1; // Retryable
> - charset_info= get_charset_by_name(mysql.charset->name, MYF(0));
> + charset_info= get_charset_by_name(IF_EMBEDDED(mysql.charset->col_name.str,
> + mysql.charset->name), MYF(0));
> #ifndef EMBEDDED_LIBRARY
> mysql_options(&mysql, MYSQL_OPT_RECONNECT, &debug_info_flag);
Luckily, C/C is a separate project now, so most clients won't be
affected. But anything linking with embedded might be.
VP of MariaDB Server Engineering