MySQL 8.4.0
Source Code Documentation
anonymous_namespace{ha_myisammrg.cc} Namespace Reference

Functions

int myisammrg_parent_open_callback (void *callback_param, const char *filename)
 Callback function for open of a MERGE parent table. More...
 
MI_INFOmyisammrg_attach_children_callback (void *callback_param)
 Callback function for attaching a MERGE child table. More...
 

Function Documentation

◆ myisammrg_attach_children_callback()

MI_INFO * anonymous_namespace{ha_myisammrg.cc}::myisammrg_attach_children_callback ( void *  callback_param)

Callback function for attaching a MERGE child table.

Parameters
[in]callback_paramdata pointer as given to myrg_attach_children() this is used to pass the handler handle
Returns
pointer to open MyISAM table structure
Return values
!=NULLOK, returning pointer
NULL,Error.

This function retrieves the MyISAM table handle from the next child table. It is called for each child table.

◆ myisammrg_parent_open_callback()

int anonymous_namespace{ha_myisammrg.cc}::myisammrg_parent_open_callback ( void *  callback_param,
const char *  filename 
)

Callback function for open of a MERGE parent table.

Parameters
[in]callback_paramdata pointer as given to myrg_parent_open() this is used to pass the handler handle
[in]filenamefile name of MyISAM table without extension.
Returns
status
Return values
0OK
!=0 Error

This function adds a Table_ref object for a MERGE child table to a list of tables in the parent handler object. It is called for each child table.

The list of child Table_ref objects is kept in the handler object of the parent for the whole life time of the MERGE table. It is inserted in the statement query list behind the MERGE parent Table_ref object when the MERGE table is opened. It is removed from the statement query list at end of statement or at children detach.

All memory used for the child Table_ref objects and the strings referred by it are taken from the parent ha_myisammrg::children_mem_root. Thus they are all freed implicitly at the final close of the table.

children_l -> Table_ref::next_global -> Table_ref::next_global

# ^ # ^

# | # |

# +------— Table_ref::prev_global

# |

|<— Table_ref::prev_global |

|

children_last_l --------------------------------------—+