MySQL 9.5.0
Source Code Documentation
anonymous_namespace{charset.cc} Namespace Reference

Classes

class  Mysys_charset_loader
 

Functions

bool starts_with_utf8 (const char *name)
 
int utf8_alias_lookup (const char *cname)
 What does "utf8" mean, "utf8mb3" or "utf8mb4"? More...
 

Function Documentation

◆ starts_with_utf8()

bool anonymous_namespace{charset.cc}::starts_with_utf8 ( const char *  name)

◆ utf8_alias_lookup()

int anonymous_namespace{charset.cc}::utf8_alias_lookup ( const char *  cname)

What does "utf8" mean, "utf8mb3" or "utf8mb4"?

We ask 'current_thd' whether MODE_INTERPRET_UTF8_AS_UTF8MB4 has been set in SQL_MODE.

We return 3 or 4 to indicate what alias is active. A special value 42 is used during bootstrap: reject command line arguments, and abort. There are no lookups during shutdown.

For client-side requests (e.g. mysql –default-character-set=utf8) we always return 3.

Parameters
[in]cnameCharset/Collation name, used during bootstrap to give the desired error message.
Returns
3,4,42 to indicate what alias to use, or to abort.