41#define ROLENAME_CHAR_LENGTH 32
42#define ROLENAME_LENGTH (ROLENAME_CHAR_LENGTH * SYSTEM_CHARSET_MBMAXLEN)
47template <
int max_length>
53 assert(other.
m_length <= max_length);
64 assert(other.
m_length <= max_length);
77 void set(
const char *
str,
size_t len) {
78 assert(len <= max_length);
80 if (0 < len && len <= max_length) {
94 char *data =
reinterpret_cast<char *
>(
m_data);
101 const char *
ptr()
const {
return reinterpret_cast<const char *
>(
m_data); }
118template <
int max_length>
127 assert(other.
m_length <= max_length);
140 assert(other.
m_length <= max_length);
158 assert(len <= max_length);
160 if (0 < len && len <= max_length) {
171 const char *
ptr()
const {
return reinterpret_cast<const char *
>(
m_data); }
191 size_t buffer_len,
const char **normalized_name,
192 size_t *normalized_len);
196 void set(
const char *
str,
size_t len);
239 size_t buffer_len,
const char **normalized_name,
240 size_t *normalized_len);
244 void set(
const char *
str,
size_t len);
290 size_t buffer_len,
const char **normalized_name,
291 size_t *normalized_len);
295 void set(
const char *
str,
size_t len);
427 size_t buffer_len,
const char **normalized_name,
428 size_t *normalized_len);
432 void set(
const char *
str,
size_t len);
476 void set(
const char *
str,
size_t len);
520 void set(
const char *
str,
size_t len);
564 void set(
const char *
str,
size_t len);
608 void set(
const char *
str,
size_t len);
static int cmp(Bigint *a, Bigint *b)
Definition: dtoa.cc:1059
A better implementation of the UNIX ctype(3) library.
int my_strnncoll(const CHARSET_INFO *cs, const uint8_t *a, size_t a_length, const uint8_t *b, size_t b_length)
Definition: m_ctype.h:633
Common definition used by mysys, performance schema and server & client.
Some integer typedefs for easier portability.
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:1081
Definition: commit_order_queue.h:34
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:423
Definition: pfs_name.h:119
void reset()
Definition: pfs_name.h:152
void set_view(const char *str, size_t len)
Definition: pfs_name.h:157
PFS_any_name_view(const PFS_any_name_view &other)
Definition: pfs_name.h:126
size_t m_length
Definition: pfs_name.h:185
PFS_any_name_view< max_length > & operator=(const PFS_any_name_view< max_length > &other)
Definition: pfs_name.h:138
void hash(const CHARSET_INFO *cs, uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:173
size_t length() const
Definition: pfs_name.h:169
const char * ptr() const
Definition: pfs_name.h:171
PFS_any_name_view()
Definition: pfs_name.h:121
int sort(const CHARSET_INFO *cs, const PFS_any_name_view< max_length > *other) const
Definition: pfs_name.h:177
const uchar * m_data
Definition: pfs_name.h:184
Definition: pfs_name.h:48
int sort(const CHARSET_INFO *cs, const PFS_any_name< max_length > *other) const
Definition: pfs_name.h:107
void reset()
Definition: pfs_name.h:75
size_t m_length
Definition: pfs_name.h:115
PFS_any_name()
Definition: pfs_name.h:50
const char * ptr() const
Definition: pfs_name.h:101
void casedn(const CHARSET_INFO *cs)
Definition: pfs_name.h:88
void set(const char *str, size_t len)
Definition: pfs_name.h:77
PFS_any_name< max_length > & operator=(const PFS_any_name< max_length > &other)
Definition: pfs_name.h:63
size_t length() const
Definition: pfs_name.h:99
void hash(const CHARSET_INFO *cs, uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:103
uchar m_data[max_length]
Definition: pfs_name.h:114
PFS_any_name(const PFS_any_name &other)
Definition: pfs_name.h:52
Definition: pfs_name.h:627
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:198
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:633
const CHARSET_INFO * charset() const
Definition: pfs_name.h:641
size_t length() const
Definition: pfs_name.h:639
void reset()
Definition: pfs_name.h:629
int sort(const PFS_file_name_view *other) const
Definition: pfs_name.h:635
PFS_any_name_view< FN_REFLEN > m_name
Definition: pfs_name.h:645
const char * ptr() const
Definition: pfs_name.h:640
void set_view(const char *str, size_t len)
Definition: pfs_name.h:631
Definition: pfs_name.h:604
void set(const char *str, size_t len)
Definition: pfs_name.cc:194
const CHARSET_INFO * charset() const
Definition: pfs_name.h:618
int sort(const PFS_file_name *other) const
Definition: pfs_name.h:612
const char * ptr() const
Definition: pfs_name.h:617
void reset()
Definition: pfs_name.h:606
size_t length() const
Definition: pfs_name.h:616
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:610
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:196
PFS_any_name< FN_REFLEN > m_name
Definition: pfs_name.h:624
Definition: pfs_name.h:539
const char * ptr() const
Definition: pfs_name.h:552
PFS_any_name_view< HOSTNAME_LENGTH > m_name
Definition: pfs_name.h:557
void reset()
Definition: pfs_name.h:541
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:182
int sort(const PFS_host_name_view *other) const
Definition: pfs_name.h:547
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:545
void set_view(const char *str, size_t len)
Definition: pfs_name.h:543
size_t length() const
Definition: pfs_name.h:551
const CHARSET_INFO * charset() const
Definition: pfs_name.h:553
Definition: pfs_name.h:516
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:180
const CHARSET_INFO * charset() const
Definition: pfs_name.h:530
int sort(const PFS_host_name *other) const
Definition: pfs_name.h:524
PFS_any_name< HOSTNAME_LENGTH > m_name
Definition: pfs_name.h:536
const char * ptr() const
Definition: pfs_name.h:529
void reset()
Definition: pfs_name.h:518
void set(const char *str, size_t len)
Definition: pfs_name.cc:178
size_t length() const
Definition: pfs_name.h:528
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:522
Definition: pfs_name.h:451
size_t length() const
Definition: pfs_name.h:463
void set_view(const char *str, size_t len)
Definition: pfs_name.h:455
const char * ptr() const
Definition: pfs_name.h:464
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:166
const CHARSET_INFO * charset() const
Definition: pfs_name.h:465
int sort(const PFS_index_name_view *other) const
Definition: pfs_name.h:459
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:469
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:457
void reset()
Definition: pfs_name.h:453
Definition: pfs_name.h:424
size_t length() const
Definition: pfs_name.h:440
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:441
void reset()
Definition: pfs_name.h:430
int sort(const PFS_index_name *other) const
Definition: pfs_name.h:436
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:434
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:448
const CHARSET_INFO * charset() const
Definition: pfs_name.h:442
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:162
Definition: pfs_name.h:380
void reset()
Definition: pfs_name.h:382
int sort_as_routine(const PFS_object_name_view *other) const
Definition: pfs_name.h:403
void set_view_as_table(const char *str, size_t len)
Definition: pfs_name.h:384
int sort_as_table(const PFS_object_name_view *other) const
Definition: pfs_name.h:395
void hash_as_table(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:391
PFS_object_name_view & operator=(const PFS_routine_name_view &other)
Definition: pfs_name.h:407
size_t length() const
Definition: pfs_name.h:417
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:421
void set_view_as_routine(const char *str, size_t len)
Definition: pfs_name.h:387
void hash_as_routine(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:399
PFS_object_name_view & operator=(const PFS_table_name_view &other)
Definition: pfs_name.h:412
const char * ptr() const
Definition: pfs_name.h:418
Definition: pfs_name.h:338
int sort_as_routine(const PFS_object_name *other) const
Definition: pfs_name.h:357
void reset()
Definition: pfs_name.h:340
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:377
const char * ptr() const
Definition: pfs_name.h:372
PFS_object_name & operator=(const PFS_routine_name &other)
Definition: pfs_name.h:361
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:366
size_t length() const
Definition: pfs_name.h:371
int sort_as_table(const PFS_object_name *other) const
Definition: pfs_name.h:349
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:353
void hash_as_table(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:345
Definition: pfs_name.h:583
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:589
const char * ptr() const
Definition: pfs_name.h:596
size_t length() const
Definition: pfs_name.h:595
PFS_any_name_view< ROLENAME_LENGTH > m_name
Definition: pfs_name.h:601
void reset()
Definition: pfs_name.h:585
void set_view(const char *str, size_t len)
Definition: pfs_name.h:587
int sort(const PFS_role_name_view *other) const
Definition: pfs_name.h:591
const CHARSET_INFO * charset() const
Definition: pfs_name.h:597
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:190
Definition: pfs_name.h:560
PFS_any_name< ROLENAME_LENGTH > m_name
Definition: pfs_name.h:580
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:566
int sort(const PFS_role_name *other) const
Definition: pfs_name.h:568
size_t length() const
Definition: pfs_name.h:572
void set(const char *str, size_t len)
Definition: pfs_name.cc:186
void reset()
Definition: pfs_name.h:562
const char * ptr() const
Definition: pfs_name.h:573
const CHARSET_INFO * charset() const
Definition: pfs_name.h:574
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:188
Definition: pfs_name.h:315
int sort(const PFS_routine_name_view *other) const
Definition: pfs_name.h:323
const char * ptr() const
Definition: pfs_name.h:328
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:131
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:321
void set_view(const char *str, size_t len)
Definition: pfs_name.h:319
void reset()
Definition: pfs_name.h:317
const CHARSET_INFO * charset() const
Definition: pfs_name.h:329
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:335
size_t length() const
Definition: pfs_name.h:327
Definition: pfs_name.h:287
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:297
const CHARSET_INFO * charset() const
Definition: pfs_name.h:305
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:293
size_t length() const
Definition: pfs_name.h:303
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:312
const char * ptr() const
Definition: pfs_name.h:304
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:127
int sort(const PFS_routine_name *other) const
Definition: pfs_name.h:299
void set(const char *str, size_t len)
Definition: pfs_name.cc:123
Definition: pfs_name.h:215
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:76
void reset()
Definition: pfs_name.h:217
int sort(const PFS_schema_name_view *other) const
Definition: pfs_name.h:223
void set_view(const char *str, size_t len)
Definition: pfs_name.h:219
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:221
size_t length() const
Definition: pfs_name.h:227
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:233
const CHARSET_INFO * charset() const
Definition: pfs_name.h:229
const char * ptr() const
Definition: pfs_name.h:228
Definition: pfs_name.h:188
size_t length() const
Definition: pfs_name.h:204
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:206
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:198
int sort(const PFS_schema_name *other) const
Definition: pfs_name.h:200
const char * ptr() const
Definition: pfs_name.h:205
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:194
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:212
Definition: pfs_name.h:264
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:108
void reset()
Definition: pfs_name.h:266
int sort(const PFS_table_name_view *other) const
Definition: pfs_name.h:272
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:284
size_t length() const
Definition: pfs_name.h:276
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:270
const CHARSET_INFO * charset() const
Definition: pfs_name.h:278
void set_view(const char *str, size_t len)
Definition: pfs_name.h:268
const char * ptr() const
Definition: pfs_name.h:277
Definition: pfs_name.h:236
const CHARSET_INFO * charset() const
Definition: pfs_name.h:254
void reset()
Definition: pfs_name.h:242
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:261
const char * ptr() const
Definition: pfs_name.h:253
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:248
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:246
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:252
Definition: pfs_name.h:495
PFS_any_name_view< USERNAME_LENGTH > m_name
Definition: pfs_name.h:513
void reset()
Definition: pfs_name.h:497
void set_view(const char *str, size_t len)
Definition: pfs_name.h:499
const char * ptr() const
Definition: pfs_name.h:508
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:174
const CHARSET_INFO * charset() const
Definition: pfs_name.h:509
size_t length() const
Definition: pfs_name.h:507
int sort(const PFS_user_name_view *other) const
Definition: pfs_name.h:503
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:501
Definition: pfs_name.h:472
const char * ptr() const
Definition: pfs_name.h:485
size_t length() const
Definition: pfs_name.h:484
void set(const char *str, size_t len)
Definition: pfs_name.cc:170
void reset()
Definition: pfs_name.h:474
int sort(const PFS_user_name *other) const
Definition: pfs_name.h:480
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:172
PFS_any_name< USERNAME_LENGTH > m_name
Definition: pfs_name.h:492
const CHARSET_INFO * charset() const
Definition: pfs_name.h:486
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:478