~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/srv0start.h

  • Committer: Brian Aker
  • Date: 2009-01-07 09:27:07 UTC
  • Revision ID: brian@tangent.org-20090107092707-bn67qpdllfcyh3j9
Removing dead field translator code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/**************************************************//**
20
 
@file include/srv0start.h
 
1
/******************************************************
21
2
Starts the Innobase database server
22
3
 
 
4
(c) 1995-2000 Innobase Oy
 
5
 
23
6
Created 10/10/1995 Heikki Tuuri
24
7
*******************************************************/
25
8
 
 
9
 
26
10
#ifndef srv0start_h
27
11
#define srv0start_h
28
12
 
29
13
#include "univ.i"
30
14
#include "ut0byte.h"
31
15
 
32
 
/*********************************************************************//**
 
16
/*************************************************************************
33
17
Normalizes a directory path for Windows: converts slashes to backslashes. */
34
18
UNIV_INTERN
35
19
void
36
20
srv_normalize_path_for_win(
37
21
/*=======================*/
38
 
        char*   str);   /*!< in/out: null-terminated character string */
39
 
/*********************************************************************//**
 
22
        char*   str);   /* in/out: null-terminated character string */
 
23
/*************************************************************************
40
24
Reads the data files and their sizes from a character string given in
41
 
the .cnf file.
42
 
@return TRUE if ok, FALSE on parse error */
 
25
the .cnf file. */
43
26
UNIV_INTERN
44
27
ibool
45
28
srv_parse_data_file_paths_and_sizes(
46
29
/*================================*/
47
 
        char*   str);   /*!< in/out: the data file path string */
48
 
/*********************************************************************//**
 
30
                                        /* out: TRUE if ok, FALSE if parsing
 
31
                                        error */
 
32
        char*   str,                    /* in: the data file path string */
 
33
        char*** data_file_names,        /* out, own: array of data file
 
34
                                        names */
 
35
        ulint** data_file_sizes,        /* out, own: array of data file sizes
 
36
                                        in megabytes */
 
37
        ulint** data_file_is_raw_partition,/* out, own: array of flags
 
38
                                        showing which data files are raw
 
39
                                        partitions */
 
40
        ulint*  n_data_files,           /* out: number of data files */
 
41
        ibool*  is_auto_extending,      /* out: TRUE if the last data file is
 
42
                                        auto-extending */
 
43
        ulint*  max_auto_extend_size);  /* out: max auto extend size for the
 
44
                                        last file if specified, 0 if not */
 
45
/*************************************************************************
49
46
Reads log group home directories from a character string given in
50
 
the .cnf file.
51
 
@return TRUE if ok, FALSE on parse error */
 
47
the .cnf file. */
52
48
UNIV_INTERN
53
49
ibool
54
50
srv_parse_log_group_home_dirs(
55
51
/*==========================*/
56
 
        char*   str);   /*!< in/out: character string */
57
 
/*********************************************************************//**
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
 
/*==========================*/
64
 
/*********************************************************************//**
 
52
                                        /* out: TRUE if ok, FALSE if parsing
 
53
                                        error */
 
54
        char*   str,                    /* in: character string */
 
55
        char*** log_group_home_dirs);   /* out, own: log group home dirs */
 
56
/*************************************************************************
65
57
Adds a slash or a backslash to the end of a string if it is missing
66
 
and the string is not empty.
67
 
@return string which has the separator if the string is not empty */
 
58
and the string is not empty. */
68
59
UNIV_INTERN
69
60
char*
70
61
srv_add_path_separator_if_needed(
71
62
/*=============================*/
72
 
        char*   str);   /*!< in: null-terminated character string */
73
 
#ifndef UNIV_HOTBACKUP
74
 
/****************************************************************//**
 
63
                        /* out: string which has the separator if the
 
64
                        string is not empty */
 
65
        char*   str);   /* in: null-terminated character string */
 
66
/********************************************************************
75
67
Starts Innobase and creates a new database if database files
76
 
are not found and the user wants.
77
 
@return DB_SUCCESS or error code */
 
68
are not found and the user wants. Server parameters are
 
69
read from a file of name "srv_init" in the ib_home directory. */
78
70
UNIV_INTERN
79
71
int
80
72
innobase_start_or_create_for_mysql(void);
81
73
/*====================================*/
82
 
/****************************************************************//**
83
 
Shuts down the Innobase database.
84
 
@return DB_SUCCESS or error code */
 
74
                                /* out: DB_SUCCESS or error code */
 
75
/********************************************************************
 
76
Shuts down the Innobase database. */
85
77
UNIV_INTERN
86
78
int
87
79
innobase_shutdown_for_mysql(void);
88
80
/*=============================*/
89
 
/** Log sequence number at shutdown */
 
81
                                /* out: DB_SUCCESS or error code */
90
82
extern  ib_uint64_t     srv_shutdown_lsn;
91
 
/** Log sequence number immediately after startup */
92
83
extern  ib_uint64_t     srv_start_lsn;
93
84
 
 
85
#ifdef __NETWARE__
 
86
void set_panic_flag_for_netware(void);
 
87
#endif
 
88
 
94
89
#ifdef HAVE_DARWIN_THREADS
95
 
/** TRUE if the F_FULLFSYNC option is available */
96
90
extern  ibool   srv_have_fullfsync;
97
91
#endif
98
92
 
99
 
/** TRUE if the server is being started */
100
93
extern  ibool   srv_is_being_started;
101
 
/** TRUE if the server was successfully started */
102
94
extern  ibool   srv_was_started;
103
 
/** TRUE if the server is being started, before rolling back any
104
 
incomplete transactions */
105
95
extern  ibool   srv_startup_is_before_trx_rollback_phase;
 
96
extern  ibool   srv_is_being_shut_down;
106
97
 
107
 
/** TRUE if a raw partition is in use */
108
98
extern  ibool   srv_start_raw_disk_in_use;
109
99
 
110
 
 
111
 
/** Shutdown state */
112
 
enum srv_shutdown_state {
113
 
        SRV_SHUTDOWN_NONE = 0,  /*!< Database running normally */
114
 
        SRV_SHUTDOWN_CLEANUP,   /*!< Cleaning up in
115
 
                                logs_empty_and_mark_files_at_shutdown() */
116
 
        SRV_SHUTDOWN_LAST_PHASE,/*!< Last phase after ensuring that
117
 
                                the buffer pool can be freed: flush
118
 
                                all file spaces and close all files */
119
 
        SRV_SHUTDOWN_EXIT_THREADS/*!< Exit all threads */
120
 
};
121
 
 
122
 
/** At a shutdown this value climbs from SRV_SHUTDOWN_NONE to
123
 
SRV_SHUTDOWN_CLEANUP and then to SRV_SHUTDOWN_LAST_PHASE, and so on */
124
 
extern  enum srv_shutdown_state srv_shutdown_state;
125
 
#endif /* !UNIV_HOTBACKUP */
126
 
 
127
 
/** Log 'spaces' have id's >= this */
 
100
/* At a shutdown the value first climbs from 0 to SRV_SHUTDOWN_CLEANUP
 
101
and then to SRV_SHUTDOWN_LAST_PHASE, and so on */
 
102
 
 
103
extern  ulint   srv_shutdown_state;
 
104
 
 
105
#define SRV_SHUTDOWN_CLEANUP       1
 
106
#define SRV_SHUTDOWN_LAST_PHASE    2
 
107
#define SRV_SHUTDOWN_EXIT_THREADS  3
 
108
 
 
109
/* Log 'spaces' have id's >= this */
128
110
#define SRV_LOG_SPACE_FIRST_ID          0xFFFFFFF0UL
129
111
 
130
112
#endif