24#ifndef STRINGS_COLLATIONS_INTERNAL_H_
25#define STRINGS_COLLATIONS_INTERNAL_H_
31#include <unordered_map>
46namespace collation_internals {
251 template <
typename Key>
252 using Hash = std::unordered_map<Key, CHARSET_INFO *>;
static Mysys_charset_loader * loader
Definition: charset.cc:185
User-specified callback interface for collation parser/initializer.
Definition: m_ctype.h:189
Normalizes character set/collation names.
Definition: collations.h:63
Helper class: implementation of character set/collation library.
Definition: collations_internal.h:53
Hash< std::string > m_all_by_collation_name
Maps normalized strings of all known character set names, collation names, and their aliases to CHARS...
Definition: collations_internal.h:266
unsigned get_default_binary_collation_id(const mysql::collation::Name &name) const
Finds character set by its name and returns an id of its default binary collation.
Definition: collations_internal.cc:675
MY_CHARSET_LOADER * m_loader
Shared MY_CHARSET_LOADER implementation for use in collation parser and initializer.
Definition: collations_internal.h:297
CHARSET_INFO * find_by_name_unsafe(const mysql::collation::Name &name)
Like find_by_name but without initialization of return value.
Definition: collations_internal.cc:747
CHARSET_INFO * find_primary(const mysql::collation::Name &cs_name, myf flags=0, MY_CHARSET_ERRMSG *errmsg=nullptr)
Finds primary collation by its character set name.
Definition: collations_internal.cc:650
Hash< std::string > m_binary_by_cs_name
Maps normalized strings of character set names to CHARSET_INFO objects of preferred binary collations...
Definition: collations_internal.h:284
void iterate(const std::function< void(const CHARSET_INFO *)> &f)
Iterate over all collation objects known to the library.
Definition: collations_internal.h:212
CHARSET_INFO * find_by_name(const mysql::collation::Name &name, myf flags=0, MY_CHARSET_ERRMSG *errmsg=nullptr)
Finds collation by its name.
Definition: collations_internal.cc:639
Hash< unsigned > m_all_by_id
Maps collation ids to CHARSET_INFO object pointers.
Definition: collations_internal.h:257
unsigned get_primary_collation_id(const mysql::collation::Name &name) const
Finds character set by its name and returns an id of its primary collation.
Definition: collations_internal.cc:669
Collations(const Collations &)=delete
const std::string m_charset_dir
Optional '/'-terminated path to the directory containing Index.xml.
Definition: collations_internal.h:240
~Collations()
Definition: collations_internal.cc:627
CHARSET_INFO * unsafe_init(CHARSET_INFO *cs, myf flags, MY_CHARSET_ERRMSG *errmsg)
Internals of safe_init_when_necessary()
Definition: collations_internal.cc:697
Collations & operator=(const Collations &)=delete
Hash< std::string > m_primary_by_cs_name
Maps normalized strings of character set names to CHARSET_INFO object pointers.
Definition: collations_internal.h:275
std::mutex m_mutex
Collation parser/initializer mutex.
Definition: collations_internal.h:307
unsigned get_collation_id(const mysql::collation::Name &name) const
Finds collation by its name and returns its id.
Definition: collations_internal.cc:663
std::unordered_map< Key, CHARSET_INFO * > Hash
Common parametric type to map character set/collation names or their ids to CHARSET_INFO object point...
Definition: collations_internal.h:252
bool add_internal_collation(CHARSET_INFO *cs)
For registering compile-time collations.
Definition: collations_internal.cc:719
CHARSET_INFO * find_default_binary(const mysql::collation::Name &cs_name, myf flags=0, MY_CHARSET_ERRMSG *errmsg=nullptr)
Finds binary collation by its character set name.
Definition: collations_internal.cc:656
CHARSET_INFO * find_by_id(unsigned id, myf flags=0, MY_CHARSET_ERRMSG *errmsg=nullptr)
Finds collation by its number.
Definition: collations_internal.cc:645
const bool m_owns_loader
False if m_loader references external MY_CHARSET_LOADER, otherwise true.
Definition: collations_internal.h:289
CHARSET_INFO * safe_init_when_necessary(CHARSET_INFO *cs, myf flags=0, MY_CHARSET_ERRMSG *errmsg=nullptr)
If not done yet, force collation parsing/initialization under m_mutex lock.
Definition: collations_internal.cc:681
int myf
Definition: collations_internal.h:38
constexpr char MY_CHARSET_INDEX[]
Definition: collations_internal.h:36
static int flags[50]
Definition: hp_test1.cc:40
A better implementation of the UNIX ctype(3) library.
int myf
Definition: my_inttypes.h:94
const char * collation
Definition: audit_api_message_emit.cc:184
Definition: commit_order_queue.h:34
Collations * entry
Global entry point to character set/collation library internals.
Definition: collations_internal.cc:41
Definition: instrumented_condition_variable.h:32
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
Helper structure to return error messages from collation parser/initializer.
Definition: m_ctype.h:180