41#define ROLENAME_CHAR_LENGTH 32
42#define ROLENAME_LENGTH (ROLENAME_CHAR_LENGTH * SYSTEM_CHARSET_MBMAXLEN)
47template <
int max_length>
56 assert(other.
m_length <= max_length);
67 assert(other.
m_length <= max_length);
81 void set(
const char *
str,
size_t len) {
82 assert(len <= max_length);
84 if (0 < len && len <= max_length) {
98 char *data =
reinterpret_cast<char *
>(
m_data);
105 const char *
ptr()
const {
return reinterpret_cast<const char *
>(
m_data); }
122template <
int max_length>
131 assert(other.
m_length <= max_length);
144 assert(other.
m_length <= max_length);
146 if (
this != &other) {
164 assert(len <= max_length);
166 if (0 < len && len <= max_length) {
177 const char *
ptr()
const {
return reinterpret_cast<const char *
>(
m_data); }
197 size_t buffer_len,
const char **normalized_name,
198 size_t *normalized_len);
202 void set(
const char *
str,
size_t len);
245 size_t buffer_len,
const char **normalized_name,
246 size_t *normalized_len);
250 void set(
const char *
str,
size_t len);
296 size_t buffer_len,
const char **normalized_name,
297 size_t *normalized_len);
301 void set(
const char *
str,
size_t len);
433 size_t buffer_len,
const char **normalized_name,
434 size_t *normalized_len);
438 void set(
const char *
str,
size_t len);
482 void set(
const char *
str,
size_t len);
526 void set(
const char *
str,
size_t len);
570 void set(
const char *
str,
size_t len);
614 void set(
const char *
str,
size_t len);
static int cmp(Bigint *a, Bigint *b)
Definition: dtoa.cc:1064
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:631
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:1105
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:421
Definition: pfs_name.h:123
void reset()
Definition: pfs_name.h:158
void set_view(const char *str, size_t len)
Definition: pfs_name.h:163
PFS_any_name_view(const PFS_any_name_view &other)
Definition: pfs_name.h:130
size_t m_length
Definition: pfs_name.h:191
PFS_any_name_view< max_length > & operator=(const PFS_any_name_view< max_length > &other)
Definition: pfs_name.h:142
void hash(const CHARSET_INFO *cs, uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:179
size_t length() const
Definition: pfs_name.h:175
const char * ptr() const
Definition: pfs_name.h:177
PFS_any_name_view()
Definition: pfs_name.h:125
int sort(const CHARSET_INFO *cs, const PFS_any_name_view< max_length > *other) const
Definition: pfs_name.h:183
const uchar * m_data
Definition: pfs_name.h:190
Definition: pfs_name.h:48
int sort(const CHARSET_INFO *cs, const PFS_any_name< max_length > *other) const
Definition: pfs_name.h:111
void reset()
Definition: pfs_name.h:79
size_t m_length
Definition: pfs_name.h:119
PFS_any_name()
Definition: pfs_name.h:50
const char * ptr() const
Definition: pfs_name.h:105
void casedn(const CHARSET_INFO *cs)
Definition: pfs_name.h:92
void set(const char *str, size_t len)
Definition: pfs_name.h:81
PFS_any_name< max_length > & operator=(const PFS_any_name< max_length > &other)
Definition: pfs_name.h:66
size_t length() const
Definition: pfs_name.h:103
void hash(const CHARSET_INFO *cs, uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:107
uchar m_data[max_length]
Definition: pfs_name.h:118
PFS_any_name(const PFS_any_name &other)
Definition: pfs_name.h:55
Definition: pfs_name.h:633
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:198
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:639
const CHARSET_INFO * charset() const
Definition: pfs_name.h:647
size_t length() const
Definition: pfs_name.h:645
void reset()
Definition: pfs_name.h:635
int sort(const PFS_file_name_view *other) const
Definition: pfs_name.h:641
PFS_any_name_view< FN_REFLEN > m_name
Definition: pfs_name.h:651
const char * ptr() const
Definition: pfs_name.h:646
void set_view(const char *str, size_t len)
Definition: pfs_name.h:637
Definition: pfs_name.h:610
void set(const char *str, size_t len)
Definition: pfs_name.cc:194
const CHARSET_INFO * charset() const
Definition: pfs_name.h:624
int sort(const PFS_file_name *other) const
Definition: pfs_name.h:618
const char * ptr() const
Definition: pfs_name.h:623
void reset()
Definition: pfs_name.h:612
size_t length() const
Definition: pfs_name.h:622
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:616
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:196
PFS_any_name< FN_REFLEN > m_name
Definition: pfs_name.h:630
Definition: pfs_name.h:545
const char * ptr() const
Definition: pfs_name.h:558
PFS_any_name_view< HOSTNAME_LENGTH > m_name
Definition: pfs_name.h:563
void reset()
Definition: pfs_name.h:547
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:182
int sort(const PFS_host_name_view *other) const
Definition: pfs_name.h:553
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:551
void set_view(const char *str, size_t len)
Definition: pfs_name.h:549
size_t length() const
Definition: pfs_name.h:557
const CHARSET_INFO * charset() const
Definition: pfs_name.h:559
Definition: pfs_name.h:522
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:180
const CHARSET_INFO * charset() const
Definition: pfs_name.h:536
int sort(const PFS_host_name *other) const
Definition: pfs_name.h:530
PFS_any_name< HOSTNAME_LENGTH > m_name
Definition: pfs_name.h:542
const char * ptr() const
Definition: pfs_name.h:535
void reset()
Definition: pfs_name.h:524
void set(const char *str, size_t len)
Definition: pfs_name.cc:178
size_t length() const
Definition: pfs_name.h:534
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:528
Definition: pfs_name.h:457
size_t length() const
Definition: pfs_name.h:469
void set_view(const char *str, size_t len)
Definition: pfs_name.h:461
const char * ptr() const
Definition: pfs_name.h:470
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:166
const CHARSET_INFO * charset() const
Definition: pfs_name.h:471
int sort(const PFS_index_name_view *other) const
Definition: pfs_name.h:465
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:475
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:463
void reset()
Definition: pfs_name.h:459
Definition: pfs_name.h:430
size_t length() const
Definition: pfs_name.h:446
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:447
void reset()
Definition: pfs_name.h:436
int sort(const PFS_index_name *other) const
Definition: pfs_name.h:442
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:440
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:454
const CHARSET_INFO * charset() const
Definition: pfs_name.h:448
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:162
Definition: pfs_name.h:386
void reset()
Definition: pfs_name.h:388
int sort_as_routine(const PFS_object_name_view *other) const
Definition: pfs_name.h:409
void set_view_as_table(const char *str, size_t len)
Definition: pfs_name.h:390
int sort_as_table(const PFS_object_name_view *other) const
Definition: pfs_name.h:401
void hash_as_table(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:397
PFS_object_name_view & operator=(const PFS_routine_name_view &other)
Definition: pfs_name.h:413
size_t length() const
Definition: pfs_name.h:423
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:427
void set_view_as_routine(const char *str, size_t len)
Definition: pfs_name.h:393
void hash_as_routine(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:405
PFS_object_name_view & operator=(const PFS_table_name_view &other)
Definition: pfs_name.h:418
const char * ptr() const
Definition: pfs_name.h:424
Definition: pfs_name.h:344
int sort_as_routine(const PFS_object_name *other) const
Definition: pfs_name.h:363
void reset()
Definition: pfs_name.h:346
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:383
const char * ptr() const
Definition: pfs_name.h:378
PFS_object_name & operator=(const PFS_routine_name &other)
Definition: pfs_name.h:367
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:372
size_t length() const
Definition: pfs_name.h:377
int sort_as_table(const PFS_object_name *other) const
Definition: pfs_name.h:355
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:359
void hash_as_table(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:351
Definition: pfs_name.h:589
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:595
const char * ptr() const
Definition: pfs_name.h:602
size_t length() const
Definition: pfs_name.h:601
PFS_any_name_view< ROLENAME_LENGTH > m_name
Definition: pfs_name.h:607
void reset()
Definition: pfs_name.h:591
void set_view(const char *str, size_t len)
Definition: pfs_name.h:593
int sort(const PFS_role_name_view *other) const
Definition: pfs_name.h:597
const CHARSET_INFO * charset() const
Definition: pfs_name.h:603
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:190
Definition: pfs_name.h:566
PFS_any_name< ROLENAME_LENGTH > m_name
Definition: pfs_name.h:586
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:572
int sort(const PFS_role_name *other) const
Definition: pfs_name.h:574
size_t length() const
Definition: pfs_name.h:578
void set(const char *str, size_t len)
Definition: pfs_name.cc:186
void reset()
Definition: pfs_name.h:568
const char * ptr() const
Definition: pfs_name.h:579
const CHARSET_INFO * charset() const
Definition: pfs_name.h:580
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:188
Definition: pfs_name.h:321
int sort(const PFS_routine_name_view *other) const
Definition: pfs_name.h:329
const char * ptr() const
Definition: pfs_name.h:334
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:131
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:327
void set_view(const char *str, size_t len)
Definition: pfs_name.h:325
void reset()
Definition: pfs_name.h:323
const CHARSET_INFO * charset() const
Definition: pfs_name.h:335
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:341
size_t length() const
Definition: pfs_name.h:333
Definition: pfs_name.h:293
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:303
const CHARSET_INFO * charset() const
Definition: pfs_name.h:311
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:299
size_t length() const
Definition: pfs_name.h:309
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:318
const char * ptr() const
Definition: pfs_name.h:310
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:127
int sort(const PFS_routine_name *other) const
Definition: pfs_name.h:305
void set(const char *str, size_t len)
Definition: pfs_name.cc:123
Definition: pfs_name.h:221
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:76
void reset()
Definition: pfs_name.h:223
int sort(const PFS_schema_name_view *other) const
Definition: pfs_name.h:229
void set_view(const char *str, size_t len)
Definition: pfs_name.h:225
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:227
size_t length() const
Definition: pfs_name.h:233
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:239
const CHARSET_INFO * charset() const
Definition: pfs_name.h:235
const char * ptr() const
Definition: pfs_name.h:234
Definition: pfs_name.h:194
size_t length() const
Definition: pfs_name.h:210
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:212
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:204
int sort(const PFS_schema_name *other) const
Definition: pfs_name.h:206
const char * ptr() const
Definition: pfs_name.h:211
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:200
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:218
Definition: pfs_name.h:270
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:108
void reset()
Definition: pfs_name.h:272
int sort(const PFS_table_name_view *other) const
Definition: pfs_name.h:278
PFS_any_name_view< NAME_LEN > m_name
Definition: pfs_name.h:290
size_t length() const
Definition: pfs_name.h:282
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:276
const CHARSET_INFO * charset() const
Definition: pfs_name.h:284
void set_view(const char *str, size_t len)
Definition: pfs_name.h:274
const char * ptr() const
Definition: pfs_name.h:283
Definition: pfs_name.h:242
const CHARSET_INFO * charset() const
Definition: pfs_name.h:260
void reset()
Definition: pfs_name.h:248
PFS_any_name< NAME_LEN > m_name
Definition: pfs_name.h:267
const char * ptr() const
Definition: pfs_name.h:259
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:254
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:252
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:258
Definition: pfs_name.h:501
PFS_any_name_view< USERNAME_LENGTH > m_name
Definition: pfs_name.h:519
void reset()
Definition: pfs_name.h:503
void set_view(const char *str, size_t len)
Definition: pfs_name.h:505
const char * ptr() const
Definition: pfs_name.h:514
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:174
const CHARSET_INFO * charset() const
Definition: pfs_name.h:515
size_t length() const
Definition: pfs_name.h:513
int sort(const PFS_user_name_view *other) const
Definition: pfs_name.h:509
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:507
Definition: pfs_name.h:478
const char * ptr() const
Definition: pfs_name.h:491
size_t length() const
Definition: pfs_name.h:490
void set(const char *str, size_t len)
Definition: pfs_name.cc:170
void reset()
Definition: pfs_name.h:480
int sort(const PFS_user_name *other) const
Definition: pfs_name.h:486
static const CHARSET_INFO * get_cs()
Definition: pfs_name.cc:172
PFS_any_name< USERNAME_LENGTH > m_name
Definition: pfs_name.h:498
const CHARSET_INFO * charset() const
Definition: pfs_name.h:492
void hash(uint64 *nr1, uint64 *nr2) const
Definition: pfs_name.h:484