|
drizzle
C++ MySQL-protocol-compatible database server
|
#include "univ.i"#include "sync0sync.h"#include "os0sync.h"#include "que0types.h"#include "trx0types.h"#include <string>Go to the source code of this file.
Classes | |
| struct | export_var_struct |
| struct | srv_sys_struct |
Macros | |
| #define | srv0srv_h |
| #define | SRV_AUTO_EXTEND_INCREMENT (srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE)) |
| #define | PCT_IO(p) |
| #define | srv_print_thread_releases FALSE |
| #define | srv_print_lock_waits FALSE |
| #define | srv_print_buf_io FALSE |
| #define | srv_print_log_io FALSE |
| #define | srv_print_latch_waits FALSE |
| #define | kernel_mutex (*kernel_mutex_temp) |
| #define | commit_id_mutex (*commit_id_mutex_temp) |
| #define | SRV_MAX_N_IO_THREADS 130 |
Typedefs | |
| typedef struct export_var_struct | export_struc |
| typedef struct srv_sys_struct | srv_sys_t |
| typedef enum srv_stats_method_name_enum | srv_stats_method_name_t |
| typedef struct srv_slot_struct | srv_slot_t |
| typedef srv_slot_t | srv_table_t |
Enumerations | |
| enum | { SRV_NOT_RAW = 0 , SRV_NEW_RAW , SRV_OLD_RAW } |
| enum | { SRV_UNIX_FSYNC = 1 , SRV_UNIX_O_DSYNC , SRV_UNIX_LITTLESYNC , SRV_UNIX_NOSYNC , SRV_UNIX_O_DIRECT , SRV_UNIX_ALL_O_DIRECT } |
| enum | { SRV_WIN_IO_NORMAL = 1 , SRV_WIN_IO_UNBUFFERED } |
| enum | { SRV_FORCE_IGNORE_CORRUPT = 1 , SRV_FORCE_NO_BACKGROUND = 2 , SRV_FORCE_NO_TRX_UNDO = 3 , SRV_FORCE_NO_IBUF_MERGE = 4 , SRV_FORCE_NO_UNDO_LOG_SCAN = 5 , SRV_FORCE_NO_LOG_REDO = 6 } |
| enum | srv_stats_method_name_enum { SRV_STATS_NULLS_EQUAL , SRV_STATS_NULLS_UNEQUAL , SRV_STATS_NULLS_IGNORED } |
| enum | srv_thread_type { SRV_WORKER = 0 , SRV_MASTER } |
Functions | |
| static const std::string | srv_mysql50_table_name_prefix ("#mysql50#") |
| UNIV_INTERN ulint | srv_boot (void) |
| UNIV_INTERN void | srv_init (void) |
| UNIV_INTERN void | srv_free (void) |
| UNIV_INTERN void | srv_general_init (void) |
| UNIV_INTERN ulint | srv_get_n_threads (void) |
| UNIV_INTERN ulint | srv_thread_has_reserved_slot (enum srv_thread_type type) |
| UNIV_INTERN void | srv_set_io_thread_op_info (ulint i, const char *str) |
| UNIV_INTERN ulint | srv_release_threads (enum srv_thread_type type, ulint n) |
| UNIV_INTERN os_thread_ret_t | srv_master_thread (void *arg) |
| UNIV_INTERN void | srv_wake_purge_thread (void) |
| UNIV_INTERN void | srv_active_wake_master_thread (void) |
| UNIV_INTERN void | srv_wake_master_thread (void) |
| UNIV_INTERN void | srv_wake_purge_thread_if_not_active (void) |
| UNIV_INTERN void | srv_conc_enter_innodb (trx_t *trx) |
| UNIV_INTERN void | srv_conc_force_enter_innodb (trx_t *trx) |
| UNIV_INTERN void | srv_conc_force_exit_innodb (trx_t *trx) |
| UNIV_INTERN void | srv_conc_exit_innodb (trx_t *trx) |
| UNIV_INTERN void | srv_suspend_mysql_thread (que_thr_t *thr) |
| UNIV_INTERN void | srv_release_mysql_thread_if_suspended (que_thr_t *thr) |
| UNIV_INTERN os_thread_ret_t | srv_lock_timeout_thread (void *arg) |
| UNIV_INTERN os_thread_ret_t | srv_monitor_thread (void *arg) |
| UNIV_INTERN os_thread_ret_t | srv_error_monitor_thread (void *arg) |
| UNIV_INTERN os_thread_ret_t | srv_LRU_dump_restore_thread (void *arg) |
| UNIV_INTERN ibool | srv_printf_innodb_monitor (FILE *file, ibool nowait, ulint *trx_start, ulint *trx_end) |
| UNIV_INTERN void | srv_export_innodb_status (void) |
| UNIV_INTERN void | srv_inc_activity_count (void) |
| UNIV_INTERN os_thread_ret_t | srv_purge_thread (void *) |
| UNIV_INTERN void | srv_que_task_enqueue_low (que_thr_t *thr) |
| UNIV_INTERN ibool | srv_is_any_background_thread_active (void) |
| #define PCT_IO | ( | p | ) |
| #define SRV_AUTO_EXTEND_INCREMENT (srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE)) |
| typedef struct export_var_struct export_struc |
| typedef struct srv_slot_struct srv_slot_t |
| typedef enum srv_stats_method_name_enum srv_stats_method_name_t |
| typedef struct srv_sys_struct srv_sys_t |
| typedef srv_slot_t srv_table_t |
| anonymous enum |
Alternatives for srv_force_recovery. Non-zero values are intended to help the user get a damaged database up so that he can dump intact tables and rows with SELECT INTO OUTFILE. The database must not otherwise be used with these options! A bigger number below means that all precautions of lower numbers are included.
| anonymous enum |
| anonymous enum |
Alternatives for the file flush option in Unix; see the InnoDB manual about what these mean
| Enumerator | |
|---|---|
| SRV_UNIX_FSYNC | fsync, the default |
| SRV_UNIX_O_DSYNC | open log files in O_SYNC mode |
| SRV_UNIX_LITTLESYNC | do not call os_file_flush() when writing data files, but do flush after writing to log files |
| SRV_UNIX_NOSYNC | do not flush after writing |
| SRV_UNIX_O_DIRECT | invoke os_file_set_nocache() on data files |
| SRV_UNIX_ALL_O_DIRECT | Open log file also with O_DIRECT |
| anonymous enum |
| enum srv_thread_type |
| UNIV_INTERN void srv_active_wake_master_thread | ( | void | ) |
Tells the Innobase server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping). Used in the MySQL interface. Note that there is a small chance that the master thread stays suspended (we do not protect our operation with the kernel mutex, for performace reasons).
Tells the InnoDB server that there has been activity in the database and wakes up the master thread if it is suspended (not sleeping). Used in the MySQL interface. Note that there is a small chance that the master thread stays suspended (we do not protect our operation with the srv_sys_t->mutex, for performance reasons).
Definition at line 2617 of file srv0srv.cc.
| UNIV_INTERN ulint srv_boot | ( | void | ) |
Boots Innobase server.
Boots the InnoDB server.
Definition at line 1511 of file srv0srv.cc.
| UNIV_INTERN void srv_conc_enter_innodb | ( | trx_t * | trx | ) |
Puts an OS thread to wait if there are too many concurrent threads (>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. in: transaction object associated with the thread
Puts an OS thread to wait if there are too many concurrent threads (>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue.
| trx | in: transaction object associated with the thread |
Definition at line 1213 of file srv0srv.cc.
| UNIV_INTERN void srv_conc_exit_innodb | ( | trx_t * | trx | ) |
This must be called when a thread exits InnoDB. in: transaction object associated with the thread
This must be called when a thread exits InnoDB.
| trx | in: transaction object associated with the thread |
Definition at line 1455 of file srv0srv.cc.
| UNIV_INTERN void srv_conc_force_enter_innodb | ( | trx_t * | trx | ) |
This lets a thread enter InnoDB regardless of the number of threads inside InnoDB. This must be called when a thread ends a lock wait. in: transaction object associated with the thread
This lets a thread enter InnoDB regardless of the number of threads inside InnoDB. This must be called when a thread ends a lock wait.
| trx | in: transaction object associated with the thread |
Definition at line 1373 of file srv0srv.cc.
| UNIV_INTERN void srv_conc_force_exit_innodb | ( | trx_t * | trx | ) |
This must be called when a thread exits InnoDB in a lock wait or at the end of an SQL statement. in: transaction object associated with the thread
This must be called when a thread exits InnoDB in a lock wait or at the end of an SQL statement.
| trx | in: transaction object associated with the thread |
Definition at line 1399 of file srv0srv.cc.
| UNIV_INTERN os_thread_ret_t srv_error_monitor_thread | ( | void * | arg | ) |
in: a dummy parameter required by os_thread_create
A thread which prints warnings about semaphore waits which have lasted too long. These can be used to track bugs which cause hangs.
| arg | in: a dummy parameter required by os_thread_create |
Definition at line 2424 of file srv0srv.cc.
| UNIV_INTERN void srv_export_innodb_status | ( | void | ) |
Function to pass InnoDB status variables to MySQL
Definition at line 2061 of file srv0srv.cc.
| UNIV_INTERN void srv_free | ( | void | ) |
Frees the data structures created in srv_init().
Definition at line 1165 of file srv0srv.cc.
| UNIV_INTERN void srv_general_init | ( | void | ) |
Initializes the synchronization primitives, memory system, and the thread local storage.
Definition at line 1192 of file srv0srv.cc.
| UNIV_INTERN ulint srv_get_n_threads | ( | void | ) |
Gets the number of threads in the system.
Definition at line 873 of file srv0srv.cc.
| UNIV_INTERN void srv_inc_activity_count | ( | void | ) |
Increment the server activity counter.
| UNIV_INTERN void srv_init | ( | void | ) |
Initializes the server.
Definition at line 1082 of file srv0srv.cc.
| UNIV_INTERN ibool srv_is_any_background_thread_active | ( | void | ) |
Check whether any background thread is active.
Definition at line 2589 of file srv0srv.cc.
| UNIV_INTERN os_thread_ret_t srv_lock_timeout_thread | ( | void * | arg | ) |
A thread which wakes up threads whose lock wait may have lasted too long.
A thread which wakes up threads whose lock wait may have lasted too long.
Definition at line 2316 of file srv0srv.cc.
| UNIV_INTERN os_thread_ret_t srv_LRU_dump_restore_thread | ( | void * | arg | ) |
A thread which restores the buffer pool from a dump file on startup and does periodic buffer pool dumps.
A thread which restores the buffer pool from a dump file on startup and does periodic buffer pool dumps.
| arg | in: a dummy parameter required by os_thread_create |
Definition at line 2540 of file srv0srv.cc.
| UNIV_INTERN os_thread_ret_t srv_master_thread | ( | void * | arg | ) |
The master thread controlling the server.
The master thread controlling the server.
| arg | in: a dummy parameter required by os_thread_create |
Definition at line 2744 of file srv0srv.cc.
| UNIV_INTERN os_thread_ret_t srv_monitor_thread | ( | void * | arg | ) |
A thread which prints the info output by various InnoDB monitors.
A thread which prints the info output by various InnoDB monitors.
| arg | in: a dummy parameter required by os_thread_create |
Definition at line 2151 of file srv0srv.cc.
|
static |
Prefix used by MySQL to indicate pre-5.1 table name encoding LOOKIE HERE!!!! This used to be srv_mysql50_table_name_prefix[10] which was a buffer overrun, because it didn't allow for the trailing '\0'. Thanks C++!
| UNIV_INTERN ibool srv_printf_innodb_monitor | ( | FILE * | file, |
| ibool | nowait, | ||
| ulint * | trx_start, | ||
| ulint * | trx_end ) |
Outputs to a file the output of the InnoDB Monitor.
Outputs to a file the output of the InnoDB Monitor.
| file | in: output stream |
| nowait | in: whether to wait for kernel mutex |
| trx_start | out: file position of the start of the list of active transactions |
| trx_end | out: file position of the end of the list of active transactions |
Definition at line 1869 of file srv0srv.cc.
| UNIV_INTERN os_thread_ret_t srv_purge_thread | ( | void * | ) |
Asynchronous purge thread.
Asynchronous purge thread.
Definition at line 3462 of file srv0srv.cc.
| UNIV_INTERN void srv_que_task_enqueue_low | ( | que_thr_t * | thr | ) |
Enqueues a task to server task queue and releases a worker thread, if there is a suspended one. in: query thread
Enqueues a task to server task queue and releases a worker thread, if there is a suspended one.
| thr | in: query thread |
Definition at line 3577 of file srv0srv.cc.
| UNIV_INTERN void srv_release_mysql_thread_if_suspended | ( | que_thr_t * | thr | ) |
Releases a MySQL OS thread waiting for a lock to be released, if the thread is already suspended. in: query thread associated with the MySQL OS thread
Releases a MySQL OS thread waiting for a lock to be released, if the thread is already suspended.
| thr | in: query thread associated with the MySQL OS thread |
Definition at line 1809 of file srv0srv.cc.
| UNIV_INTERN ulint srv_release_threads | ( | enum srv_thread_type | type, |
| ulint | n ) |
Releases threads of the type given from suspension in the thread table. NOTE! The server mutex has to be reserved by the caller!
Releases threads of the type given from suspension in the thread table. NOTE! The server mutex has to be reserved by the caller!
| type | in: thread type |
| n | in: number of threads to release |
Definition at line 1001 of file srv0srv.cc.
| UNIV_INTERN void srv_set_io_thread_op_info | ( | ulint | i, |
| const char * | str ) |
Sets the info describing an i/o thread current state. in: constant char string describing the state
Sets the info describing an i/o thread current state.
| i | in: the 'segment' of the i/o thread |
| str | in: constant char string describing the state |
Definition at line 841 of file srv0srv.cc.
| UNIV_INTERN void srv_suspend_mysql_thread | ( | que_thr_t * | thr | ) |
Puts a MySQL OS thread to wait for a lock to be released. If an error occurs during the wait trx->error_state associated with thr is != DB_SUCCESS when we return. DB_LOCK_WAIT_TIMEOUT and DB_DEADLOCK are possible errors. DB_DEADLOCK is returned if selective deadlock resolution chose this transaction as a victim. in: query thread associated with the MySQL OS thread
Puts a MySQL OS thread to wait for a lock to be released. If an error occurs during the wait trx->error_state associated with thr is != DB_SUCCESS when we return. DB_LOCK_WAIT_TIMEOUT and DB_DEADLOCK are possible errors. DB_DEADLOCK is returned if selective deadlock resolution chose this transaction as a victim.
| thr | in: query thread associated with the MySQL OS thread |
Definition at line 1610 of file srv0srv.cc.
| UNIV_INTERN ulint srv_thread_has_reserved_slot | ( | enum srv_thread_type | type | ) |
Check whether thread type has reserved a slot.
Check whether thread type has reserved a slot. Return the first slot that is found. This works because we currently have only 1 thread of each type.
| type | in: thread type to check |
Definition at line 1052 of file srv0srv.cc.
| UNIV_INTERN void srv_wake_master_thread | ( | void | ) |
Wakes up the master thread if it is suspended or being suspended.
Definition at line 2660 of file srv0srv.cc.
| UNIV_INTERN void srv_wake_purge_thread | ( | void | ) |
Wakes up the purge thread if it's not already awake.
Definition at line 2676 of file srv0srv.cc.
| UNIV_INTERN void srv_wake_purge_thread_if_not_active | ( | void | ) |
Tells the purge thread that there has been activity in the database and wakes up the purge thread if it is suspended (not sleeping). Note that there is a small chance that the purge thread stays suspended (we do not protect our operation with the kernel mutex, for performace reasons).
Definition at line 2640 of file srv0srv.cc.
|
extern |
Definition at line 793 of file srv0srv.cc.
|
extern |
Status variables to be passed to MySQL
Definition at line 378 of file srv0srv.cc.
|
extern |
Definition at line 791 of file srv0srv.cc.
|
extern |
Definition at line 98 of file srv0srv.cc.
|
extern |
Definition at line 193 of file srv0srv.cc.
|
extern |
Definition at line 466 of file srv0srv.cc.
|
extern |
Definition at line 472 of file srv0srv.cc.
|
extern |
Definition at line 173 of file srv0srv.cc.
|
extern |
Definition at line 167 of file srv0srv.cc.
|
extern |
Time in seconds between automatic buffer pool dumps
Definition at line 375 of file srv0srv.cc.
|
extern |
current size in bytes
Definition at line 259 of file srv0srv.cc.
|
extern |
Definition at line 368 of file srv0srv.cc.
|
extern |
requested number of buffer pool instances
Definition at line 255 of file srv0srv.cc.
|
extern |
previously requested size
Definition at line 257 of file srv0srv.cc.
|
extern |
Number of buffer pool reads that led to the reading of a disk page
Definition at line 372 of file srv0srv.cc.
|
extern |
requested size in bytes
Definition at line 253 of file srv0srv.cc.
|
extern |
Definition at line 364 of file srv0srv.cc.
|
extern |
Definition at line 359 of file srv0srv.cc.
|
extern |
Definition at line 462 of file srv0srv.cc.
|
extern |
Definition at line 407 of file srv0srv.cc.
|
extern |
Definition at line 179 of file srv0srv.cc.
|
extern |
Definition at line 174 of file srv0srv.cc.
|
extern |
Definition at line 162 of file srv0srv.cc.
|
extern |
Definition at line 164 of file srv0srv.cc.
|
extern |
Definition at line 118 of file srv0srv.cc.
|
extern |
Definition at line 324 of file srv0srv.cc.
|
extern |
Definition at line 332 of file srv0srv.cc.
|
extern |
Definition at line 356 of file srv0srv.cc.
|
extern |
Definition at line 352 of file srv0srv.cc.
|
extern |
Definition at line 551 of file srv0srv.cc.
|
extern |
Definition at line 549 of file srv0srv.cc.
|
extern |
Definition at line 105 of file srv0srv.cc.
|
extern |
Definition at line 781 of file srv0srv.cc.
|
extern |
Definition at line 109 of file srv0srv.cc.
|
extern |
Definition at line 471 of file srv0srv.cc.
|
extern |
Definition at line 441 of file srv0srv.cc.
|
extern |
Definition at line 101 of file srv0srv.cc.
|
extern |
Definition at line 298 of file srv0srv.cc.
|
extern |
The file format to use on new *.ibd files.
Definition at line 127 of file srv0srv.cc.
|
extern |
store to its own file each table created by an user; data dictionary tables are in the system tablespace 0
Definition at line 125 of file srv0srv.cc.
|
extern |
Definition at line 189 of file srv0srv.cc.
|
extern |
Definition at line 463 of file srv0srv.cc.
|
extern |
Definition at line 383 of file srv0srv.cc.
|
extern |
Definition at line 457 of file srv0srv.cc.
|
extern |
Definition at line 456 of file srv0srv.cc.
|
extern |
Definition at line 455 of file srv0srv.cc.
|
extern |
Definition at line 329 of file srv0srv.cc.
|
extern |
Definition at line 444 of file srv0srv.cc.
|
extern |
Definition at line 305 of file srv0srv.cc.
|
extern |
Definition at line 520 of file srv0srv.cc.
|
extern |
Definition at line 519 of file srv0srv.cc.
|
extern |
Definition at line 170 of file srv0srv.cc.
|
extern |
The sort order table of the MySQL latin1_swedish_ci character set collation
Definition at line 246 of file srv0srv.cc.
|
extern |
Definition at line 262 of file srv0srv.cc.
|
extern |
Definition at line 107 of file srv0srv.cc.
|
extern |
Definition at line 783 of file srv0srv.cc.
|
extern |
Place locks to records only i.e. do not use next-key locking except on duplicate key checking and foreign key checking
Definition at line 138 of file srv0srv.cc.
|
extern |
Definition at line 188 of file srv0srv.cc.
|
extern |
Definition at line 186 of file srv0srv.cc.
|
extern |
Definition at line 181 of file srv0srv.cc.
|
extern |
Definition at line 348 of file srv0srv.cc.
|
extern |
Definition at line 335 of file srv0srv.cc.
|
extern |
Definition at line 338 of file srv0srv.cc.
|
extern |
Definition at line 94 of file srv0srv.cc.
|
extern |
Definition at line 111 of file srv0srv.cc.
|
extern |
Definition at line 312 of file srv0srv.cc.
|
extern |
Whether to check file format during startup. A value of DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support.
Definition at line 131 of file srv0srv.cc.
|
extern |
Definition at line 302 of file srv0srv.cc.
|
extern |
Definition at line 389 of file srv0srv.cc.
|
extern |
Definition at line 1206 of file srv0srv.cc.
|
extern |
Definition at line 261 of file srv0srv.cc.
|
extern |
Definition at line 557 of file srv0srv.cc.
|
extern |
Definition at line 555 of file srv0srv.cc.
|
extern |
Definition at line 108 of file srv0srv.cc.
|
extern |
Definition at line 779 of file srv0srv.cc.
|
extern |
Definition at line 545 of file srv0srv.cc.
|
extern |
Definition at line 527 of file srv0srv.cc.
|
extern |
Definition at line 161 of file srv0srv.cc.
|
extern |
Definition at line 266 of file srv0srv.cc.
|
extern |
Definition at line 476 of file srv0srv.cc.
|
extern |
Definition at line 184 of file srv0srv.cc.
|
extern |
Definition at line 183 of file srv0srv.cc.
|
extern |
Definition at line 315 of file srv0srv.cc.
|
extern |
Definition at line 267 of file srv0srv.cc.
|
extern |
Definition at line 491 of file srv0srv.cc.
|
extern |
Definition at line 489 of file srv0srv.cc.
|
extern |
Definition at line 492 of file srv0srv.cc.
|
extern |
Definition at line 490 of file srv0srv.cc.
|
extern |
Definition at line 475 of file srv0srv.cc.
|
extern |
Definition at line 834 of file srv0srv.cc.
|
extern |
Definition at line 268 of file srv0srv.cc.
|
extern |
Definition at line 344 of file srv0srv.cc.
|
extern |
Definition at line 341 of file srv0srv.cc.
|
extern |
Definition at line 512 of file srv0srv.cc.
|
extern |
Definition at line 511 of file srv0srv.cc.
|
extern |
Definition at line 514 of file srv0srv.cc.
|
extern |
Definition at line 513 of file srv0srv.cc.
|
extern |
Definition at line 510 of file srv0srv.cc.
|
extern |
Definition at line 479 of file srv0srv.cc.
|
extern |
Definition at line 318 of file srv0srv.cc.
|
extern |
Definition at line 465 of file srv0srv.cc.
|
extern |
Definition at line 280 of file srv0srv.cc.
|
extern |
Definition at line 470 of file srv0srv.cc.
|
extern |
Definition at line 453 of file srv0srv.cc.
|
extern |
Definition at line 321 of file srv0srv.cc.
|
extern |
Definition at line 478 of file srv0srv.cc.
|
extern |
Definition at line 448 of file srv0srv.cc.
|
extern |
The server system
Definition at line 785 of file srv0srv.cc.
|
extern |
Definition at line 399 of file srv0srv.cc.
|
extern |
Definition at line 477 of file srv0srv.cc.
|
extern |
Definition at line 777 of file srv0srv.cc.
|
extern |
Definition at line 504 of file srv0srv.cc.
|
extern |
Definition at line 299 of file srv0srv.cc.
|
extern |
Definition at line 451 of file srv0srv.cc.
|
extern |
Definition at line 450 of file srv0srv.cc.
|
extern |
Definition at line 144 of file srv0srv.cc.
|
extern |
Definition at line 251 of file srv0srv.cc.
|
extern |
Definition at line 300 of file srv0srv.cc.