Skip to content

Commit bdfa49f

Browse files
committed
Remove redundant initialization of some InnoDB startup parameters
The InnoDB startup parameters will be initialized via pointers in innobase_system_variables[]. Remove some redundant link-time initialization.
1 parent 206ecb7 commit bdfa49f

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

storage/innobase/handler/ha_innodb.cc

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -215,46 +215,46 @@ static uint innobase_old_blocks_pct;
215215
/* The default values for the following char* start-up parameters
216216
are determined in innobase_init below: */
217217

218-
static char* innobase_data_home_dir= NULL;
219-
static char* innobase_data_file_path= NULL;
220-
static char* innobase_temp_data_file_path= NULL;
221-
static char* innobase_file_format_name= NULL;
222-
static char* innobase_change_buffering= NULL;
223-
static char* innobase_enable_monitor_counter= NULL;
224-
static char* innobase_disable_monitor_counter= NULL;
225-
static char* innobase_reset_monitor_counter= NULL;
226-
static char* innobase_reset_all_monitor_counter= NULL;
218+
static char* innobase_data_home_dir;
219+
static char* innobase_data_file_path;
220+
static char* innobase_temp_data_file_path;
221+
static char* innobase_file_format_name;
222+
static char* innobase_change_buffering;
223+
static char* innobase_enable_monitor_counter;
224+
static char* innobase_disable_monitor_counter;
225+
static char* innobase_reset_monitor_counter;
226+
static char* innobase_reset_all_monitor_counter;
227227

228228
/* The highest file format being used in the database. The value can be
229229
set by user, however, it will be adjusted to the newer file format if
230230
a table of such format is created/opened. */
231-
char* innobase_file_format_max= NULL;
231+
char* innobase_file_format_max;
232232

233233
/** Default value of innodb_file_format */
234234
static const char* innodb_file_format_default = "Barracuda";
235235
/** Default value of innodb_file_format_max */
236236
static const char* innodb_file_format_max_default = "Antelope";
237237

238-
static char* innobase_file_flush_method= NULL;
238+
static char* innobase_file_flush_method;
239239

240240
/* This variable can be set in the server configure file, specifying
241241
stopword table to be used */
242-
static char* innobase_server_stopword_table= NULL;
242+
static char* innobase_server_stopword_table;
243243

244244
/* Below we have boolean-valued start-up parameters, and their default
245245
values */
246246

247-
static my_bool innobase_file_format_check= TRUE;
248-
static my_bool innobase_use_atomic_writes= TRUE;
247+
static my_bool innobase_file_format_check;
248+
static my_bool innobase_use_atomic_writes;
249249
static my_bool innobase_use_fallocate;
250-
static my_bool innobase_use_doublewrite= TRUE;
251-
static my_bool innobase_use_checksums= TRUE;
252-
static my_bool innobase_locks_unsafe_for_binlog= FALSE;
253-
static my_bool innobase_rollback_on_timeout= FALSE;
254-
static my_bool innobase_create_status_file= FALSE;
255-
my_bool innobase_stats_on_metadata= TRUE;
256-
static my_bool innobase_large_prefix= FALSE;
257-
static my_bool innodb_optimize_fulltext_only= FALSE;
250+
static my_bool innobase_use_doublewrite;
251+
static my_bool innobase_use_checksums;
252+
static my_bool innobase_locks_unsafe_for_binlog;
253+
static my_bool innobase_rollback_on_timeout;
254+
static my_bool innobase_create_status_file;
255+
my_bool innobase_stats_on_metadata;
256+
static my_bool innobase_large_prefix;
257+
static my_bool innodb_optimize_fulltext_only;
258258

259259
static char* innodb_version_str = (char*) INNODB_VERSION_STR;
260260

storage/innobase/srv/srv0srv.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,34 +107,34 @@ const char srv_mysql50_table_name_prefix[10] = "#mysql50#";
107107
/* The following three are dir paths which are catenated before file
108108
names, where the file name itself may also contain a path */
109109

110-
char* srv_data_home= NULL;
110+
char* srv_data_home;
111111

112112
/** Rollback files directory, can be absolute. */
113-
char* srv_undo_dir = NULL;
113+
char* srv_undo_dir;
114114

115115
/** The number of tablespaces to use for rollback segments. */
116-
ulong srv_undo_tablespaces = 0;
116+
ulong srv_undo_tablespaces;
117117

118118
/** The number of UNDO tablespaces that are open and ready to use. */
119-
ulint srv_undo_tablespaces_open = 0;
119+
ulint srv_undo_tablespaces_open;
120120

121121
/** The number of UNDO tablespaces that are active (hosting some rollback
122122
segment). It is quite possible that some of the tablespaces doesn't host
123123
any of the rollback-segment based on configuration used. */
124-
ulint srv_undo_tablespaces_active = 0;
124+
ulint srv_undo_tablespaces_active;
125125

126126
/* The number of rollback segments to use */
127-
ulong srv_undo_logs = 1;
127+
ulong srv_undo_logs;
128128

129129
/** Rate at which UNDO records should be purged. */
130-
ulong srv_purge_rseg_truncate_frequency = 128;
130+
ulong srv_purge_rseg_truncate_frequency;
131131

132132
/** Enable or Disable Truncate of UNDO tablespace.
133133
Note: If enabled then UNDO tablespace will be selected for truncate.
134134
While Server waits for undo-tablespace to truncate if user disables
135135
it, truncate action is completed but no new tablespace is marked
136136
for truncate (action is never aborted). */
137-
my_bool srv_undo_log_truncate = FALSE;
137+
my_bool srv_undo_log_truncate;
138138

139139
/** Maximum size of undo tablespace. */
140140
unsigned long longsrv_max_undo_log_size;
@@ -166,23 +166,23 @@ my_bool high_level_read_only;
166166

167167
/** Place locks to records only i.e. do not use next-key locking except
168168
on duplicate key checking and foreign key checking */
169-
ibool srv_locks_unsafe_for_binlog = FALSE;
169+
ibool srv_locks_unsafe_for_binlog;
170170
/** Sort buffer size in index creation */
171-
ulong srv_sort_buf_size = 1048576;
171+
ulong srv_sort_buf_size;
172172
/** Maximum modification log file size for online index creation */
173173
unsigned long longsrv_online_max_size;
174174

175175
/* If this flag is TRUE, then we will use the native aio of the
176176
OS (provided we compiled Innobase with it in), otherwise we will
177177
use simulated aio we build below with threads.
178178
Currently we support native aio on windows and linux */
179-
my_bool srv_use_native_aio = TRUE;
180-
my_bool srv_numa_interleave = FALSE;
179+
my_bool srv_use_native_aio;
180+
my_bool srv_numa_interleave;
181181
/* If this flag is TRUE, then we will use fallocate(PUCH_HOLE)
182182
to the pages */
183183
UNIV_INTERN my_bool srv_use_trim;
184184
/* If this flag is TRUE, then we disable doublewrite buffer */
185-
UNIV_INTERN my_bool srv_use_atomic_writes = FALSE;
185+
UNIV_INTERN my_bool srv_use_atomic_writes;
186186
/* If this flag IS TRUE, then we use this algorithm for page compressing the pages */
187187
UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM;
188188
/* Number of threads used for multi-threaded flush */

0 commit comments

Comments
 (0)