~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
#include <sys/mman.h>
108
108
#endif
109
109
 
110
 
#define SIGNAL_FMT "signal %d"
111
 
 
112
 
 
113
110
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
114
111
#include <ieeefp.h>
115
112
#ifdef HAVE_FP_EXCEPT                           // Fix type conflict
126
123
#include <sys/fpu.h>
127
124
#endif
128
125
 
129
 
 
130
126
inline void setup_fpu()
131
127
{
132
128
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
173
169
/* Constants */
174
170
 
175
171
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
176
 
/*
177
 
  WARNING: When adding new SQL modes don't forget to update the
178
 
           tables definitions that stores it's value.
179
 
           (ie: mysql.event, mysql.proc)
180
 
*/
181
172
static const char *optimizer_switch_names[]=
182
173
{
183
174
  "no_materialization", "no_semijoin",
205
196
  tc_heuristic_recover_names, NULL
206
197
};
207
198
 
208
 
const char *first_keyword= "first", *binary_keyword= "BINARY";
209
 
const char *my_localhost= "localhost";
 
199
const char *first_keyword= "first";
 
200
const char *binary_keyword= "BINARY";
210
201
const char * const DRIZZLE_CONFIG_NAME= "drizzled";
211
202
#define GET_HA_ROWS GET_ULL
212
203
 
226
217
 
227
218
extern TYPELIB optimizer_use_mrr_typelib;
228
219
 
229
 
/* the default log output is log tables */
230
220
static bool volatile select_thread_in_use;
231
221
static bool volatile ready_to_exit;
232
222
static bool opt_debugging= 0;
234
224
static uint32_t killed_threads;
235
225
static char *drizzled_user, *drizzled_chroot;
236
226
static char *language_ptr;
237
 
static char *default_character_set_name;
238
 
static char *character_set_filesystem_name;
 
227
static const char *default_character_set_name;
 
228
static const char *character_set_filesystem_name;
239
229
static char *lc_time_names_name;
240
230
static char *my_bind_addr_str;
241
231
static char *default_collation_name;
242
232
static char *default_storage_engine_str;
243
 
static char compiled_default_collation_name[]= DRIZZLE_DEFAULT_COLLATION_NAME;
 
233
static const char *compiled_default_collation_name= "utf8_general_ci";
244
234
 
245
235
/* Global variables */
246
236
 
247
 
bool server_id_supplied = 0;
248
 
bool opt_endinfo, using_udf_functions;
 
237
bool opt_endinfo;
249
238
bool locked_in_memory;
250
239
bool volatile abort_loop;
251
240
bool volatile shutdown_in_progress;
262
251
StorageEngine *myisam_engine;
263
252
 
264
253
char* opt_secure_file_priv= 0;
265
 
/*
266
 
  True if there is at least one per-hour limit for some user, so we should
267
 
  check them before each query (and possibly reset counters when hour is
268
 
  changed). False otherwise.
269
 
*/
270
 
bool opt_noacl;
271
254
 
272
255
#ifdef HAVE_INITGROUPS
273
256
static bool calling_initgroups= false; /**< Used in SIGSEGV handler. */
866
849
  */
867
850
  if (segfaulted)
868
851
  {
869
 
    fprintf(stderr, _("Fatal " SIGNAL_FMT " while backtracing\n"), sig);
 
852
    fprintf(stderr, _("Fatal signal %d while backtracing\n"), sig);
870
853
    exit(1);
871
854
  }
872
855
 
882
865
  localtime_r(&curr_time, &tm);
883
866
  Scheduler &thread_scheduler= get_thread_scheduler();
884
867
  
885
 
  fprintf(stderr,"%02d%02d%02d %2d:%02d:%02d - drizzled got "
886
 
          SIGNAL_FMT " ;\n"
 
868
  fprintf(stderr,"%02d%02d%02d %2d:%02d:%02d - drizzled got signal %d;\n"
887
869
          "This could be because you hit a bug. It is also possible that "
888
870
          "this binary\n or one of the libraries it was linked against is "
889
871
          "corrupt, improperly built,\n or misconfigured. This error can "
1282
1264
  /* Creates static regex matching for temporal values */
1283
1265
  if (! init_temporal_formats())
1284
1266
    return 1;
1285
 
  /*
1286
 
    Process a comma-separated character set list and choose
1287
 
    the first available character set. This is mostly for
1288
 
    test purposes, to be able to start "mysqld" even if
1289
 
    the requested character set is not available (see bug#18743).
1290
 
  */
1291
 
  for (;;)
 
1267
 
 
1268
  if (!(default_charset_info=
 
1269
        get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY)))
1292
1270
  {
1293
 
    char *next_character_set_name= strchr(default_character_set_name, ',');
1294
 
    if (next_character_set_name)
1295
 
      *next_character_set_name++= '\0';
1296
 
    if (!(default_charset_info=
1297
 
          get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY)))
1298
 
    {
1299
 
      if (next_character_set_name)
1300
 
      {
1301
 
        default_character_set_name= next_character_set_name;
1302
 
        default_collation_name= 0;          // Ignore collation
1303
 
      }
1304
 
      else
1305
 
        return 1;                           // Eof of the list
1306
 
    }
1307
 
    else
1308
 
      break;
 
1271
    return 1;                           // Eof of the list
1309
1272
  }
1310
1273
 
1311
1274
  if (default_collation_name)
1402
1365
  if (ha_init_errors())
1403
1366
    return(1);
1404
1367
 
1405
 
  if (plugin_init(&defaults_argc, defaults_argv,
1406
 
                  (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
1407
 
                  (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
 
1368
  if (plugin_init(&defaults_argc, defaults_argv, (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
1408
1369
  {
1409
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize plugins."));
 
1370
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize plugins."));
1410
1371
    unireg_abort(1);
1411
1372
  }
1412
1373
 
1818
1779
  {"bind-address", OPT_BIND_ADDRESS, N_("IP address to bind to."),
1819
1780
   (char**) &my_bind_addr_str, (char**) &my_bind_addr_str, 0, GET_STR,
1820
1781
   REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1821
 
  {"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM,
1822
 
   N_("Set the filesystem character set."),
1823
 
   (char**) &character_set_filesystem_name,
1824
 
   (char**) &character_set_filesystem_name,
1825
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
1826
 
  {"character-set-server", 'C',
1827
 
   N_("Set the default character set."),
1828
 
   (char**) &default_character_set_name, (char**) &default_character_set_name,
1829
 
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
1830
1782
  {"chroot", 'r',
1831
1783
   N_("Chroot drizzled daemon during startup."),
1832
1784
   (char**) &drizzled_chroot, (char**) &drizzled_chroot, 0, GET_STR, REQUIRED_ARG,
2408
2360
  cleanup_done= 0;
2409
2361
  defaults_argc= 0;
2410
2362
  defaults_argv= 0;
2411
 
  server_id_supplied= 0;
2412
2363
  dropping_tables= ha_open_options=0;
2413
2364
  test_flags.reset();
2414
2365
  wake_thread=0;
2415
 
  opt_endinfo= using_udf_functions= 0;
 
2366
  opt_endinfo= false;
2416
2367
  abort_loop= select_thread_in_use= false;
2417
2368
  ready_to_exit= shutdown_in_progress= 0;
2418
2369
  aborted_threads= aborted_connects= 0;
2455
2406
  drizzle_data_home_len= 2;
2456
2407
 
2457
2408
  /* Variables in libraries */
2458
 
  default_character_set_name= (char*) DRIZZLE_DEFAULT_CHARSET_NAME;
2459
 
  default_collation_name= compiled_default_collation_name;
2460
 
  character_set_filesystem_name= (char*) "binary";
 
2409
  default_character_set_name= "utf8";
 
2410
  default_collation_name= (char *)compiled_default_collation_name;
 
2411
  character_set_filesystem_name= "binary";
2461
2412
  lc_time_names_name= (char*) "en_US";
2462
2413
  /* Set default values for some option variables */
2463
2414
  default_storage_engine_str= (char*) "innodb";
2578
2529
    strncpy(pidfile_name, argument, sizeof(pidfile_name)-1);
2579
2530
    break;
2580
2531
  case OPT_SERVER_ID:
2581
 
    server_id_supplied = 1;
2582
2532
    break;
2583
2533
  case OPT_DELAY_KEY_WRITE_ALL:
2584
2534
    if (argument != disabled_my_option)
2847
2797
 
2848
2798
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
2849
2799
/* Used templates */
2850
 
template class I_List<Session>;
2851
 
template class I_List_iterator<Session>;
2852
2800
template class I_List<i_string>;
2853
2801
template class I_List<i_string_pair>;
2854
2802
template class I_List<NAMED_LIST>;