MySQL 9.1.0
Source Code Documentation
charset.cc File Reference
#include <fcntl.h>
#include <sys/types.h>
#include <cassert>
#include <cstdarg>
#include <cstdint>
#include <cstring>
#include <deque>
#include <memory>
#include <mutex>
#include <new>
#include <string>
#include <string_view>
#include "my_config.h"
#include "m_string.h"
#include "map_helpers.h"
#include "my_dbug.h"
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_sys.h"
#include "mysql/my_loglevel.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/service_mysql_alloc.h"
#include "mysql/strings/collations.h"
#include "mysql/strings/int2str.h"
#include "mysql/strings/m_ctype.h"
#include "mysys/mysys_priv.h"
#include "mysys_err.h"
#include "nulls.h"
#include "strings/collations_internal.h"
#include "strmake.h"
#include "strxmov.h"

Classes

class  anonymous_namespace{charset.cc}::Mysys_charset_loader
 

Namespaces

namespace  anonymous_namespace{charset.cc}
 

Functions

static mysql::collation_internals::Collationsentry ()
 
static void default_reporter (loglevel, uint errcode, va_list)
 Report character set initialization errors and warnings. More...
 
char * get_charsets_dir (char *buf)
 
static void init_available_charsets ()
 
uint get_collation_number (const char *collation_name)
 
unsigned get_charset_number (const char *cs_name, uint cs_flags)
 
const char * get_collation_name (uint charset_number)
 
CHARSET_INFOget_charset (uint cs_number, myf flags)
 
template<size_t N>
bool anonymous_namespace{charset.cc}::starts_with (std::string_view name, const char(&prefix)[N])
 
CHARSET_INFOmy_collation_get_by_name (const char *collation_name, myf flags, MY_CHARSET_ERRMSG *errmsg)
 Find collation by name: extended version of get_charset_by_name() to return error messages to the caller. More...
 
CHARSET_INFOget_charset_by_name (const char *collation_name, myf flags)
 
CHARSET_INFOmy_charset_get_by_name (const char *cs_name, uint cs_flags, myf flags, MY_CHARSET_ERRMSG *errmsg)
 Find character set by name: extended version of get_charset_by_csname() to return error messages to the caller. More...
 
CHARSET_INFOget_charset_by_csname (const char *cs_name, uint cs_flags, myf flags)
 
bool resolve_charset (const char *cs_name, const CHARSET_INFO *default_cs, const CHARSET_INFO **cs)
 Resolve character set by the character set name (utf8, latin1, ...). More...
 
bool resolve_collation (const char *cl_name, const CHARSET_INFO *default_cl, const CHARSET_INFO **cl)
 Resolve collation by the collation name (utf8_general_ci, ...). More...
 
void charset_uninit ()
 

Variables

my_error_vreporter my_charset_error_reporter = default_reporter
 
constexpr size_t MY_MAX_ALLOWED_BUF = static_cast<size_t>(1024) * 1024
 
const char * charsets_dir = nullptr
 
const CHARSET_INFOall_charsets [MY_ALL_CHARSETS_SIZE] = {nullptr}
 
CHARSET_INFOdefault_charset_info = &my_charset_latin1
 
static std::once_flag charsets_initialized
 
static Mysys_charset_loader * loader = nullptr
 

Function Documentation

◆ default_reporter()

static void default_reporter ( loglevel  ,
uint  errcode,
va_list   
)
static

Report character set initialization errors and warnings.

Be silent by default: no warnings on the client side.

◆ entry()

◆ init_available_charsets()

static void init_available_charsets ( )
static

Variable Documentation

◆ charsets_initialized

std::once_flag charsets_initialized
static

◆ loader

Mysys_charset_loader* loader = nullptr
static

◆ MY_MAX_ALLOWED_BUF

constexpr size_t MY_MAX_ALLOWED_BUF = static_cast<size_t>(1024) * 1024
constexpr