My Project
|
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>
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_parser * | sql_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) |
Text .frm files management routines.
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.
[in,out] | ptr | pointer to parameter |
[in] | end | end of the configuration |
[in] | line | pointer to the line begining |
[in] | base | base address for parameter writing (structure like TABLE) |
[in] | parameter | description |
[in] | mem_root | MEM_ROOT for parameters allocation |
const char* parse_escaped_string | ( | const char * | ptr, |
const char * | end, | ||
MEM_ROOT * | mem_root, | ||
LEX_STRING * | str | ||
) |
parse \n delimited escaped string.
ptr | pointer on string beginning |
end | pointer on symbol after parsed string end (still owned by buffer and can be accessed |
mem_root | MEM_ROOT for parameter allocation |
str | pointer on string, where results should be stored |
0 | error |
\:: | pointer on symbol after string |
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.
ptr | pointer on string beginning |
eol | pointer on character after end of string |
str | target string |
FALSE | OK |
TRUE | error |
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
schema | name of given schema |
old_name | original file name |
new_db | new schema |
new_name | new file name |
0 | OK |
1 | Error (only if renaming of frm failed) |
my_bool sql_create_definition_file | ( | const LEX_STRING * | dir, |
const LEX_STRING * | file_name, | ||
const LEX_STRING * | type, | ||
uchar * | base, | ||
File_option * | parameters | ||
) |
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).
file_name | path & filename to .frm file |
mem_root | MEM_ROOT for buffer allocation |
bad_format_errors | send errors on bad content |