26#ifndef SQL_LEX_HINTS_ICLUDED
27#define SQL_LEX_HINTS_ICLUDED
44#ifndef YYSTYPE_IS_DECLARED
45#define YYSTYPE_IS_DECLARED 1
113 template <h
int_lex_
char_
classes Quote>
117 assert(*
ptr ==
'`' || *
ptr ==
'"' || *
ptr ==
'\'');
126 size_t double_separators = 0;
167 assert(0 < double_separators && double_separators <
yyleng);
172 if (double_separators > 0)
406 template <h
int_lex_
char_
classes Separator>
412 for (
const char *s = from, *
end = from + len; s <
end;) {
416 assert(hint_len > 1);
417 memcpy(t, s, hint_len);
428 memcpy(t, s,
end - s);
Lexical scanner for hint comments.
Definition: sql_lex_hints.h:60
sql_digest_state * digest_state
Digest buffer interface to append tokens.
Definition: sql_lex_hints.h:77
void adjust_token()
Definition: sql_lex_hints.h:396
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:52
int scan_ident()
Definition: sql_lex_hints.h:185
const char * raw_yytext
Current token (yytext) origin in the input_buf.
Definition: sql_lex_hints.h:83
int scan_multiplier_or_ident()
Definition: sql_lex_hints.h:203
size_t lineno
Definition: sql_lex_hints.h:64
int scan()
Definition: sql_lex_hints.cc:69
const char * input_buf
Definition: sql_lex_hints.h:67
bool eof() const
Definition: sql_lex_hints.h:322
int scan_quoted()
Definition: sql_lex_hints.h:114
void compact(LEX_STRING *to, const char *from, size_t len, size_t doubles)
Definition: sql_lex_hints.h:407
const hint_lex_char_classes * char_classes
Definition: sql_lex_hints.h:65
int scan_query_block_name()
Definition: sql_lex_hints.h:224
const CHARSET_INFO * cs
Definition: sql_lex_hints.h:62
hint_lex_char_classes peek_class() const
Definition: sql_lex_hints.h:332
void skip_byte()
Definition: sql_lex_hints.h:356
size_t yyleng
Length of the current token (see yytext)
Definition: sql_lex_hints.h:91
int scan_number_or_multiplier_or_ident()
Definition: sql_lex_hints.h:278
size_t get_lineno() const
Definition: sql_lex_hints.h:98
void skip_byte(char byte)
Skips the next byte.
Definition: sql_lex_hints.h:368
uchar get_byte()
Definition: sql_lex_hints.h:348
void add_digest(uint token)
Helper function to check digest buffer for overflow before adding tokens.
Definition: sql_lex_hints.h:454
const char * ptr
Definition: sql_lex_hints.h:70
bool has_hints
True if a hint comment is not empty (has any hints).
Definition: sql_lex_hints.h:93
const char * yytext
Current token pointer (may be converted allocated string outside input_buf.
Definition: sql_lex_hints.h:87
const char * get_ptr() const
Definition: sql_lex_hints.h:99
void skip_newline()
Definition: sql_lex_hints.h:342
const char * input_buf_end
Definition: sql_lex_hints.h:68
bool skip_mb()
Definition: sql_lex_hints.h:384
void skip_byte(const char *str)
Skips the next byte.
Definition: sql_lex_hints.h:379
hint_lex_char_classes peek_class2() const
Definition: sql_lex_hints.h:336
int scan_fraction_digits()
Definition: sql_lex_hints.h:300
THD * thd
Definition: sql_lex_hints.h:61
char peek_byte() const
Definition: sql_lex_hints.h:327
sql_digest_state * get_digest()
Definition: sql_lex_hints.h:100
int scan_ident_or_keyword()
Definition: sql_lex_hints.h:246
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:135
void start_token()
Definition: sql_lex_hints.h:401
void add_hint_token_digest()
Add hint tokens to main lexer's digest calculation buffer.
Definition: sql_lex_hints.cc:148
int prev_token
Definition: sql_lex_hints.h:72
const bool is_ansi_quotes
Definition: sql_lex_hints.h:63
int get_next_token()
Definition: sql_lex_hints.h:103
static const Lex_hash hint_keywords
Definition: sql_lex_hash.h:47
const struct SYMBOL * get_hash_symbol(const char *s, unsigned int len) const
Definition: sql_lex_hash.cc:74
Definition: parse_tree_hints.h:97
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
void * alloc(size_t size)
Definition: sql_lexer_thd.h:47
bool convert_string(LEX_STRING *, const CHARSET_INFO *, const char *, size_t, const CHARSET_INFO *, bool=false)
Definition: sql_lexer_thd.h:40
const CHARSET_INFO * charset() const
Definition: sql_lexer_thd.h:39
char * strmake(const char *str, size_t size) const
Definition: sql_lexer_thd.h:49
bool charset_is_system_charset
is set if a statement accesses a temporary table created through CREATE TEMPORARY TABLE.
Definition: sql_class.h:2716
static struct wordvalue doubles[]
Definition: ctype-czech.cc:170
#define yylval
Definition: fts0pars.cc:68
A better implementation of the UNIX ctype(3) library.
static uint my_ismbchar(const CHARSET_INFO *cs, const char *str, const char *strend)
Definition: m_ctype.h:714
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1541
#define DBUG_TRACE
Definition: my_dbug.h:145
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:51
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1054
Definition: buf0block_hint.cc:29
Definition: commit_order_queue.h:33
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191
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:81
@ HINT_ARG_NUMBER
Definition: sql_hints.yy.h:80
@ HINT_ERROR
Definition: sql_hints.yy.h:86
@ HINT_IDENT_OR_NUMBER_WITH_SCALE
Definition: sql_hints.yy.h:84
@ HINT_ARG_TEXT
Definition: sql_hints.yy.h:83
@ HINT_ARG_FLOATING_POINT_NUMBER
Definition: sql_hints.yy.h:97
@ HINT_ARG_QB_NAME
Definition: sql_hints.yy.h:82
void HINT_PARSER_error(THD *, Hint_scanner *, PT_hint_list **, const char *msg)
Definition: sql_lex_hints.cc:117
int HINT_PARSER_lex(YYSTYPE *yacc_yylval, Hint_scanner *scanner)
Definition: sql_lex_hints.h:474
void hint_lex_init_maps(CHARSET_INFO *cs, hint_lex_char_classes *hint_map)
sql_digest_state * digest_add_token(sql_digest_state *, uint, Lexer_yystype *)
Definition: sql_lexer.cc:53
Definition: m_ctype.h:382
Definition: mysql_lex_string.h:34
char * str
Definition: mysql_lex_string.h:35
size_t length
Definition: mysql_lex_string.h:36
Definition: lex_symbol.h:38
const unsigned int length
Definition: lex_symbol.h:40
const unsigned int tok
Definition: lex_symbol.h:41
const char * name
Definition: lex_symbol.h:39
State data storage for digest_start, digest_add_token.
Definition: sql_digest_stream.h:35
unsigned int uint
Definition: uca9-dump.cc:74
Definition: lexer_yystype.h:32
LEX_STRING lex_str
Definition: lexer_yystype.h:33
Definition: parser_yystype.h:344