MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Load_log_processor Class Reference

Classes

struct  File_name_record

Public Member Functions

int init ()
void init_by_dir_name (const char *dir)
void init_by_cur_dir ()
void destroy ()
Create_file_log_eventgrab_event (uint file_id)
char * grab_fname (uint file_id)
Exit_status process (Create_file_log_event *ce)
Exit_status process (Begin_load_query_log_event *ce)
Exit_status process (Append_block_log_event *ae)
File prepare_new_file_for_old_format (Load_log_event *le, char *filename)
Exit_status load_old_format_file (NET *net, const char *server_fname, uint server_fname_len, File file)
Exit_status process_first_event (const char *bname, size_t blen, const uchar *block, size_t block_len, uint file_id, Create_file_log_event *ce)

Detailed Description

Definition at line 216 of file mysqlbinlog.cc.

Member Function Documentation

Create_file_log_event* Load_log_processor::grab_event ( uint  file_id)
inline

Obtain Create_file event for LOAD DATA statement by its file_id and remove it from this Load_log_processor's list of events.

Checks whether we have already seen a Create_file_log_event with the given file_id. If yes, returns a pointer to the event and removes the event from array describing active temporary files. From this moment, the caller is responsible for freeing the memory occupied by the event.

Parameters
[in]file_idFile id identifying LOAD DATA statement.
Returns
Pointer to Create_file_log_event, or NULL if we have not seen any Create_file_log_event with this file_id.

Definition at line 327 of file mysqlbinlog.cc.

char* Load_log_processor::grab_fname ( uint  file_id)
inline

Obtain file name of temporary file for LOAD DATA statement by its file_id and remove it from this Load_log_processor's list of events.

Parameters
[in]file_idIdentifier for the LOAD DATA statement.

Checks whether we have already seen Begin_load_query event for this file_id. If yes, returns the file name of the corresponding temporary file and removes the filename from the array of active temporary files. From this moment, the caller is responsible for freeing the memory occupied by this name.

Returns
String with the name of the temporary file, or NULL if we have not seen any Begin_load_query_event with this file_id.

Definition at line 355 of file mysqlbinlog.cc.

Exit_status Load_log_processor::load_old_format_file ( NET net,
const char *  server_fname,
uint  server_fname_len,
File  file 
)

Reads a file from a server and saves it locally.

Parameters
[in,out]netThe server to read from.
[in]server_fnameThe name of the file that the server should read.
[in]server_fname_lenThe length of server_fname.
[in,out]fileThe file to write to.
Return values
ERROR_STOPAn error occurred - the program should terminate.
OK_CONTINUENo error, the program should continue.

Definition at line 431 of file mysqlbinlog.cc.

Here is the call graph for this function:

File Load_log_processor::prepare_new_file_for_old_format ( Load_log_event le,
char *  filename 
)

Creates and opens a new temporary file in the directory specified by previous call to init_by_dir_name() or init_by_cur_dir().

Parameters
[in]leThe basename of the created file will start with the basename of the file pointed to by this Load_log_event.
[out]filenameBuffer to save the filename in.
Returns
File handle >= 0 on success, -1 on error.

Definition at line 393 of file mysqlbinlog.cc.

Exit_status Load_log_processor::process ( Create_file_log_event ce)

Process the given Create_file_log_event.

See Also
Load_log_processor::process_first_event(const char*,uint,const char*,uint,uint,Create_file_log_event*)
Parameters
ceCreate_file_log_event to process.
Return values
ERROR_STOPAn error occurred - the program should terminate.
OK_CONTINUENo error, the program should continue.

Definition at line 580 of file mysqlbinlog.cc.

Here is the call graph for this function:

Exit_status Load_log_processor::process ( Begin_load_query_log_event blqe)

Process the given Begin_load_query_log_event.

See Also
Load_log_processor::process_first_event(const char*,uint,const char*,uint,uint,Create_file_log_event*)
Parameters
ceBegin_load_query_log_event to process.
Return values
ERROR_STOPAn error occurred - the program should terminate.
OK_CONTINUENo error, the program should continue.

Definition at line 600 of file mysqlbinlog.cc.

Here is the call graph for this function:

Exit_status Load_log_processor::process ( Append_block_log_event ae)

Process the given Append_block_log_event.

Appends the chunk of the file contents specified by the event to the file created by a previous Begin_load_query_log_event or Create_file_log_event.

If the file_id for the event does not correspond to any file previously registered through a Begin_load_query_log_event or Create_file_log_event, this member function will print a warning and return OK_CONTINUE. It is safe to return OK_CONTINUE, because no query will be written for this event. We should not print an error and fail, since the missing file_id could be because a (valid) –start-position has been specified after the Begin/Create event but before this Append event.

Parameters
aeAppend_block_log_event to process.
Return values
ERROR_STOPAn error occurred - the program should terminate.
OK_CONTINUENo error, the program should continue.

Definition at line 629 of file mysqlbinlog.cc.

Exit_status Load_log_processor::process_first_event ( const char *  bname,
size_t  blen,
const uchar *  block,
size_t  block_len,
uint  file_id,
Create_file_log_event ce 
)

Process the first event in the sequence of events representing a LOAD DATA statement.

Creates a temporary file to be used in LOAD DATA and writes first block of data to it. Registers its file name (and optional Create_file event) in the array of active temporary files.

Parameters
bnameBase name for temporary file to be created.
blenBase name length.
blockFirst block of data to be loaded.
block_lenFirst block length.
file_idIdentifies the LOAD DATA statement.
cePointer to Create_file event object if we are processing this type of event.
Return values
ERROR_STOPAn error occurred - the program should terminate.
OK_CONTINUENo error, the program should continue.

Definition at line 501 of file mysqlbinlog.cc.

Here is the caller graph for this function:


The documentation for this class was generated from the following file: