~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Lee Bieber
  • Date: 2011-03-23 23:16:25 UTC
  • mfrom: (2247.1.2 build)
  • Revision ID: kalebral@gmail.com-20110323231625-61k77qbh7n1iu776
Merge Olaf - Use BOOST_FOREACH
Merge Olaf - Remove std::nothrow from new()

Show diffs side-by-side

added added

removed removed

Lines of Context:
441
441
    boost::mutex::scoped_lock scopedLock(session::Cache::singleton().mutex());
442
442
    session::Cache::list list= session::Cache::singleton().getCache();
443
443
 
444
 
    for (session::Cache::list::iterator it= list.begin(); it != list.end(); ++it )
 
444
    BOOST_FOREACH(session::Cache::list::reference tmp, list)
445
445
    {
446
 
      Session::shared_ptr tmp(*it);
447
 
 
448
446
      tmp->setKilled(Session::KILL_CONNECTION);
449
447
      tmp->scheduler->killSession(tmp.get());
450
448
      DRIZZLE_CONNECTION_DONE(tmp->thread_id);
624
622
    session              Thread handler
625
623
*/
626
624
 
627
 
void drizzled::Session::unlink(session_id_t &session_id)
 
625
void Session::unlink(session_id_t &session_id)
628
626
{
629
627
  Session::shared_ptr session= session::Cache::singleton().find(session_id);
630
628
 
632
630
    unlink(session);
633
631
}
634
632
 
635
 
void drizzled::Session::unlink(Session::shared_ptr &session)
 
633
void Session::unlink(Session::shared_ptr &session)
636
634
{
637
635
  --connection_count;
638
636
 
819
817
  global_system_variables.min_examined_row_limit= in_min_examined_row_limit;
820
818
}
821
819
 
822
 
static void check_limits_max_join_size(drizzled::ha_rows in_max_join_size)
 
820
static void check_limits_max_join_size(ha_rows in_max_join_size)
823
821
{
824
822
  global_system_variables.max_join_size= INT32_MAX;
825
823
  if ((uint64_t)in_max_join_size < 1 || (uint64_t)in_max_join_size > INT32_MAX)
1017
1015
 
1018
1016
static void process_defaults_files()
1019
1017
{
1020
 
  for (vector<string>::iterator iter= defaults_file_list.begin();
1021
 
       iter != defaults_file_list.end();
1022
 
       ++iter)
 
1018
        BOOST_FOREACH(vector<string>::reference iter, defaults_file_list)
1023
1019
  {
1024
 
    fs::path file_location= *iter;
 
1020
    fs::path file_location= iter;
1025
1021
 
1026
1022
    ifstream input_defaults_file(file_location.file_string().c_str());
1027
1023
 
1037
1033
      string new_unknown_opt("--");
1038
1034
      new_unknown_opt.append(*it);
1039
1035
      ++it;
1040
 
      if (it != file_unknown.end())
1041
 
      {
1042
 
        if ((*it) != "true")
1043
 
        {
1044
 
          new_unknown_opt.push_back('=');
1045
 
          new_unknown_opt.append(*it);
1046
 
        }
1047
 
      }
1048
 
      else
1049
 
      {
1050
 
        break;
 
1036
      if (it == file_unknown.end())
 
1037
                                break;
 
1038
      if ((*it) != "true")
 
1039
      {
 
1040
        new_unknown_opt.push_back('=');
 
1041
        new_unknown_opt.append(*it);
1051
1042
      }
1052
1043
      unknown_options.push_back(new_unknown_opt);
1053
1044
    }
1057
1048
 
1058
1049
static void compose_defaults_file_list(vector<string> in_options)
1059
1050
{
1060
 
  for (vector<string>::iterator it= in_options.begin();
1061
 
       it != in_options.end();
1062
 
       ++it)
 
1051
        BOOST_FOREACH(vector<string>::reference it, in_options)
1063
1052
  {
1064
 
    fs::path p(*it);
 
1053
    fs::path p(it);
1065
1054
    if (fs::is_regular_file(p))
1066
 
      defaults_file_list.push_back(*it);
 
1055
      defaults_file_list.push_back(it);
1067
1056
    else
1068
1057
    {
1069
 
      errmsg_printf(error::ERROR,
1070
 
                  _("Defaults file '%s' not found\n"), (*it).c_str());
 
1058
      errmsg_printf(error::ERROR, _("Defaults file '%s' not found\n"), it.c_str());
1071
1059
      unireg_abort(1);
1072
1060
    }
1073
 
 
1074
1061
  }
1075
1062
}
1076
1063
 
1229
1216
  _("Max number of errors/warnings to store for a statement."))
1230
1217
  ("max-heap-table-size", po::value<uint64_t>(&global_system_variables.max_heap_table_size)->default_value(16*1024*1024L)->notifier(&check_limits_mhts),
1231
1218
  _("Don't allow creation of heap tables bigger than this."))
1232
 
  ("max-join-size", po::value<drizzled::ha_rows>(&global_system_variables.max_join_size)->default_value(INT32_MAX)->notifier(&check_limits_max_join_size),
 
1219
  ("max-join-size", po::value<ha_rows>(&global_system_variables.max_join_size)->default_value(INT32_MAX)->notifier(&check_limits_max_join_size),
1233
1220
  _("Joins that are probably going to read more than max_join_size records "
1234
1221
     "return an error."))
1235
1222
  ("max-length-for-sort-data", po::value<uint64_t>(&global_system_variables.max_length_for_sort_data)->default_value(1024)->notifier(&check_limits_mlfsd),
1346
1333
    CachedDirectory config_conf_d(config_conf_d_location.file_string());
1347
1334
    if (not config_conf_d.fail())
1348
1335
    {
1349
 
 
1350
 
      for (CachedDirectory::Entries::const_iterator iter= config_conf_d.getEntries().begin();
1351
 
           iter != config_conf_d.getEntries().end();
1352
 
           ++iter)
 
1336
                        BOOST_FOREACH(CachedDirectory::Entries::const_reference iter, config_conf_d.getEntries())
1353
1337
      {
1354
 
        string file_entry((*iter)->filename);
 
1338
        string file_entry(iter->filename);
1355
1339
 
1356
1340
        if (not file_entry.empty()
1357
1341
            && file_entry != "."
2285
2269
 
2286
2270
  if (not opt_help)
2287
2271
  {
2288
 
    const char *tmp_string= getenv("TMPDIR") ? getenv("TMPDIR") : NULL;
 
2272
    const char *tmp_string= getenv("TMPDIR");
2289
2273
    struct stat buf;
2290
2274
    drizzle_tmpdir.clear();
2291
2275