MySQL 9.0.0
Source Code Documentation
parse_file.cc File Reference
#include "sql/parse_file.h"
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include "my_alloc.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_sys.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/strings/my_strtoll10.h"
#include "mysqld_error.h"
#include "sql/mysqld.h"
#include "sql/sql_list.h"

Functions

File_parsersql_parse_prepare (const LEX_STRING *file_name, MEM_ROOT *mem_root, bool bad_format_errors)
 Prepare frm to parse (read to memory). More...
 
static const char * parse_string (const char *ptr, const char *end, MEM_ROOT *mem_root, LEX_STRING *str)
 parse LEX_STRING. More...
 
static bool read_escaped_string (const char *ptr, const char *eol, LEX_STRING *str)
 read escaped string from ptr to eol in already allocated str. More...
 
static const char * parse_escaped_string (const char *ptr, const char *end, MEM_ROOT *mem_root, LEX_STRING *str)
 parse \n delimited escaped string. More...
 
static const char * parse_quoted_escaped_string (const char *ptr, const char *end, MEM_ROOT *mem_root, LEX_STRING *str)
 parse '' delimited escaped string. More...
 
bool get_file_options_ulllist (const char *&ptr, const char *end, const char *line, uchar *base, File_option *parameter, MEM_ROOT *mem_root)
 Parser for FILE_OPTIONS_ULLLIST type value. More...
 

Variables

File_parser_dummy_hook file_parser_dummy_hook
 

Function Documentation

◆ get_file_options_ulllist()

bool get_file_options_ulllist ( const char *&  ptr,
const char *  end,
const char *  line,
uchar base,
File_option parameter,
MEM_ROOT mem_root 
)

Parser for FILE_OPTIONS_ULLLIST type value.

Parameters
[in,out]ptrpointer to parameter
[in]endend of the configuration
[in]linepointer to the line beginning
[in]basebase address for parameter writing (structure like TABLE)
[in]parameterdescription
[in]mem_rootMEM_ROOT for parameters allocation

◆ parse_escaped_string()

static const char * parse_escaped_string ( const char *  ptr,
const char *  end,
MEM_ROOT mem_root,
LEX_STRING str 
)
static

parse \n delimited escaped string.

Parameters
ptrpointer on string beginning
endpointer on symbol after parsed string end (still owned by buffer and can be accessed
mem_rootMEM_ROOT for parameter allocation
strpointer on string, where results should be stored
Returns
Pointer on symbol after string
Return values
0error

◆ parse_quoted_escaped_string()

static const char * parse_quoted_escaped_string ( const char *  ptr,
const char *  end,
MEM_ROOT mem_root,
LEX_STRING str 
)
static

parse '' delimited escaped string.

Parameters
ptrpointer on string beginning
endpointer on symbol after parsed string end (still owned by buffer and can be accessed
mem_rootMEM_ROOT for parameter allocation
strpointer on string, where results should be stored
Returns
Pointer on symbol after string
Return values
0error

◆ parse_string()

static const char * parse_string ( const char *  ptr,
const char *  end,
MEM_ROOT mem_root,
LEX_STRING str 
)
static

parse LEX_STRING.

Parameters
ptrpointer on string beginning
endpointer on symbol after parsed string end (still owned by buffer and can be accessed
mem_rootMEM_ROOT for parameter allocation
strpointer on string, where results should be stored
Returns
Pointer on symbol after string
Return values
0error

◆ read_escaped_string()

static bool read_escaped_string ( const char *  ptr,
const char *  eol,
LEX_STRING str 
)
static

read escaped string from ptr to eol in already allocated str.

Parameters
ptrpointer on string beginning
eolpointer on character after end of string
strtarget string
Return values
falseOK
trueerror

◆ sql_parse_prepare()

File_parser * sql_parse_prepare ( const LEX_STRING file_name,
MEM_ROOT mem_root,
bool  bad_format_errors 
)

Prepare frm to parse (read to memory).

Parameters
file_namepath & filename to .frm file
mem_rootMEM_ROOT for buffer allocation
bad_format_errorssend errors on bad content
Note
returned pointer + 1 will be type of .frm
Returns
0 - error
parser object

Variable Documentation

◆ file_parser_dummy_hook

File_parser_dummy_hook file_parser_dummy_hook