641.2.2
by Monty Taylor
InnoDB Plugin 1.0.3 |
1 |
/*****************************************************************************
|
2 |
||
3 |
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
|
|
4 |
||
5 |
This program is free software; you can redistribute it and/or modify it under
|
|
6 |
the terms of the GNU General Public License as published by the Free Software
|
|
7 |
Foundation; version 2 of the License.
|
|
8 |
||
9 |
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
12 |
||
13 |
You should have received a copy of the GNU General Public License along with
|
|
14 |
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
15 |
Place, Suite 330, Boston, MA 02111-1307 USA
|
|
16 |
||
17 |
*****************************************************************************/
|
|
18 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
19 |
/**************************************************//**
|
20 |
@file include/srv0start.h
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
21 |
Starts the Innobase database server
|
22 |
||
23 |
Created 10/10/1995 Heikki Tuuri
|
|
24 |
*******************************************************/
|
|
25 |
||
26 |
#ifndef srv0start_h
|
|
27 |
#define srv0start_h
|
|
28 |
||
29 |
#include "univ.i" |
|
30 |
#include "ut0byte.h" |
|
31 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
32 |
/*********************************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
33 |
Normalizes a directory path for Windows: converts slashes to backslashes. */
|
34 |
UNIV_INTERN
|
|
35 |
void
|
|
36 |
srv_normalize_path_for_win( |
|
37 |
/*=======================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
38 |
char* str); /*!< in/out: null-terminated character string */ |
39 |
/*********************************************************************//**
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
40 |
Reads the data files and their sizes from a character string given in
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
41 |
the .cnf file.
|
42 |
@return TRUE if ok, FALSE on parse error */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
43 |
UNIV_INTERN
|
44 |
ibool
|
|
45 |
srv_parse_data_file_paths_and_sizes( |
|
46 |
/*================================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
47 |
char* str); /*!< in/out: the data file path string */ |
48 |
/*********************************************************************//**
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
49 |
Reads log group home directories from a character string given in
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
50 |
the .cnf file.
|
51 |
@return TRUE if ok, FALSE on parse error */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
52 |
UNIV_INTERN
|
53 |
ibool
|
|
54 |
srv_parse_log_group_home_dirs( |
|
55 |
/*==========================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
56 |
char* str); /*!< in/out: character string */ |
57 |
/*********************************************************************//**
|
|
641.2.2
by Monty Taylor
InnoDB Plugin 1.0.3 |
58 |
Frees the memory allocated by srv_parse_data_file_paths_and_sizes()
|
59 |
and srv_parse_log_group_home_dirs(). */
|
|
60 |
UNIV_INTERN
|
|
61 |
void
|
|
62 |
srv_free_paths_and_sizes(void); |
|
63 |
/*==========================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
64 |
/*********************************************************************//**
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
65 |
Adds a slash or a backslash to the end of a string if it is missing
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
66 |
and the string is not empty.
|
67 |
@return string which has the separator if the string is not empty */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
68 |
UNIV_INTERN
|
69 |
char* |
|
70 |
srv_add_path_separator_if_needed( |
|
71 |
/*=============================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
72 |
char* str); /*!< in: null-terminated character string */ |
73 |
#ifndef UNIV_HOTBACKUP
|
|
74 |
/****************************************************************//**
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
75 |
Starts Innobase and creates a new database if database files
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
76 |
are not found and the user wants.
|
77 |
@return DB_SUCCESS or error code */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
78 |
UNIV_INTERN
|
79 |
int
|
|
80 |
innobase_start_or_create_for_mysql(void); |
|
81 |
/*====================================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
82 |
/****************************************************************//**
|
83 |
Shuts down the Innobase database.
|
|
84 |
@return DB_SUCCESS or error code */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
85 |
UNIV_INTERN
|
86 |
int
|
|
87 |
innobase_shutdown_for_mysql(void); |
|
88 |
/*=============================*/
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
89 |
/** Log sequence number at shutdown */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
90 |
extern ib_uint64_t srv_shutdown_lsn; |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
91 |
/** Log sequence number immediately after startup */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
92 |
extern ib_uint64_t srv_start_lsn; |
93 |
||
94 |
#ifdef __NETWARE__
|
|
95 |
void set_panic_flag_for_netware(void); |
|
96 |
#endif
|
|
97 |
||
98 |
#ifdef HAVE_DARWIN_THREADS
|
|
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
99 |
/** TRUE if the F_FULLFSYNC option is available */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
100 |
extern ibool srv_have_fullfsync; |
101 |
#endif
|
|
102 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
103 |
/** TRUE if the server is being started */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
104 |
extern ibool srv_is_being_started; |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
105 |
/** TRUE if the server was successfully started */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
106 |
extern ibool srv_was_started; |
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
107 |
/** TRUE if the server is being started, before rolling back any
|
108 |
incomplete transactions */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
109 |
extern ibool srv_startup_is_before_trx_rollback_phase; |
110 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
111 |
/** TRUE if a raw partition is in use */
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
112 |
extern ibool srv_start_raw_disk_in_use; |
113 |
||
641.2.3
by Monty Taylor
InnoDB Plugin 1.0.4 |
114 |
|
115 |
/** Shutdown state */
|
|
116 |
enum srv_shutdown_state { |
|
117 |
SRV_SHUTDOWN_NONE = 0, /*!< Database running normally */ |
|
118 |
SRV_SHUTDOWN_CLEANUP, /*!< Cleaning up in |
|
119 |
logs_empty_and_mark_files_at_shutdown() */
|
|
120 |
SRV_SHUTDOWN_LAST_PHASE,/*!< Last phase after ensuring that |
|
121 |
the buffer pool can be freed: flush
|
|
122 |
all file spaces and close all files */
|
|
123 |
SRV_SHUTDOWN_EXIT_THREADS/*!< Exit all threads */ |
|
124 |
};
|
|
125 |
||
126 |
/** At a shutdown this value climbs from SRV_SHUTDOWN_NONE to
|
|
127 |
SRV_SHUTDOWN_CLEANUP and then to SRV_SHUTDOWN_LAST_PHASE, and so on */
|
|
128 |
extern enum srv_shutdown_state srv_shutdown_state; |
|
129 |
#endif /* !UNIV_HOTBACKUP */ |
|
130 |
||
131 |
/** Log 'spaces' have id's >= this */
|
|
641.1.2
by Monty Taylor
Imported 1.0.1 with clean - with no changes. |
132 |
#define SRV_LOG_SPACE_FIRST_ID 0xFFFFFFF0UL
|
133 |
||
134 |
#endif
|