InnoDB Plugin  1.0
Macros | Enumerations | Functions | Variables
srv0start.h File Reference
#include "univ.i"
#include "log0log.h"
#include "ut0byte.h"
Include dependency graph for srv0start.h:

Go to the source code of this file.

Macros

#define SRV_PATH_SEPARATOR   '/'
#define SRV_LOG_SPACE_FIRST_ID   0xFFFFFFF0UL

Enumerations

enum  srv_shutdown_state {
  SRV_SHUTDOWN_NONE = 0, SRV_SHUTDOWN_CLEANUP, SRV_SHUTDOWN_FLUSH_PHASE, SRV_SHUTDOWN_LAST_PHASE,
  SRV_SHUTDOWN_EXIT_THREADS
}

Functions

UNIV_INTERN void srv_normalize_path_for_win (char *str)
UNIV_INTERN ibool srv_parse_data_file_paths_and_sizes (char *str)
UNIV_INTERN void srv_free_paths_and_sizes (void)
UNIV_INTERN char * srv_add_path_separator_if_needed (char *str)
UNIV_INTERN dberr_t innobase_start_or_create_for_mysql (void)
UNIV_INTERN dberr_t innobase_shutdown_for_mysql (void)
UNIV_INTERN void srv_shutdown_table_bg_threads (void)
UNIV_INTERN ulint srv_path_copy (char *dest, ulint dest_len, const char *basedir, const char *table_name))
UNIV_INTERN void srv_get_meta_data_filename (dict_table_t *table, char *filename, ulint max_len))

Variables

lsn_t srv_shutdown_lsn
lsn_t srv_start_lsn
ibool srv_is_being_started
ibool srv_was_started
ibool srv_startup_is_before_trx_rollback_phase
ibool srv_start_raw_disk_in_use
enum srv_shutdown_state srv_shutdown_state

Detailed Description

Starts the Innobase database server

Created 10/10/1995 Heikki Tuuri

Macro Definition Documentation

#define SRV_LOG_SPACE_FIRST_ID   0xFFFFFFF0UL

Log 'spaces' have id's >= this

Enumeration Type Documentation

Shutdown state

Enumerator:
SRV_SHUTDOWN_NONE 

Database running normally

SRV_SHUTDOWN_CLEANUP 

Cleaning up in logs_empty_and_mark_files_at_shutdown()

SRV_SHUTDOWN_FLUSH_PHASE 

At this phase the master and the purge threads must have completed their work. Once we enter this phase the page_cleaner can clean up the buffer pool and exit

SRV_SHUTDOWN_LAST_PHASE 

Last phase after ensuring that the buffer pool can be freed: flush all file spaces and close all files

SRV_SHUTDOWN_EXIT_THREADS 

Exit all threads

Function Documentation

UNIV_INTERN dberr_t innobase_shutdown_for_mysql ( void  )

Shuts down the Innobase database.

Returns
DB_SUCCESS or error code
UNIV_INTERN dberr_t innobase_start_or_create_for_mysql ( void  )

Starts Innobase and creates a new database if database files are not found and the user wants.

Returns
DB_SUCCESS or error code
UNIV_INTERN char* srv_add_path_separator_if_needed ( char *  str)

Adds a slash or a backslash to the end of a string if it is missing and the string is not empty.

Returns
string which has the separator if the string is not empty in: null-terminated character string
UNIV_INTERN void srv_free_paths_and_sizes ( void  )

Frees the memory allocated by srv_parse_data_file_paths_and_sizes() and srv_parse_log_group_home_dirs().

UNIV_INTERN void srv_get_meta_data_filename ( dict_table_t table,
char *  filename,
ulint  max_len 
)

Get the meta-data filename from the table name.

Parameters
tablein: table
filenameout: filename
max_lenin: filename max length
UNIV_INTERN void srv_normalize_path_for_win ( char *  str)

Normalizes a directory path for Windows: converts slashes to backslashes. in/out: null-terminated character string

UNIV_INTERN ibool srv_parse_data_file_paths_and_sizes ( char *  str)

Reads the data files and their sizes from a character string given in the .cnf file.

Returns
TRUE if ok, FALSE on parse error in/out: the data file path string
UNIV_INTERN ulint srv_path_copy ( char *  dest,
ulint  dest_len,
const char *  basedir,
const char *  table_name 
)

Copy the file path component of the physical file to parameter. It will copy up to and including the terminating path separator.

Returns
number of bytes copied or ULINT_UNDEFINED if destination buffer is smaller than the path to be copied.
Parameters
destout: destination buffer
dest_lenin: max bytes to copy
basedirin: base directory
table_namein: source table name

Variable Documentation

ibool srv_is_being_started

TRUE if the server is being started

lsn_t srv_shutdown_lsn

Log sequence number at shutdown

At a shutdown this value climbs from SRV_SHUTDOWN_NONE to

SRV_SHUTDOWN_CLEANUP and then to SRV_SHUTDOWN_LAST_PHASE, and so on

lsn_t srv_start_lsn

Log sequence number immediately after startup

ibool srv_start_raw_disk_in_use

TRUE if a raw partition is in use

ibool srv_startup_is_before_trx_rollback_phase
TRUE if the server is being started, before rolling back any

incomplete transactions

ibool srv_was_started

TRUE if the server was successfully started