MySQL  8.0.27
Source Code Documentation
bootstrap Namespace Reference

Classes

struct  handle_bootstrap_args
 
class  Command_iterator
 Abstract interface to reading bootstrap commands. More...
 
class  File_command_iterator
 File bootstrap command reader. More...
 

Typedefs

typedef bool(* bootstrap_functor) (THD *thd)
 

Functions

static char * mysql_file_fgets_fn (char *buffer, size_t size, MYSQL_FILE *input, int *error)
 
static void bootstrap_log_error (const char *message)
 
static int process_iterator (THD *thd, Command_iterator *it, bool enforce_invariants)
 
static bool handle_bootstrap_impl (handle_bootstrap_args *args)
 
static int process_iterator (THD *thd, Command_iterator *it, bool enforce_invariants[[maybe_unused]])
 
static void * handle_bootstrap (void *arg)
 Execute commands from bootstrap_file. More...
 
bool run_bootstrap_thread (const char *file_name, MYSQL_FILE *file, bootstrap_functor boot_handler, enum_thread_type thread_type)
 Create a thread to execute all commands from the submitted file. More...
 

Typedef Documentation

◆ bootstrap_functor

typedef bool(* bootstrap::bootstrap_functor) (THD *thd)

Function Documentation

◆ bootstrap_log_error()

static void bootstrap::bootstrap_log_error ( const char *  message)
static

◆ handle_bootstrap()

static void* bootstrap::handle_bootstrap ( void *  arg)
static

Execute commands from bootstrap_file.

Used when creating the initial grant tables.

◆ handle_bootstrap_impl()

static bool bootstrap::handle_bootstrap_impl ( handle_bootstrap_args args)
static

◆ mysql_file_fgets_fn()

static char* bootstrap::mysql_file_fgets_fn ( char *  buffer,
size_t  size,
MYSQL_FILE input,
int *  error 
)
static

◆ process_iterator() [1/2]

static int bootstrap::process_iterator ( THD thd,
Command_iterator it,
bool  enforce_invariants 
)
static

◆ process_iterator() [2/2]

static int bootstrap::process_iterator ( THD thd,
Command_iterator it,
bool enforce_invariants]  [[maybe_unused] 
)
static

◆ run_bootstrap_thread()

bool bootstrap::run_bootstrap_thread ( const char *  file_name,
MYSQL_FILE file,
bootstrap_functor  boot_handler,
enum_thread_type  thread_type 
)

Create a thread to execute all commands from the submitted file.

By providing an explicit bootstrap handler functor, the default behavior of reading and executing SQL commands from the submitted file may be customized.

Parameters
file_nameName of the init file with SQL statements, if non-null
fileHandle of the init file with SQL statements, if non-null
boot_handlerOptional functor for customized handling
thread_typeBootstrap thread type, server initialize or init file
Returns
False if no errors