39#define ROLENAME_CHAR_LENGTH 32
40#define ROLENAME_LENGTH (ROLENAME_CHAR_LENGTH * SYSTEM_CHARSET_MBMAXLEN)
45template <
int max_length>
51 assert(other.
m_length <= max_length);
62 assert(other.
m_length <= max_length);
75 void set(
const char *
str,
size_t len) {
76 assert(len <= max_length);
78 if (0 < len && len <= max_length) {
92 char *data =
reinterpret_cast<char *
>(
m_data);
99 const char *
ptr()
const {
return reinterpret_cast<const char *
>(
m_data); }
116template <
int max_length>
125 assert(other.
m_length <= max_length);
138 assert(other.
m_length <= max_length);
156 assert(len <= max_length);
158 if (0 < len && len <= max_length) {
169 const char *
ptr()
const {
return reinterpret_cast<const char *
>(
m_data); }
189 size_t buffer_len,
const char **normalized_name,
190 size_t *normalized_len);
194 void set(
const char *
str,
size_t len);
237 size_t buffer_len,
const char **normalized_name,
238 size_t *normalized_len);
242 void set(
const char *
str,
size_t len);
288 size_t buffer_len,
const char **normalized_name,
289 size_t *normalized_len);
293 void set(
const char *
str,
size_t len);
425 size_t buffer_len,
const char **normalized_name,
426 size_t *normalized_len);
430 void set(
const char *
str,
size_t len);
474 void set(
const char *
str,
size_t len);
518 void set(
const char *
str,
size_t len);
562 void set(
const char *
str,
size_t len);
606 void set(
const char *
str,
size_t len);
static int cmp(Bigint *a, Bigint *b)
Definition: dtoa.cc:1062
A better implementation of the UNIX ctype(3) library.
#define my_strnncoll(s, a, b, c, d)
Definition: m_ctype.h:712
Common definition used by mysys, performance schema and server & client.
unsigned char uchar
Definition: my_inttypes.h:52
uint64_t uint64
Definition: my_inttypes.h:69
Common definition between mysql server & client.
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
Definition: commit_order_queue.h:34
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
case opt name
Definition: sslopt-case.h:33
Definition: m_ctype.h:385
Definition: pfs_name.h:117
void reset()
Definition: pfs_name.h:150
void set_view(const char *str, size_t len)
Definition: pfs_name.h:155
PFS_any_name_view(const PFS_any_name_view &other)
Definition: pfs_name.h:124
size_t m_length
Definition: pfs_name.h:183
PFS_any_name_view< max_length > & operator=(const PFS_any_name_view< max_length > &other)
Definition: pfs_name.h:136
void hash(const CHARSET_INFO *cs, uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:171
size_t length() const
Definition: pfs_name.h:167
const char * ptr() const
Definition: pfs_name.h:169
PFS_any_name_view()
Definition: pfs_name.h:119
int sort(const CHARSET_INFO *cs, const PFS_any_name_view< max_length > *other) const
Definition: pfs_name.h:175
const uchar * m_data
Definition: pfs_name.h:182
Definition: pfs_name.h:46
int sort(const CHARSET_INFO *cs, const PFS_any_name< max_length > *other) const
Definition: pfs_name.h:105
void reset()
Definition: pfs_name.h:73
size_t m_length
Definition: pfs_name.h:113
PFS_any_name()
Definition: pfs_name.h:48
const char * ptr() const
Definition: pfs_name.h:99
void casedn(const CHARSET_INFO *cs)
Definition: pfs_name.h:86
void set(const char *str, size_t len)
Definition: pfs_name.h:75
PFS_any_name< max_length > & operator=(const PFS_any_name< max_length > &other)
Definition: pfs_name.h:61
size_t length() const
Definition: pfs_name.h:97
PFS_any_name(const PFS_any_name< max_length > &other)
Definition: pfs_name.h:50
void hash(const CHARSET_INFO *cs, uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:101
uchar m_data[max_length]
Definition: pfs_name.h:112
Definition: pfs_name.h:625
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:198
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:631
const CHARSET_INFO * charset() const
Definition: pfs_name.h:639
size_t length() const
Definition: pfs_name.h:637
void reset()
Definition: pfs_name.h:627
int sort(const PFS_file_name_view *other) const
Definition: pfs_name.h:633
PFS_any_name_view< FN_REFLEN > m_name
Definition: pfs_name.h:643
const char * ptr() const
Definition: pfs_name.h:638
void set_view(const char *str, size_t len)
Definition: pfs_name.h:629
Definition: pfs_name.h:602
void set(const char *str, size_t len)
Definition: pfs_name.cc:194
const CHARSET_INFO * charset() const
Definition: pfs_name.h:616
int sort(const PFS_file_name *other) const
Definition: pfs_name.h:610
const char * ptr() const
Definition: pfs_name.h:615
void reset()
Definition: pfs_name.h:604
size_t length() const
Definition: pfs_name.h:614
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:608
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:196
PFS_any_name< FN_REFLEN > m_name
Definition: pfs_name.h:622
Definition: pfs_name.h:537
const char * ptr() const
Definition: pfs_name.h:550
PFS_any_name_view< HOSTNAME_LENGTH > m_name
Definition: pfs_name.h:555
void reset()
Definition: pfs_name.h:539
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:182
int sort(const PFS_host_name_view *other) const
Definition: pfs_name.h:545
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:543
void set_view(const char *str, size_t len)
Definition: pfs_name.h:541
size_t length() const
Definition: pfs_name.h:549
const CHARSET_INFO * charset() const
Definition: pfs_name.h:551
Definition: pfs_name.h:514
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:180
const CHARSET_INFO * charset() const
Definition: pfs_name.h:528
int sort(const PFS_host_name *other) const
Definition: pfs_name.h:522
PFS_any_name< HOSTNAME_LENGTH > m_name
Definition: pfs_name.h:534
const char * ptr() const
Definition: pfs_name.h:527
void reset()
Definition: pfs_name.h:516
void set(const char *str, size_t len)
Definition: pfs_name.cc:178
size_t length() const
Definition: pfs_name.h:526
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:520
Definition: pfs_name.h:449
size_t length() const
Definition: pfs_name.h:461
void set_view(const char *str, size_t len)
Definition: pfs_name.h:453
const char * ptr() const
Definition: pfs_name.h:462
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:166
const CHARSET_INFO * charset() const
Definition: pfs_name.h:463
int sort(const PFS_index_name_view *other) const
Definition: pfs_name.h:457
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:467
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:455
void reset()
Definition: pfs_name.h:451
Definition: pfs_name.h:422
size_t length() const
Definition: pfs_name.h:438
static void normalize(const char *name, size_t name_len, char *buffer, size_t buffer_len, const char **normalized_name, size_t *normalized_len)
Definition: pfs_name.cc:149
void set(const char *str, size_t len)
Definition: pfs_name.cc:160
const char * ptr() const
Definition: pfs_name.h:439
void reset()
Definition: pfs_name.h:428
int sort(const PFS_index_name *other) const
Definition: pfs_name.h:434
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:432
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:446
const CHARSET_INFO * charset() const
Definition: pfs_name.h:440
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:162
Definition: pfs_name.h:378
void reset()
Definition: pfs_name.h:380
int sort_as_routine(const PFS_object_name_view *other) const
Definition: pfs_name.h:401
void set_view_as_table(const char *str, size_t len)
Definition: pfs_name.h:382
int sort_as_table(const PFS_object_name_view *other) const
Definition: pfs_name.h:393
void hash_as_table(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:389
PFS_object_name_view & operator=(const PFS_routine_name_view &other)
Definition: pfs_name.h:405
size_t length() const
Definition: pfs_name.h:415
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:419
void set_view_as_routine(const char *str, size_t len)
Definition: pfs_name.h:385
void hash_as_routine(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:397
PFS_object_name_view & operator=(const PFS_table_name_view &other)
Definition: pfs_name.h:410
const char * ptr() const
Definition: pfs_name.h:416
Definition: pfs_name.h:336
int sort_as_routine(const PFS_object_name *other) const
Definition: pfs_name.h:355
void reset()
Definition: pfs_name.h:338
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:375
const char * ptr() const
Definition: pfs_name.h:370
PFS_object_name & operator=(const PFS_routine_name &other)
Definition: pfs_name.h:359
void set_as_table(const char *str, size_t len)
Definition: pfs_name.cc:136
PFS_object_name & operator=(const PFS_table_name &other)
Definition: pfs_name.h:364
size_t length() const
Definition: pfs_name.h:369
int sort_as_table(const PFS_object_name *other) const
Definition: pfs_name.h:347
void set_as_routine(const char *str, size_t len)
Definition: pfs_name.cc:145
void hash_as_routine(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:351
void hash_as_table(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:343
Definition: pfs_name.h:581
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:587
const char * ptr() const
Definition: pfs_name.h:594
size_t length() const
Definition: pfs_name.h:593
PFS_any_name_view< ROLENAME_LENGTH > m_name
Definition: pfs_name.h:599
void reset()
Definition: pfs_name.h:583
void set_view(const char *str, size_t len)
Definition: pfs_name.h:585
int sort(const PFS_role_name_view *other) const
Definition: pfs_name.h:589
const CHARSET_INFO * charset() const
Definition: pfs_name.h:595
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:190
Definition: pfs_name.h:558
PFS_any_name< ROLENAME_LENGTH > m_name
Definition: pfs_name.h:578
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:564
int sort(const PFS_role_name *other) const
Definition: pfs_name.h:566
size_t length() const
Definition: pfs_name.h:570
void set(const char *str, size_t len)
Definition: pfs_name.cc:186
void reset()
Definition: pfs_name.h:560
const char * ptr() const
Definition: pfs_name.h:571
const CHARSET_INFO * charset() const
Definition: pfs_name.h:572
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:188
Definition: pfs_name.h:313
int sort(const PFS_routine_name_view *other) const
Definition: pfs_name.h:321
const char * ptr() const
Definition: pfs_name.h:326
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:131
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:319
void set_view(const char *str, size_t len)
Definition: pfs_name.h:317
void reset()
Definition: pfs_name.h:315
const CHARSET_INFO * charset() const
Definition: pfs_name.h:327
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:333
size_t length() const
Definition: pfs_name.h:325
Definition: pfs_name.h:285
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:295
const CHARSET_INFO * charset() const
Definition: pfs_name.h:303
static void normalize(const char *name, size_t name_len, char *buffer, size_t buffer_len, const char **normalized_name, size_t *normalized_len)
Definition: pfs_name.cc:112
void reset()
Definition: pfs_name.h:291
size_t length() const
Definition: pfs_name.h:301
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:310
const char * ptr() const
Definition: pfs_name.h:302
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:127
int sort(const PFS_routine_name *other) const
Definition: pfs_name.h:297
void set(const char *str, size_t len)
Definition: pfs_name.cc:123
Definition: pfs_name.h:213
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:76
void reset()
Definition: pfs_name.h:215
int sort(const PFS_schema_name_view *other) const
Definition: pfs_name.h:221
void set_view(const char *str, size_t len)
Definition: pfs_name.h:217
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:219
size_t length() const
Definition: pfs_name.h:225
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:231
const CHARSET_INFO * charset() const
Definition: pfs_name.h:227
const char * ptr() const
Definition: pfs_name.h:226
Definition: pfs_name.h:186
size_t length() const
Definition: pfs_name.h:202
void set(const char *str, size_t len)
Definition: pfs_name.cc:64
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:72
const CHARSET_INFO * charset() const
Definition: pfs_name.h:204
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:196
int sort(const PFS_schema_name *other) const
Definition: pfs_name.h:198
const char * ptr() const
Definition: pfs_name.h:203
static void normalize(const char *name, size_t name_len, char *buffer, size_t buffer_len, const char **normalized_name, size_t *normalized_len)
Definition: pfs_name.cc:48
void reset()
Definition: pfs_name.h:192
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:210
Definition: pfs_name.h:262
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:108
void reset()
Definition: pfs_name.h:264
int sort(const PFS_table_name_view *other) const
Definition: pfs_name.h:270
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:282
size_t length() const
Definition: pfs_name.h:274
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:268
const CHARSET_INFO * charset() const
Definition: pfs_name.h:276
void set_view(const char *str, size_t len)
Definition: pfs_name.h:266
const char * ptr() const
Definition: pfs_name.h:275
Definition: pfs_name.h:234
const CHARSET_INFO * charset() const
Definition: pfs_name.h:252
void reset()
Definition: pfs_name.h:240
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:259
const char * ptr() const
Definition: pfs_name.h:251
static void normalize(const char *name, size_t name_len, char *buffer, size_t buffer_len, const char **normalized_name, size_t *normalized_len)
Definition: pfs_name.cc:80
int sort(const PFS_table_name *other) const
Definition: pfs_name.h:246
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:244
void set(const char *str, size_t len)
Definition: pfs_name.cc:96
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:104
size_t length() const
Definition: pfs_name.h:250
Definition: pfs_name.h:493
PFS_any_name_view< USERNAME_LENGTH > m_name
Definition: pfs_name.h:511
void reset()
Definition: pfs_name.h:495
void set_view(const char *str, size_t len)
Definition: pfs_name.h:497
const char * ptr() const
Definition: pfs_name.h:506
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:174
const CHARSET_INFO * charset() const
Definition: pfs_name.h:507
size_t length() const
Definition: pfs_name.h:505
int sort(const PFS_user_name_view *other) const
Definition: pfs_name.h:501
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:499
Definition: pfs_name.h:470
const char * ptr() const
Definition: pfs_name.h:483
size_t length() const
Definition: pfs_name.h:482
void set(const char *str, size_t len)
Definition: pfs_name.cc:170
void reset()
Definition: pfs_name.h:472
int sort(const PFS_user_name *other) const
Definition: pfs_name.h:478
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:172
PFS_any_name< USERNAME_LENGTH > m_name
Definition: pfs_name.h:490
const CHARSET_INFO * charset() const
Definition: pfs_name.h:484
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:476