322
322
FILE *stderror_file=0;
324
struct system_variables global_system_variables;
325
struct system_variables max_system_variables;
324
struct drizzle_system_variables global_system_variables;
325
struct drizzle_system_variables max_system_variables;
326
326
struct global_counters current_global_counters;
328
328
const CHARSET_INFO *system_charset_info, *files_charset_info ;
788
788
static void check_limits_map(uint32_t in_max_allowed_packet)
790
global_system_variables.max_allowed_packet= (1024*1024L);
790
global_system_variables.max_allowed_packet= (64*1024*1024L);
791
791
if (in_max_allowed_packet < 1024 || in_max_allowed_packet > 1024*1024L*1024L)
793
793
cout << N_("Error: Invalid Value for max_allowed_packet");
1100
1100
iter != defaults_file_list.end();
1103
fs::path file_location(system_config_dir);
1104
if ((*iter)[0] != '/')
1106
/* Relative path - add config dir */
1107
file_location /= *iter;
1111
file_location= *iter;
1103
fs::path file_location= *iter;
1114
1105
ifstream input_defaults_file(file_location.file_string().c_str());
1149
1140
it != in_options.end();
1152
defaults_file_list.push_back(*it);
1144
if (fs::is_regular_file(p))
1145
defaults_file_list.push_back(*it);
1148
errmsg_printf(ERRMSG_LVL_ERROR,
1149
_("Defaults file '%s' not found\n"), (*it).c_str());
1300
1300
N_("The maximum length of the result of function group_concat."))
1301
1301
("join-buffer-size", po::value<uint64_t>(&global_system_variables.join_buff_size)->default_value(128*1024L)->notifier(&check_limits_join_buffer_size),
1302
1302
N_("The size of the buffer that is used for full joins."))
1303
("max-allowed-packet", po::value<uint32_t>(&global_system_variables.max_allowed_packet)->default_value(1024*1024L)->notifier(&check_limits_map),
1303
("max-allowed-packet", po::value<uint32_t>(&global_system_variables.max_allowed_packet)->default_value(64*1024*1024L)->notifier(&check_limits_map),
1304
1304
N_("Max packetlength to send/receive from to server."))
1305
1305
("max-connect-errors", po::value<uint64_t>(&max_connect_errors)->default_value(MAX_CONNECT_ERRORS)->notifier(&check_limits_mce),
1306
1306
N_("If there is more than this number of interrupted connections from a "
1406
1406
defaults_file_list.insert(defaults_file_list.begin(),
1407
1407
system_config_file_drizzle);
1410
fs::path config_conf_d_location(system_config_dir);
1411
config_conf_d_location /= "conf.d";
1413
CachedDirectory config_conf_d(config_conf_d_location.file_string());
1414
if (not config_conf_d.fail())
1417
for (CachedDirectory::Entries::const_iterator iter= config_conf_d.getEntries().begin();
1418
iter != config_conf_d.getEntries().end();
1409
fs::path config_conf_d_location(system_config_dir);
1410
config_conf_d_location /= "conf.d";
1412
CachedDirectory config_conf_d(config_conf_d_location.file_string());
1413
if (not config_conf_d.fail())
1421
string file_entry((*iter)->filename);
1423
if (not file_entry.empty()
1424
&& file_entry != "."
1425
&& file_entry != "..")
1416
for (CachedDirectory::Entries::const_iterator iter= config_conf_d.getEntries().begin();
1417
iter != config_conf_d.getEntries().end();
1427
fs::path the_entry(config_conf_d_location);
1428
the_entry /= file_entry;
1429
defaults_file_list.push_back(the_entry.file_string());
1420
string file_entry((*iter)->filename);
1422
if (not file_entry.empty()
1423
&& file_entry != "."
1424
&& file_entry != "..")
1426
fs::path the_entry(config_conf_d_location);
1427
the_entry /= file_entry;
1428
defaults_file_list.push_back(the_entry.file_string());
1434
process_defaults_files();
1435
1434
/* TODO: here is where we should add a process_env_vars */
1437
1436
/* We need a notify here so that plugin_init will work properly */
1447
1446
internal::my_progname, err.what());
1448
1447
unireg_abort(1);
1450
process_defaults_files();
1452
/* Process with notify a second time because a config file may contain
1453
plugin loader options */
1459
catch (po::validation_error &err)
1461
errmsg_printf(ERRMSG_LVL_ERROR,
1463
"Use --help to get a list of available options\n"),
1464
internal::my_progname, err.what());
1450
1468
/* At this point, we've read all the options we need to read from files and
1451
1469
collected most of them into unknown options - now let's load everything
1601
1619
errmsg_printf(ERRMSG_LVL_ERROR, _("Could not initialize table cache\n"));
1602
1620
unireg_abort(1);
1604
TableShare::cacheStart();
1623
// Resize the definition Cache at startup
1624
definition::Cache::singleton().rehash(table_def_size);
1908
1928
N_("Max packetlength to send/receive from to server."),
1909
1929
(char**) &global_system_variables.max_allowed_packet,
1910
1930
(char**) &max_system_variables.max_allowed_packet, 0, GET_UINT32,
1911
REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
1931
REQUIRED_ARG, 64*1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
1912
1932
{"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
1913
1933
N_("If there is more than this number of interrupted connections from a "
1914
1934
"host this host will be blocked from further connections."),