~thomir-deactivatedaccount/drizzle/drizzle-fix-bug653747

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Monty Taylor
  • Date: 2010-10-15 05:16:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1856.
  • Revision ID: mordred@inaugust.com-20101015051632-1faw8fksacdj7qia
Removed sys_var_chain.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
#include <cstdio>
68
68
#include <map>
 
69
#include <vector>
69
70
#include <algorithm>
70
71
 
71
72
using namespace std;
125
126
  The variables are linked into the list. A variable is added to
126
127
  it in the constructor (see sys_var class for details).
127
128
*/
128
 
static sys_var_chain vars = { NULL, NULL };
129
 
 
130
129
static sys_var_session_uint64_t
131
 
sys_auto_increment_increment(&vars, "auto_increment_increment",
 
130
sys_auto_increment_increment("auto_increment_increment",
132
131
                             &system_variables::auto_increment_increment);
133
132
static sys_var_session_uint64_t
134
 
sys_auto_increment_offset(&vars, "auto_increment_offset",
 
133
sys_auto_increment_offset("auto_increment_offset",
135
134
                          &system_variables::auto_increment_offset);
136
135
 
137
 
static sys_var_fs_path sys_basedir(&vars, "basedir", basedir);
138
 
static sys_var_fs_path sys_pid_file(&vars, "pid_file", pid_file);
139
 
static sys_var_fs_path sys_plugin_dir(&vars, "plugin_dir", plugin_dir);
 
136
static sys_var_fs_path sys_basedir("basedir", basedir);
 
137
static sys_var_fs_path sys_pid_file("pid_file", pid_file);
 
138
static sys_var_fs_path sys_plugin_dir("plugin_dir", plugin_dir);
140
139
 
141
 
static sys_var_size_t_ptr sys_thread_stack_size(&vars, "thread_stack",
 
140
static sys_var_size_t_ptr sys_thread_stack_size("thread_stack",
142
141
                                                      &my_thread_stack_size);
143
 
static sys_var_uint32_t_ptr sys_back_log(&vars, "back_log", &back_log);
 
142
static sys_var_uint32_t_ptr sys_back_log("back_log", &back_log);
144
143
 
145
 
static sys_var_session_uint64_t sys_bulk_insert_buff_size(&vars, "bulk_insert_buffer_size",
 
144
static sys_var_session_uint64_t sys_bulk_insert_buff_size("bulk_insert_buffer_size",
146
145
                                                          &system_variables::bulk_insert_buff_size);
147
 
static sys_var_session_uint32_t sys_completion_type(&vars, "completion_type",
 
146
static sys_var_session_uint32_t sys_completion_type("completion_type",
148
147
                                                    &system_variables::completion_type,
149
148
                                                    check_completion_type,
150
149
                                                    fix_completion_type);
151
150
static sys_var_collation_sv
152
 
sys_collation_server(&vars, "collation_server", &system_variables::collation_server, &default_charset_info);
153
 
static sys_var_fs_path       sys_datadir(&vars, "datadir", getDataHome());
 
151
sys_collation_server("collation_server", &system_variables::collation_server, &default_charset_info);
 
152
static sys_var_fs_path       sys_datadir("datadir", getDataHome());
154
153
 
155
 
static sys_var_session_uint64_t sys_join_buffer_size(&vars, "join_buffer_size",
 
154
static sys_var_session_uint64_t sys_join_buffer_size("join_buffer_size",
156
155
                                                     &system_variables::join_buff_size);
157
 
static sys_var_session_uint32_t sys_max_allowed_packet(&vars, "max_allowed_packet",
 
156
static sys_var_session_uint32_t sys_max_allowed_packet("max_allowed_packet",
158
157
                                                       &system_variables::max_allowed_packet);
159
 
static sys_var_uint64_t_ptr     sys_max_connect_errors(&vars, "max_connect_errors",
 
158
static sys_var_uint64_t_ptr     sys_max_connect_errors("max_connect_errors",
160
159
                                               &max_connect_errors);
161
 
static sys_var_session_uint64_t sys_max_error_count(&vars, "max_error_count",
 
160
static sys_var_session_uint64_t sys_max_error_count("max_error_count",
162
161
                                                  &system_variables::max_error_count);
163
 
static sys_var_session_uint64_t sys_max_heap_table_size(&vars, "max_heap_table_size",
 
162
static sys_var_session_uint64_t sys_max_heap_table_size("max_heap_table_size",
164
163
                                                        &system_variables::max_heap_table_size);
165
 
static sys_var_session_uint64_t sys_pseudo_thread_id(&vars, "pseudo_thread_id",
 
164
static sys_var_session_uint64_t sys_pseudo_thread_id("pseudo_thread_id",
166
165
                                              &system_variables::pseudo_thread_id,
167
166
                                              0, check_pseudo_thread_id);
168
 
static sys_var_session_ha_rows  sys_max_join_size(&vars, "max_join_size",
 
167
static sys_var_session_ha_rows  sys_max_join_size("max_join_size",
169
168
                                                  &system_variables::max_join_size,
170
169
                                                  fix_max_join_size);
171
 
static sys_var_session_uint64_t sys_max_seeks_for_key(&vars, "max_seeks_for_key",
 
170
static sys_var_session_uint64_t sys_max_seeks_for_key("max_seeks_for_key",
172
171
                                                      &system_variables::max_seeks_for_key);
173
 
static sys_var_session_uint64_t   sys_max_length_for_sort_data(&vars, "max_length_for_sort_data",
 
172
static sys_var_session_uint64_t   sys_max_length_for_sort_data("max_length_for_sort_data",
174
173
                                                               &system_variables::max_length_for_sort_data);
175
 
static sys_var_session_size_t   sys_max_sort_length(&vars, "max_sort_length",
 
174
static sys_var_session_size_t   sys_max_sort_length("max_sort_length",
176
175
                                                    &system_variables::max_sort_length);
177
 
static sys_var_uint64_t_ptr     sys_max_write_lock_count(&vars, "max_write_lock_count",
 
176
static sys_var_uint64_t_ptr     sys_max_write_lock_count("max_write_lock_count",
178
177
                                                 &max_write_lock_count);
179
 
static sys_var_session_uint64_t sys_min_examined_row_limit(&vars, "min_examined_row_limit",
 
178
static sys_var_session_uint64_t sys_min_examined_row_limit("min_examined_row_limit",
180
179
                                                           &system_variables::min_examined_row_limit);
181
180
 
182
181
/* these two cannot be static */
183
 
static sys_var_session_bool sys_optimizer_prune_level(&vars, "optimizer_prune_level",
 
182
static sys_var_session_bool sys_optimizer_prune_level("optimizer_prune_level",
184
183
                                                      &system_variables::optimizer_prune_level);
185
 
static sys_var_session_uint32_t sys_optimizer_search_depth(&vars, "optimizer_search_depth",
 
184
static sys_var_session_uint32_t sys_optimizer_search_depth("optimizer_search_depth",
186
185
                                                           &system_variables::optimizer_search_depth);
187
186
 
188
 
static sys_var_session_uint64_t sys_preload_buff_size(&vars, "preload_buffer_size",
 
187
static sys_var_session_uint64_t sys_preload_buff_size("preload_buffer_size",
189
188
                                                      &system_variables::preload_buff_size);
190
 
static sys_var_session_uint32_t sys_read_buff_size(&vars, "read_buffer_size",
 
189
static sys_var_session_uint32_t sys_read_buff_size("read_buffer_size",
191
190
                                                   &system_variables::read_buff_size);
192
 
static sys_var_session_uint32_t sys_read_rnd_buff_size(&vars, "read_rnd_buffer_size",
 
191
static sys_var_session_uint32_t sys_read_rnd_buff_size("read_rnd_buffer_size",
193
192
                                                       &system_variables::read_rnd_buff_size);
194
 
static sys_var_session_uint32_t sys_div_precincrement(&vars, "div_precision_increment",
 
193
static sys_var_session_uint32_t sys_div_precincrement("div_precision_increment",
195
194
                                                      &system_variables::div_precincrement);
196
195
 
197
 
static sys_var_session_size_t   sys_range_alloc_block_size(&vars, "range_alloc_block_size",
 
196
static sys_var_session_size_t   sys_range_alloc_block_size("range_alloc_block_size",
198
197
                                                           &system_variables::range_alloc_block_size);
199
 
static sys_var_session_uint32_t sys_query_alloc_block_size(&vars, "query_alloc_block_size",
 
198
static sys_var_session_uint32_t sys_query_alloc_block_size("query_alloc_block_size",
200
199
                                                           &system_variables::query_alloc_block_size,
201
200
                                                           NULL, fix_session_mem_root);
202
 
static sys_var_session_uint32_t sys_query_prealloc_size(&vars, "query_prealloc_size",
 
201
static sys_var_session_uint32_t sys_query_prealloc_size("query_prealloc_size",
203
202
                                                        &system_variables::query_prealloc_size,
204
203
                                                        NULL, fix_session_mem_root);
205
 
static sys_var_readonly sys_tmpdir(&vars, "tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir);
 
204
static sys_var_readonly sys_tmpdir("tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir);
206
205
 
207
 
static sys_var_fs_path sys_secure_file_priv(&vars, "secure_file_priv",
 
206
static sys_var_fs_path sys_secure_file_priv("secure_file_priv",
208
207
                                            secure_file_priv);
209
208
 
210
 
static sys_var_const_str_ptr sys_scheduler(&vars, "scheduler",
 
209
static sys_var_const_str_ptr sys_scheduler("scheduler",
211
210
                                           (char**)&opt_scheduler);
212
211
 
213
 
static sys_var_uint32_t_ptr  sys_server_id(&vars, "server_id", &server_id,
 
212
static sys_var_uint32_t_ptr  sys_server_id("server_id", &server_id,
214
213
                                           fix_server_id);
215
214
 
216
 
static sys_var_session_size_t   sys_sort_buffer(&vars, "sort_buffer_size",
 
215
static sys_var_session_size_t   sys_sort_buffer("sort_buffer_size",
217
216
                                                &system_variables::sortbuff_size);
218
217
 
219
 
static sys_var_session_size_t sys_transaction_message_threshold(&vars, "transaction_message_threshold",
 
218
static sys_var_session_size_t sys_transaction_message_threshold("transaction_message_threshold",
220
219
                                                                &system_variables::transaction_message_threshold);
221
220
 
222
 
static sys_var_session_storage_engine sys_storage_engine(&vars, "storage_engine",
 
221
static sys_var_session_storage_engine sys_storage_engine("storage_engine",
223
222
                                       &system_variables::storage_engine);
224
 
static sys_var_const_str        sys_system_time_zone(&vars, "system_time_zone",
 
223
static sys_var_const_str        sys_system_time_zone("system_time_zone",
225
224
                                             system_time_zone);
226
 
static sys_var_size_t_ptr       sys_table_def_size(&vars, "table_definition_cache",
 
225
static sys_var_size_t_ptr       sys_table_def_size("table_definition_cache",
227
226
                                             &table_def_size);
228
 
static sys_var_uint64_t_ptr     sys_table_cache_size(&vars, "table_open_cache",
 
227
static sys_var_uint64_t_ptr     sys_table_cache_size("table_open_cache",
229
228
                                             &table_cache_size);
230
 
static sys_var_uint64_t_ptr     sys_table_lock_wait_timeout(&vars, "table_lock_wait_timeout",
 
229
static sys_var_uint64_t_ptr     sys_table_lock_wait_timeout("table_lock_wait_timeout",
231
230
                                                    &table_lock_wait_timeout);
232
 
static sys_var_session_enum     sys_tx_isolation(&vars, "tx_isolation",
 
231
static sys_var_session_enum     sys_tx_isolation("tx_isolation",
233
232
                                             &system_variables::tx_isolation,
234
233
                                             &tx_isolation_typelib,
235
234
                                             fix_tx_isolation,
236
235
                                             check_tx_isolation);
237
 
static sys_var_session_uint64_t sys_tmp_table_size(&vars, "tmp_table_size",
 
236
static sys_var_session_uint64_t sys_tmp_table_size("tmp_table_size",
238
237
                                           &system_variables::tmp_table_size);
239
 
static sys_var_bool_ptr  sys_timed_mutexes(&vars, "timed_mutexes", &internal::timed_mutexes);
240
 
static sys_var_const_str  sys_version(&vars, "version", version().c_str());
 
238
static sys_var_bool_ptr  sys_timed_mutexes("timed_mutexes", &internal::timed_mutexes);
 
239
static sys_var_const_str  sys_version("version", version().c_str());
241
240
 
242
 
static sys_var_const_str        sys_version_comment(&vars, "version_comment",
 
241
static sys_var_const_str        sys_version_comment("version_comment",
243
242
                                            COMPILATION_COMMENT);
244
 
static sys_var_const_str        sys_version_compile_machine(&vars, "version_compile_machine",
 
243
static sys_var_const_str        sys_version_compile_machine("version_compile_machine",
245
244
                                                      HOST_CPU);
246
 
static sys_var_const_str        sys_version_compile_os(&vars, "version_compile_os",
 
245
static sys_var_const_str        sys_version_compile_os("version_compile_os",
247
246
                                                 HOST_OS);
248
 
static sys_var_const_str        sys_version_compile_vendor(&vars, "version_compile_vendor",
 
247
static sys_var_const_str        sys_version_compile_vendor("version_compile_vendor",
249
248
                                                 HOST_VENDOR);
250
249
 
251
250
/* Variables that are bits in Session */
252
251
 
253
 
sys_var_session_bit sys_autocommit(&vars, "autocommit", 0,
 
252
sys_var_session_bit sys_autocommit("autocommit", 0,
254
253
                               set_option_autocommit,
255
254
                               OPTION_NOT_AUTOCOMMIT,
256
255
                               1);
257
 
static sys_var_session_bit      sys_big_selects(&vars, "sql_big_selects", 0,
 
256
static sys_var_session_bit      sys_big_selects("sql_big_selects", 0,
258
257
                                        set_option_bit,
259
258
                                        OPTION_BIG_SELECTS);
260
 
static sys_var_session_bit      sys_sql_warnings(&vars, "sql_warnings", 0,
 
259
static sys_var_session_bit      sys_sql_warnings("sql_warnings", 0,
261
260
                                         set_option_bit,
262
261
                                         OPTION_WARNINGS);
263
 
static sys_var_session_bit      sys_sql_notes(&vars, "sql_notes", 0,
 
262
static sys_var_session_bit      sys_sql_notes("sql_notes", 0,
264
263
                                         set_option_bit,
265
264
                                         OPTION_SQL_NOTES);
266
 
static sys_var_session_bit      sys_buffer_results(&vars, "sql_buffer_result", 0,
 
265
static sys_var_session_bit      sys_buffer_results("sql_buffer_result", 0,
267
266
                                           set_option_bit,
268
267
                                           OPTION_BUFFER_RESULT);
269
 
static sys_var_session_bit      sys_foreign_key_checks(&vars, "foreign_key_checks", 0,
 
268
static sys_var_session_bit      sys_foreign_key_checks("foreign_key_checks", 0,
270
269
                                               set_option_bit,
271
270
                                               OPTION_NO_FOREIGN_KEY_CHECKS, 1);
272
 
static sys_var_session_bit      sys_unique_checks(&vars, "unique_checks", 0,
 
271
static sys_var_session_bit      sys_unique_checks("unique_checks", 0,
273
272
                                          set_option_bit,
274
273
                                          OPTION_RELAXED_UNIQUE_CHECKS, 1);
275
274
/* Local state variables */
276
275
 
277
 
static sys_var_session_ha_rows  sys_select_limit(&vars, "sql_select_limit",
 
276
static sys_var_session_ha_rows  sys_select_limit("sql_select_limit",
278
277
                                                 &system_variables::select_limit);
279
 
static sys_var_timestamp sys_timestamp(&vars, "timestamp");
 
278
static sys_var_timestamp sys_timestamp("timestamp");
280
279
static sys_var_last_insert_id
281
 
sys_last_insert_id(&vars, "last_insert_id");
 
280
sys_last_insert_id("last_insert_id");
282
281
/*
283
282
  identity is an alias for last_insert_id(), so that we are compatible
284
283
  with Sybase
285
284
*/
286
 
static sys_var_last_insert_id sys_identity(&vars, "identity");
 
285
static sys_var_last_insert_id sys_identity("identity");
287
286
 
288
 
static sys_var_session_lc_time_names sys_lc_time_names(&vars, "lc_time_names");
 
287
static sys_var_session_lc_time_names sys_lc_time_names("lc_time_names");
289
288
 
290
289
/*
291
290
  We want statements referring explicitly to @@session.insert_id to be
299
298
  statement-based logging mode: t will be different on master and
300
299
  slave).
301
300
*/
302
 
static sys_var_readonly sys_error_count(&vars, "error_count",
 
301
static sys_var_readonly sys_error_count("error_count",
303
302
                                        OPT_SESSION,
304
303
                                        SHOW_INT,
305
304
                                        get_error_count);
306
 
static sys_var_readonly sys_warning_count(&vars, "warning_count",
 
305
static sys_var_readonly sys_warning_count("warning_count",
307
306
                                          OPT_SESSION,
308
307
                                          SHOW_INT,
309
308
                                          get_warning_count);
310
309
 
311
 
sys_var_session_uint64_t sys_group_concat_max_len(&vars, "group_concat_max_len",
 
310
sys_var_session_uint64_t sys_group_concat_max_len("group_concat_max_len",
312
311
                                                  &system_variables::group_concat_max_len);
313
312
 
314
 
sys_var_session_time_zone sys_time_zone(&vars, "time_zone");
 
313
sys_var_session_time_zone sys_time_zone("time_zone");
315
314
 
316
315
/* Global read-only variable containing hostname */
317
 
static sys_var_const_str        sys_hostname(&vars, "hostname", glob_hostname);
 
316
static sys_var_const_str        sys_hostname("hostname", glob_hostname);
318
317
 
319
318
bool sys_var::check(Session *, set_var *var)
320
319
{
1471
1470
}
1472
1471
 
1473
1472
 
1474
 
/*
1475
 
  Add variables to the dynamic hash of system variables
1476
 
 
1477
 
  SYNOPSIS
1478
 
    mysql_add_sys_var_chain()
1479
 
    first       Pointer to first system variable to add
1480
 
    long_opt    (optional)command line arguments may be tied for limit checks.
1481
 
 
1482
 
  RETURN VALUES
1483
 
    0           SUCCESS
1484
 
    otherwise   FAILURE
1485
 
*/
1486
 
 
1487
 
 
1488
 
int mysql_add_sys_var_chain(sys_var *first, struct option *long_options)
1489
 
{
1490
 
  sys_var *var;
1491
 
  /* @todo for future A write lock should be held on LOCK_system_variables_hash */
1492
 
 
1493
 
  for (var= first; var; var= var->getNext())
1494
 
  {
1495
 
 
1496
 
    string lower_name(var->getName());
1497
 
    transform(lower_name.begin(), lower_name.end(),
1498
 
              lower_name.begin(), ::tolower);
1499
 
 
1500
 
    /* this fails if there is a conflicting variable name. */
1501
 
    if (system_variable_map.find(lower_name) != system_variable_map.end())
1502
 
    {
1503
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("Variable named %s already exists!\n"),
1504
 
                    var->getName().c_str());
1505
 
      return 1;
1506
 
    } 
1507
 
 
1508
 
    pair<SystemVariableMap::iterator, bool> ret= 
1509
 
      system_variable_map.insert(make_pair(lower_name, var));
1510
 
    if (ret.second == false)
1511
 
    {
1512
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("Could not add Variable: %s\n"),
1513
 
                    var->getName().c_str());
1514
 
      return 1;
1515
 
    }
1516
 
 
1517
 
    if (long_options)
1518
 
      var->setOptionLimits(find_option(long_options, var->getName().c_str()));
1519
 
  }
1520
 
  return 0;
1521
 
 
1522
 
}
1523
 
 
1524
 
 
1525
 
/*
1526
 
  Remove variables to the dynamic hash of system variables
1527
 
 
1528
 
  SYNOPSIS
1529
 
    mysql_del_sys_var_chain()
1530
 
    first       Pointer to first system variable to remove
1531
 
 
1532
 
  RETURN VALUES
1533
 
    0           SUCCESS
1534
 
    otherwise   FAILURE
1535
 
*/
1536
 
 
1537
 
int mysql_del_sys_var_chain(sys_var *first)
1538
 
{
1539
 
 
1540
 
  /* A write lock should be held on LOCK_system_variables_hash */
1541
 
  for (sys_var *var= first; var; var= var->getNext())
1542
 
  {
1543
 
    string lower_name(var->getName());
1544
 
    transform(lower_name.begin(), lower_name.end(),
1545
 
              lower_name.begin(), ::tolower);
1546
 
    system_variable_map.erase(lower_name);
1547
 
  }
1548
 
  return 0;
1549
 
}
1550
1473
 
1551
1474
 
1552
1475
 
1589
1512
}
1590
1513
 
1591
1514
 
 
1515
 
 
1516
void add_sys_var_to_list(sys_var *var)
 
1517
{
 
1518
  string lower_name(var->getName());
 
1519
  transform(lower_name.begin(), lower_name.end(),
 
1520
            lower_name.begin(), ::tolower);
 
1521
 
 
1522
  /* this fails if there is a conflicting variable name. */
 
1523
  if (system_variable_map.find(lower_name) != system_variable_map.end())
 
1524
  {
 
1525
    errmsg_printf(ERRMSG_LVL_ERROR, _("Variable named %s already exists!\n"),
 
1526
                  var->getName().c_str());
 
1527
    throw exception();
 
1528
  } 
 
1529
 
 
1530
  pair<SystemVariableMap::iterator, bool> ret= 
 
1531
    system_variable_map.insert(make_pair(lower_name, var));
 
1532
  if (ret.second == false)
 
1533
  {
 
1534
    errmsg_printf(ERRMSG_LVL_ERROR, _("Could not add Variable: %s\n"),
 
1535
                  var->getName().c_str());
 
1536
    throw exception();
 
1537
  }
 
1538
}
 
1539
 
 
1540
void add_sys_var_to_list(sys_var *var, struct option *long_options)
 
1541
{
 
1542
  add_sys_var_to_list(var);
 
1543
  var->setOptionLimits(find_option(long_options, var->getName().c_str()));
 
1544
}
 
1545
 
1592
1546
/*
1593
1547
  Initialize the system variables
1594
1548
 
1602
1556
 
1603
1557
int set_var_init()
1604
1558
{
1605
 
  uint32_t count= 0;
1606
 
 
1607
 
  for (sys_var *var= vars.first; var; var= var->getNext(), count++) {};
1608
 
 
1609
 
  vars.last->setNext(NULL);
1610
 
  if (mysql_add_sys_var_chain(vars.first, my_long_options))
1611
 
    goto error;
1612
 
 
 
1559
  try
 
1560
  {
 
1561
    add_sys_var_to_list(&sys_auto_increment_increment, my_long_options);
 
1562
    add_sys_var_to_list(&sys_auto_increment_offset, my_long_options);
 
1563
    add_sys_var_to_list(&sys_autocommit, my_long_options);
 
1564
    add_sys_var_to_list(&sys_back_log, my_long_options);
 
1565
    add_sys_var_to_list(&sys_basedir, my_long_options);
 
1566
    add_sys_var_to_list(&sys_big_selects, my_long_options);
 
1567
    add_sys_var_to_list(&sys_buffer_results, my_long_options);
 
1568
    add_sys_var_to_list(&sys_bulk_insert_buff_size, my_long_options);
 
1569
    add_sys_var_to_list(&sys_collation_server, my_long_options);
 
1570
    add_sys_var_to_list(&sys_completion_type, my_long_options);
 
1571
    add_sys_var_to_list(&sys_datadir, my_long_options);
 
1572
    add_sys_var_to_list(&sys_div_precincrement, my_long_options);
 
1573
    add_sys_var_to_list(&sys_error_count, my_long_options);
 
1574
    add_sys_var_to_list(&sys_foreign_key_checks, my_long_options);
 
1575
    add_sys_var_to_list(&sys_group_concat_max_len, my_long_options);
 
1576
    add_sys_var_to_list(&sys_hostname, my_long_options);
 
1577
    add_sys_var_to_list(&sys_identity, my_long_options);
 
1578
    add_sys_var_to_list(&sys_join_buffer_size, my_long_options);
 
1579
    add_sys_var_to_list(&sys_last_insert_id, my_long_options);
 
1580
    add_sys_var_to_list(&sys_lc_time_names, my_long_options);
 
1581
    add_sys_var_to_list(&sys_max_allowed_packet, my_long_options);
 
1582
    add_sys_var_to_list(&sys_max_connect_errors, my_long_options);
 
1583
    add_sys_var_to_list(&sys_max_error_count, my_long_options);
 
1584
    add_sys_var_to_list(&sys_max_heap_table_size, my_long_options);
 
1585
    add_sys_var_to_list(&sys_max_join_size, my_long_options);
 
1586
    add_sys_var_to_list(&sys_max_length_for_sort_data, my_long_options);
 
1587
    add_sys_var_to_list(&sys_max_seeks_for_key, my_long_options);
 
1588
    add_sys_var_to_list(&sys_max_sort_length, my_long_options);
 
1589
    add_sys_var_to_list(&sys_max_write_lock_count, my_long_options);
 
1590
    add_sys_var_to_list(&sys_min_examined_row_limit, my_long_options);
 
1591
    add_sys_var_to_list(&sys_optimizer_prune_level, my_long_options);
 
1592
    add_sys_var_to_list(&sys_optimizer_search_depth, my_long_options);
 
1593
    add_sys_var_to_list(&sys_pid_file, my_long_options);
 
1594
    add_sys_var_to_list(&sys_plugin_dir, my_long_options);
 
1595
    add_sys_var_to_list(&sys_preload_buff_size, my_long_options);
 
1596
    add_sys_var_to_list(&sys_pseudo_thread_id, my_long_options);
 
1597
    add_sys_var_to_list(&sys_query_alloc_block_size, my_long_options);
 
1598
    add_sys_var_to_list(&sys_query_prealloc_size, my_long_options);
 
1599
    add_sys_var_to_list(&sys_range_alloc_block_size, my_long_options);
 
1600
    add_sys_var_to_list(&sys_read_buff_size, my_long_options);
 
1601
    add_sys_var_to_list(&sys_read_rnd_buff_size, my_long_options);
 
1602
    add_sys_var_to_list(&sys_scheduler, my_long_options);
 
1603
    add_sys_var_to_list(&sys_secure_file_priv, my_long_options);
 
1604
    add_sys_var_to_list(&sys_select_limit, my_long_options);
 
1605
    add_sys_var_to_list(&sys_server_id, my_long_options);
 
1606
    add_sys_var_to_list(&sys_sort_buffer, my_long_options);
 
1607
    add_sys_var_to_list(&sys_sql_notes, my_long_options);
 
1608
    add_sys_var_to_list(&sys_sql_warnings, my_long_options);
 
1609
    add_sys_var_to_list(&sys_storage_engine, my_long_options);
 
1610
    add_sys_var_to_list(&sys_system_time_zone, my_long_options);
 
1611
    add_sys_var_to_list(&sys_table_cache_size, my_long_options);
 
1612
    add_sys_var_to_list(&sys_table_def_size, my_long_options);
 
1613
    add_sys_var_to_list(&sys_table_lock_wait_timeout, my_long_options);
 
1614
    add_sys_var_to_list(&sys_thread_stack_size, my_long_options);
 
1615
    add_sys_var_to_list(&sys_time_zone, my_long_options);
 
1616
    add_sys_var_to_list(&sys_timed_mutexes, my_long_options);
 
1617
    add_sys_var_to_list(&sys_timestamp, my_long_options);
 
1618
    add_sys_var_to_list(&sys_tmp_table_size, my_long_options);
 
1619
    add_sys_var_to_list(&sys_tmpdir, my_long_options);
 
1620
    add_sys_var_to_list(&sys_transaction_message_threshold, my_long_options);
 
1621
    add_sys_var_to_list(&sys_tx_isolation, my_long_options);
 
1622
    add_sys_var_to_list(&sys_unique_checks, my_long_options);
 
1623
    add_sys_var_to_list(&sys_version, my_long_options);
 
1624
    add_sys_var_to_list(&sys_version_comment, my_long_options);
 
1625
    add_sys_var_to_list(&sys_version_compile_machine, my_long_options);
 
1626
    add_sys_var_to_list(&sys_version_compile_os, my_long_options);
 
1627
    add_sys_var_to_list(&sys_version_compile_vendor, my_long_options);
 
1628
    add_sys_var_to_list(&sys_warning_count, my_long_options);
 
1629
  }
 
1630
  catch (...)
 
1631
  {
 
1632
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize system variables"));
 
1633
    return(1);
 
1634
  }
1613
1635
  return(0);
1614
 
 
1615
 
error:
1616
 
   errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize system variables"));
1617
 
  return(1);
1618
1636
}
1619
1637
 
1620
1638