~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Thomi Richards
  • Date: 2010-10-30 00:42:01 UTC
  • mfrom: (1891 staging)
  • mto: This revision was merged to the branch mainline in revision 1894.
  • Revision ID: thomir@gmail.com-20101030004201-zxi50ffop5xlvzve
fixed merge conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
321
321
 
322
322
FILE *stderror_file=0;
323
323
 
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;
327
327
 
328
328
const CHARSET_INFO *system_charset_info, *files_charset_info ;
787
787
 
788
788
static void check_limits_map(uint32_t in_max_allowed_packet)
789
789
{
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)
792
792
  {
793
793
    cout << N_("Error: Invalid Value for max_allowed_packet");
1100
1100
       iter != defaults_file_list.end();
1101
1101
       ++iter)
1102
1102
  {
1103
 
    fs::path file_location(system_config_dir);
1104
 
    if ((*iter)[0] != '/')
1105
 
    {
1106
 
      /* Relative path - add config dir */
1107
 
      file_location /= *iter;
1108
 
    }
1109
 
    else
1110
 
    {
1111
 
      file_location= *iter;
1112
 
    }
 
1103
    fs::path file_location= *iter;
1113
1104
 
1114
1105
    ifstream input_defaults_file(file_location.file_string().c_str());
1115
1106
    
1149
1140
       it != in_options.end();
1150
1141
       ++it)
1151
1142
  {
1152
 
    defaults_file_list.push_back(*it);
 
1143
    fs::path p(*it);
 
1144
    if (fs::is_regular_file(p))
 
1145
      defaults_file_list.push_back(*it);
 
1146
    else
 
1147
    {
 
1148
      errmsg_printf(ERRMSG_LVL_ERROR,
 
1149
                  _("Defaults file '%s' not found\n"), (*it).c_str());
 
1150
      unireg_abort(1);
 
1151
    }
 
1152
 
1153
1153
  }
1154
1154
}
1155
1155
 
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 "
1405
1405
  {
1406
1406
    defaults_file_list.insert(defaults_file_list.begin(),
1407
1407
                              system_config_file_drizzle);
1408
 
  }
1409
 
 
1410
 
  fs::path config_conf_d_location(system_config_dir);
1411
 
  config_conf_d_location /= "conf.d";
1412
 
 
1413
 
  CachedDirectory config_conf_d(config_conf_d_location.file_string());
1414
 
  if (not config_conf_d.fail())
1415
 
  {
1416
 
 
1417
 
    for (CachedDirectory::Entries::const_iterator iter= config_conf_d.getEntries().begin();
1418
 
         iter != config_conf_d.getEntries().end();
1419
 
         ++iter)
 
1408
 
 
1409
    fs::path config_conf_d_location(system_config_dir);
 
1410
    config_conf_d_location /= "conf.d";
 
1411
 
 
1412
    CachedDirectory config_conf_d(config_conf_d_location.file_string());
 
1413
    if (not config_conf_d.fail())
1420
1414
    {
1421
 
      string file_entry((*iter)->filename);
1422
 
          
1423
 
      if (not file_entry.empty()
1424
 
          && file_entry != "."
1425
 
          && file_entry != "..")
 
1415
 
 
1416
      for (CachedDirectory::Entries::const_iterator iter= config_conf_d.getEntries().begin();
 
1417
           iter != config_conf_d.getEntries().end();
 
1418
           ++iter)
1426
1419
      {
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);
 
1421
 
 
1422
        if (not file_entry.empty()
 
1423
            && file_entry != "."
 
1424
            && file_entry != "..")
 
1425
        {
 
1426
          fs::path the_entry(config_conf_d_location);
 
1427
          the_entry /= file_entry;
 
1428
          defaults_file_list.push_back(the_entry.file_string());
 
1429
        }
1430
1430
      }
1431
1431
    }
1432
1432
  }
1433
1433
 
1434
 
  process_defaults_files();
1435
1434
  /* TODO: here is where we should add a process_env_vars */
1436
1435
 
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);
1449
1448
  }
 
1449
 
 
1450
  process_defaults_files();
 
1451
 
 
1452
  /* Process with notify a second time because a config file may contain
 
1453
     plugin loader options */
 
1454
 
 
1455
  try
 
1456
  {
 
1457
    po::notify(vm);
 
1458
  }
 
1459
  catch (po::validation_error &err)
 
1460
  {
 
1461
    errmsg_printf(ERRMSG_LVL_ERROR,
 
1462
                  _("%s: %s.\n"
 
1463
                    "Use --help to get a list of available options\n"),
 
1464
                  internal::my_progname, err.what());
 
1465
    unireg_abort(1);
 
1466
  }
 
1467
 
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
1452
1470
  */
1531
1549
 
1532
1550
  if (item_create_init())
1533
1551
    return 1;
1534
 
  if (set_var_init())
 
1552
  if (sys_var_init())
1535
1553
    return 1;
1536
1554
  /* Creates static regex matching for temporal values */
1537
1555
  if (! init_temporal_formats())
1601
1619
    errmsg_printf(ERRMSG_LVL_ERROR, _("Could not initialize table cache\n"));
1602
1620
    unireg_abort(1);
1603
1621
  }
1604
 
  TableShare::cacheStart();
 
1622
 
 
1623
  // Resize the definition Cache at startup
 
1624
  definition::Cache::singleton().rehash(table_def_size);
1605
1625
 
1606
1626
  setup_fpu();
1607
1627
 
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."),