MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
parse_file.cc File Reference

Text .frm files management routines. More...

#include "sql_priv.h"
#include "parse_file.h"
#include "unireg.h"
#include "sql_table.h"
#include <errno.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <my_dir.h>
Include dependency graph for parse_file.cc:

Go to the source code of this file.

Functions

long mysql_rm_arc_files (THD *thd, MY_DIR *dirp, const char *org_path)
my_bool sql_create_definition_file (const LEX_STRING *dir, const LEX_STRING *file_name, const LEX_STRING *type, uchar *base, File_option *parameters)
my_bool rename_in_schema_file (THD *thd, const char *schema, const char *old_name, const char *new_db, const char *new_name)
File_parsersql_parse_prepare (const LEX_STRING *file_name, MEM_ROOT *mem_root, bool bad_format_errors)
my_bool read_escaped_string (const char *ptr, const char *eol, LEX_STRING *str)
const char * parse_escaped_string (const char *ptr, const char *end, MEM_ROOT *mem_root, LEX_STRING *str)
bool get_file_options_ulllist (const char *&ptr, const char *end, const char *line, uchar *base, File_option *parameter, MEM_ROOT *mem_root)

Detailed Description

Text .frm files management routines.

Definition in file parse_file.cc.

Function Documentation

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 begining
[in]basebase address for parameter writing (structure like TABLE)
[in]parameterdescription
[in]mem_rootMEM_ROOT for parameters allocation

Definition at line 630 of file parse_file.cc.

Here is the caller graph for this function:

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

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
Return values
0error
\::pointer on symbol after string

Definition at line 560 of file parse_file.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

my_bool read_escaped_string ( const char *  ptr,
const char *  eol,
LEX_STRING str 
)

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

Definition at line 499 of file parse_file.cc.

Here is the caller graph for this function:

my_bool rename_in_schema_file ( THD *  thd,
const char *  schema,
const char *  old_name,
const char *  new_db,
const char *  new_name 
)

Renames a frm file (including backups) in same schema.

thread handler

Parameters
schemaname of given schema
old_nameoriginal file name
new_dbnew schema
new_namenew file name
Return values
0OK
1Error (only if renaming of frm failed)

Definition at line 317 of file parse_file.cc.

my_bool sql_create_definition_file ( const LEX_STRING dir,
const LEX_STRING file_name,
const LEX_STRING type,
uchar *  base,
File_option parameters 
)

Write new .frm.

Parameters
dirdirectory where put .frm
file_name.frm file name
type.frm type string (VIEW, TABLE)
basebase address for parameter reading (structure like TABLE)
parametersparameters description
Return values
FALSEOK
TRUEerror

Definition at line 211 of file parse_file.cc.

Here is the caller graph for this function:

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

Definition at line 362 of file parse_file.cc.

Here is the caller graph for this function: