MySQL 8.3.0
Source Code Documentation
sql_bootstrap.h File Reference
#include <stddef.h>
#include <functional>
#include "map_helpers.h"

Go to the source code of this file.

Classes

struct  bootstrap_parser_position
 
struct  bootstrap_parser_state
 

Macros

#define MAX_BOOTSTRAP_QUERY_SIZE   74000
 The maximum size of a bootstrap query. More...
 
#define MAX_BOOTSTRAP_LINE_SIZE   74000
 The maximum size of a bootstrap query, expressed in a single line. More...
 

Typedefs

typedef char *(* fgets_fn_t) (char *, size_t, MYSQL_FILE *, int *error)
 

Enumerations

enum  bootstrap_error {
  READ_BOOTSTRAP_SUCCESS = 0 , READ_BOOTSTRAP_EOF , READ_BOOTSTRAP_IO , READ_BOOTSTRAP_DELIMITER ,
  READ_BOOTSTRAP_SQ_NOT_TERMINATED , READ_BOOTSTRAP_DQ_NOT_TERMINATED , READ_BOOTSTRAP_COMMENT_NOT_TERMINATED , READ_BOOTSTRAP_QUERY_SIZE ,
  READ_BOOTSTRAP_ERROR
}
 
enum  delimiter_state { DELIMITER_SEMICOLON , DELIMITER_DOLLAR_DOLLAR }
 
enum  code_parsing_state {
  NORMAL , IN_SINGLE_QUOTE , IN_DOUBLE_QUOTE , IN_DASH_DASH_COMMENT ,
  IN_SLASH_STAR_COMMENT , IN_POUND_COMMENT
}
 

Functions

int read_bootstrap_query (char *query, size_t *query_length, MYSQL_FILE *input, fgets_fn_t fgets_fn, bootstrap_parser_state *state)
 

Macro Definition Documentation

◆ MAX_BOOTSTRAP_LINE_SIZE

#define MAX_BOOTSTRAP_LINE_SIZE   74000

The maximum size of a bootstrap query, expressed in a single line.

Do not increase this size, use the multiline syntax instead.

◆ MAX_BOOTSTRAP_QUERY_SIZE

#define MAX_BOOTSTRAP_QUERY_SIZE   74000

The maximum size of a bootstrap query.

Increase this size if parsing a longer query during bootstrap is necessary. The longest query in use depends on the documentation content, see the file fill_help_tables.sql

Typedef Documentation

◆ fgets_fn_t

typedef char *(* fgets_fn_t) (char *, size_t, MYSQL_FILE *, int *error)

Enumeration Type Documentation

◆ bootstrap_error

Enumerator
READ_BOOTSTRAP_SUCCESS 
READ_BOOTSTRAP_EOF 
READ_BOOTSTRAP_IO 
READ_BOOTSTRAP_DELIMITER 
READ_BOOTSTRAP_SQ_NOT_TERMINATED 
READ_BOOTSTRAP_DQ_NOT_TERMINATED 
READ_BOOTSTRAP_COMMENT_NOT_TERMINATED 
READ_BOOTSTRAP_QUERY_SIZE 
READ_BOOTSTRAP_ERROR 

◆ code_parsing_state

Enumerator
NORMAL 

Parsing sql code.

IN_SINGLE_QUOTE 

Parsing a 'literal' string.

IN_DOUBLE_QUOTE 

Parsing a "literal" string.

IN_DASH_DASH_COMMENT 

Parsing a "--" comment.

IN_SLASH_STAR_COMMENT 

Parsing a '/''*' comment.

IN_POUND_COMMENT 

Parsing a '#' comment.

◆ delimiter_state

Enumerator
DELIMITER_SEMICOLON 

Delimiter is ';'.

DELIMITER_DOLLAR_DOLLAR 

Delimiter is "$$".

Function Documentation

◆ read_bootstrap_query()

int read_bootstrap_query ( char *  query,
size_t *  query_length,
MYSQL_FILE input,
fgets_fn_t  fgets_fn,
bootstrap_parser_state state 
)