~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Brian Aker
  • Date: 2009-08-15 00:59:30 UTC
  • mfrom: (1115.1.7 merge)
  • Revision ID: brian@gaz-20090815005930-q47yenjrq1esiwsz
Merge of Trond + Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
# endif
60
60
#endif
61
61
 
62
 
#include <plugin/myisam/ha_myisam.h>
63
 
 
64
62
#ifdef HAVE_SYS_PRCTL_H
65
63
#include <sys/prctl.h>
66
64
#endif
264
262
uint32_t drizzled_port_timeout;
265
263
std::bitset<12> test_flags;
266
264
uint32_t dropping_tables, ha_open_options;
267
 
uint32_t delay_key_write_options;
268
265
uint32_t tc_heuristic_recover= 0;
269
266
uint64_t session_startup_options;
270
267
uint32_t back_log;
328
325
char drizzle_data_home_buff[2], *drizzle_data_home=drizzle_real_data_home;
329
326
char *drizzle_tmpdir= NULL;
330
327
char *opt_drizzle_tmpdir= NULL;
331
 
const char *myisam_stats_method_str="nulls_unequal";
332
328
 
333
329
/** name of reference on left espression in rewritten IN subquery */
334
330
const char *in_left_expr_name= "<left expr>";
1411
1407
 
1412
1408
  /*
1413
1409
    This is entirely for legacy. We will create a new "disk based" engine and a
1414
 
    "memory" engine which will be configurable longterm. We should be able to
1415
 
    remove partition and myisammrg.
 
1410
    "memory" engine which will be configurable longterm.
1416
1411
  */
1417
1412
  const std::string myisam_engine_name("MyISAM");
1418
1413
  const std::string heap_engine_name("MEMORY");
1615
1610
enum options_drizzled
1616
1611
{
1617
1612
  OPT_SOCKET=256,
1618
 
  OPT_BIND_ADDRESS,            OPT_PID_FILE,
 
1613
  OPT_BIND_ADDRESS,            
 
1614
  OPT_PID_FILE,
1619
1615
  OPT_STORAGE_ENGINE,          
1620
1616
  OPT_INIT_FILE,
1621
 
  OPT_DELAY_KEY_WRITE_ALL,
1622
1617
  OPT_DELAY_KEY_WRITE,
1623
1618
  OPT_WANT_CORE,
1624
1619
  OPT_MEMLOCK,
1644
1639
  OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
1645
1640
  OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
1646
1641
  OPT_MYISAM_USE_MMAP, OPT_MYISAM_REPAIR_THREADS,
1647
 
  OPT_MYISAM_STATS_METHOD,
1648
1642
  OPT_NET_BUFFER_LENGTH,
1649
1643
  OPT_PRELOAD_BUFFER_SIZE,
1650
1644
  OPT_RECORD_BUFFER,
1941
1935
   (char**) &global_system_variables.min_examined_row_limit,
1942
1936
   (char**) &max_system_variables.min_examined_row_limit, 0, GET_ULL,
1943
1937
   REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0},
1944
 
  {"myisam_stats_method", OPT_MYISAM_STATS_METHOD,
1945
 
   N_("Specifies how MyISAM index statistics collection code should threat "
1946
 
      "NULLs. Possible values of name are 'nulls_unequal' "
1947
 
      "(default behavior), "
1948
 
      "'nulls_equal' (emulate MySQL 4.0 behavior), and 'nulls_ignored'."),
1949
 
   (char**) &myisam_stats_method_str, (char**) &myisam_stats_method_str, 0,
1950
 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1951
1938
  {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
1952
1939
   N_("Buffer length for TCP/IP and socket communication."),
1953
1940
   (char**) &global_system_variables.net_buffer_length,
2260
2247
  character_set_filesystem= &my_charset_bin;
2261
2248
 
2262
2249
  /* Things with default values that are not zero */
2263
 
  delay_key_write_options= (uint32_t) DELAY_KEY_WRITE_ON;
2264
2250
  drizzle_home_ptr= drizzle_home;
2265
2251
  pidfile_name_ptr= pidfile_name;
2266
2252
  language_ptr= language;
2268
2254
  session_startup_options= (OPTION_AUTO_IS_NULL | OPTION_SQL_NOTES);
2269
2255
  refresh_version= 1L;  /* Increments on each reload */
2270
2256
  global_thread_id= 1UL;
2271
 
  myisam_stats_method_str= "nulls_unequal";
2272
2257
  session_list.clear();
2273
2258
 
2274
2259
  /* Set directory paths */
2292
2277
  max_system_variables.select_limit=    (uint64_t) HA_POS_ERROR;
2293
2278
  global_system_variables.max_join_size= (uint64_t) HA_POS_ERROR;
2294
2279
  max_system_variables.max_join_size=   (uint64_t) HA_POS_ERROR;
2295
 
  /*
2296
 
    Default behavior for 4.1 and 5.0 is to treat NULL values as unequal
2297
 
    when collecting index statistics for MyISAM tables.
2298
 
  */
2299
 
  global_system_variables.myisam_stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL;
2300
2280
 
2301
2281
  /* Variables that depends on compile options */
2302
2282
#ifdef HAVE_BROKEN_REALPATH
2404
2384
    break;
2405
2385
  case OPT_SERVER_ID:
2406
2386
    break;
2407
 
  case OPT_DELAY_KEY_WRITE_ALL:
2408
 
    if (argument != disabled_my_option)
2409
 
      argument= (char*) "ALL";
2410
 
    /* Fall through */
2411
 
  case OPT_DELAY_KEY_WRITE:
2412
 
    if (argument == disabled_my_option)
2413
 
      delay_key_write_options= (uint32_t) DELAY_KEY_WRITE_NONE;
2414
 
    else if (! argument)
2415
 
      delay_key_write_options= (uint32_t) DELAY_KEY_WRITE_ON;
2416
 
    else
2417
 
    {
2418
 
      int type;
2419
 
      type= find_type_or_exit(argument, &delay_key_write_typelib, opt->name);
2420
 
      delay_key_write_options= (uint32_t) type-1;
2421
 
    }
2422
 
    break;
2423
2387
  case OPT_TX_ISOLATION:
2424
2388
    {
2425
2389
      int type;
2432
2396
                                            &tc_heuristic_recover_typelib,
2433
2397
                                            opt->name);
2434
2398
    break;
2435
 
  case OPT_MYISAM_STATS_METHOD:
2436
 
    {
2437
 
      uint32_t method_conv;
2438
 
      int method;
2439
 
 
2440
 
      myisam_stats_method_str= argument;
2441
 
      method= find_type_or_exit(argument, &myisam_stats_method_typelib,
2442
 
                                opt->name);
2443
 
      switch (method-1) {
2444
 
      case 2:
2445
 
        method_conv= MI_STATS_METHOD_IGNORE_NULLS;
2446
 
        break;
2447
 
      case 1:
2448
 
        method_conv= MI_STATS_METHOD_NULLS_EQUAL;
2449
 
        break;
2450
 
      case 0:
2451
 
      default:
2452
 
        method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL;
2453
 
        break;
2454
 
      }
2455
 
      global_system_variables.myisam_stats_method= method_conv;
2456
 
      break;
2457
 
    }
2458
2399
  }
 
2400
 
2459
2401
  return 0;
2460
2402
}
2461
2403
 
2513
2455
    test_flags.set(TEST_NO_STACKTRACE);
2514
2456
    test_flags.reset(TEST_CORE_ON_SIGNAL);
2515
2457
  }
2516
 
  /* Set global MyISAM variables from delay_key_write_options */
2517
 
  fix_delay_key_write((Session*) 0, OPT_GLOBAL);
2518
2458
 
2519
2459
  if (drizzled_chroot)
2520
2460
    set_root(drizzled_chroot);
2525
2465
    In most cases the global variables will not be used
2526
2466
  */
2527
2467
  my_default_record_cache_size=global_system_variables.read_buff_size;
2528
 
  myisam_max_temp_length= INT32_MAX;
2529
2468
}
2530
2469
 
2531
2470