27#ifndef SQL_LEX_HINTS_ICLUDED
28#define SQL_LEX_HINTS_ICLUDED
108 template <h
int_lex_
char_
classes Quote>
112 assert(*
ptr ==
'`' || *
ptr ==
'"' || *
ptr ==
'\'');
121 size_t double_separators = 0;
162 assert(0 < double_separators && double_separators <
yyleng);
167 if (double_separators > 0)
345 const char ret = *
ptr;
401 template <h
int_lex_
char_
classes Separator>
407 for (
const char *s = from, *
end = from + len; s <
end;) {
411 assert(hint_len > 1);
412 memcpy(t, s, hint_len);
423 memcpy(t, s,
end - s);
Lexical scanner for hint comments.
Definition: sql_lex_hints.h:55
sql_digest_state * digest_state
Digest buffer interface to append tokens.
Definition: sql_lex_hints.h:72
void adjust_token()
Definition: sql_lex_hints.h:391
Hint_scanner(THD *thd, size_t lineno_arg, const char *buf, size_t len, sql_digest_state *digest_state_arg)
Constructor.
Definition: sql_lex_hints.cc:53
int scan_ident()
Definition: sql_lex_hints.h:180
const char * raw_yytext
Current token (yytext) origin in the input_buf.
Definition: sql_lex_hints.h:78
int scan_multiplier_or_ident()
Definition: sql_lex_hints.h:198
size_t lineno
Definition: sql_lex_hints.h:59
int scan()
Definition: sql_lex_hints.cc:70
const char * input_buf
Definition: sql_lex_hints.h:62
bool eof() const
Definition: sql_lex_hints.h:317
int scan_quoted()
Definition: sql_lex_hints.h:109
void compact(LEX_STRING *to, const char *from, size_t len, size_t doubles)
Definition: sql_lex_hints.h:402
const hint_lex_char_classes * char_classes
Definition: sql_lex_hints.h:60
int scan_query_block_name()
Definition: sql_lex_hints.h:219
const CHARSET_INFO * cs
Definition: sql_lex_hints.h:57
hint_lex_char_classes peek_class() const
Definition: sql_lex_hints.h:327
void skip_byte()
Definition: sql_lex_hints.h:351
size_t yyleng
Length of the current token (see yytext)
Definition: sql_lex_hints.h:86
int scan_number_or_multiplier_or_ident()
Definition: sql_lex_hints.h:273
size_t get_lineno() const
Definition: sql_lex_hints.h:93
void skip_byte(char byte)
Skips the next byte.
Definition: sql_lex_hints.h:363
uchar get_byte()
Definition: sql_lex_hints.h:343
void add_digest(uint token)
Helper function to check digest buffer for overflow before adding tokens.
Definition: sql_lex_hints.h:449
const char * ptr
Definition: sql_lex_hints.h:65
bool has_hints
True if a hint comment is not empty (has any hints).
Definition: sql_lex_hints.h:88
const char * yytext
Current token pointer (may be converted allocated string outside input_buf.
Definition: sql_lex_hints.h:82
const char * get_ptr() const
Definition: sql_lex_hints.h:94
void skip_newline()
Definition: sql_lex_hints.h:337
const char * input_buf_end
Definition: sql_lex_hints.h:63
bool skip_mb()
Definition: sql_lex_hints.h:379
void skip_byte(const char *str)
Skips the next byte.
Definition: sql_lex_hints.h:374
hint_lex_char_classes peek_class2() const
Definition: sql_lex_hints.h:331
int scan_fraction_digits()
Definition: sql_lex_hints.h:295
THD * thd
Definition: sql_lex_hints.h:56
char peek_byte() const
Definition: sql_lex_hints.h:322
sql_digest_state * get_digest()
Definition: sql_lex_hints.h:95
int scan_ident_or_keyword()
Definition: sql_lex_hints.h:241
void syntax_warning(const char *msg) const
Push a warning message into MySQL error stack with line and position information.
Definition: sql_lex_hints.cc:136
void start_token()
Definition: sql_lex_hints.h:396
void add_hint_token_digest()
Add hint tokens to main lexer's digest calculation buffer.
Definition: sql_lex_hints.cc:149
int prev_token
Definition: sql_lex_hints.h:67
const bool is_ansi_quotes
Definition: sql_lex_hints.h:58
int get_next_token()
Definition: sql_lex_hints.h:98
static const Lex_hash hint_keywords
Definition: sql_lex_hash.h:48
const struct SYMBOL * get_hash_symbol(const char *s, unsigned int len) const
Definition: sql_lex_hash.cc:75
Definition: parse_tree_hints.h:100
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
void * alloc(size_t size)
Definition: sql_lexer_thd.h:50
bool convert_string(LEX_STRING *, const CHARSET_INFO *, const char *, size_t, const CHARSET_INFO *, bool=false)
Definition: sql_lexer_thd.h:43
const CHARSET_INFO * charset() const
Definition: sql_lexer_thd.h:42
char * strmake(const char *str, size_t size) const
Definition: sql_lexer_thd.h:52
bool charset_is_system_charset
is set if a statement accesses a temporary table created through CREATE TEMPORARY TABLE.
Definition: sql_class.h:2799
static struct wordvalue doubles[]
Definition: ctype-czech.cc:171
#define yylval
Definition: fts0pars.cc:68
A better implementation of the UNIX ctype(3) library.
unsigned my_ismbchar(const CHARSET_INFO *cs, const char *str, const char *strend)
Definition: m_ctype.h:671
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1544
#define DBUG_TRACE
Definition: my_dbug.h:146
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:52
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Definition: buf0block_hint.cc:30
Definition: commit_order_queue.h:34
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
hint_lex_char_classes
Definition: sql_chars.h:73
@ HINT_CHR_MB
Definition: sql_chars.h:83
@ HINT_CHR_NL
Definition: sql_chars.h:84
@ HINT_CHR_BACKQUOTE
Definition: sql_chars.h:76
@ HINT_CHR_DOUBLEQUOTE
Definition: sql_chars.h:80
@ HINT_CHR_QUOTE
Definition: sql_chars.h:85
@ HINT_CHR_DOT
Definition: sql_chars.h:79
@ HINT_CHR_ASTERISK
Definition: sql_chars.h:74
@ HINT_CHR_IDENT
Definition: sql_chars.h:82
@ HINT_CHR_SLASH
Definition: sql_chars.h:86
@ HINT_CHR_EOF
Definition: sql_chars.h:81
@ HINT_CHR_DIGIT
Definition: sql_chars.h:78
@ HINT_ARG_IDENT
Definition: sql_hints.yy.h:89
@ HINT_ARG_NUMBER
Definition: sql_hints.yy.h:88
@ HINT_ERROR
Definition: sql_hints.yy.h:94
@ HINT_IDENT_OR_NUMBER_WITH_SCALE
Definition: sql_hints.yy.h:92
@ HINT_ARG_TEXT
Definition: sql_hints.yy.h:91
@ HINT_ARG_FLOATING_POINT_NUMBER
Definition: sql_hints.yy.h:105
@ HINT_ARG_QB_NAME
Definition: sql_hints.yy.h:90
int my_hint_parser_lex(MY_HINT_PARSER_STYPE *yacc_yylval, Hint_scanner *scanner)
Definition: sql_lex_hints.h:469
void my_hint_parser_error(THD *, Hint_scanner *, PT_hint_list **, const char *msg)
Definition: sql_lex_hints.cc:118
sql_digest_state * digest_add_token(sql_digest_state *, uint, Lexer_yystype *)
Definition: sql_lexer.cc:53
Definition: m_ctype.h:421
Definition: mysql_lex_string.h:35
char * str
Definition: mysql_lex_string.h:36
size_t length
Definition: mysql_lex_string.h:37
Definition: lex_symbol.h:39
const unsigned int length
Definition: lex_symbol.h:41
const unsigned int tok
Definition: lex_symbol.h:42
const char * name
Definition: lex_symbol.h:40
State data storage for digest_start, digest_add_token.
Definition: sql_digest_stream.h:36
Definition: lexer_yystype.h:33
LEX_STRING lex_str
Definition: lexer_yystype.h:34
Definition: parser_yystype.h:341