400
400
extern "C" bool drizzled_get_one_option(int, const struct my_option *, char *);
401
401
static int init_thread_environment();
402
402
static const char *get_relative_path(const char *path);
403
static void fix_paths(void);
403
static void fix_paths(string &progname);
404
404
extern "C" pthread_handler_t handle_slave(void *arg);
405
405
static void clean_up(bool print_message);
1508
1508
const std::string myisam_engine_name("MyISAM");
1509
1509
const std::string heap_engine_name("MEMORY");
1510
myisam_engine= plugin::StorageEngine::findByName(NULL, myisam_engine_name);
1511
heap_engine= plugin::StorageEngine::findByName(NULL, heap_engine_name);
1510
myisam_engine= plugin::StorageEngine::findByName(myisam_engine_name);
1511
heap_engine= plugin::StorageEngine::findByName(heap_engine_name);
1514
1514
Check that the default storage engine is actually available.
1518
1518
const std::string name(default_storage_engine_str);
1519
1519
plugin::StorageEngine *engine;
1521
engine= plugin::StorageEngine::findByName(0, name);
1521
engine= plugin::StorageEngine::findByName(name);
1522
1522
if (engine == NULL)
1524
1524
errmsg_printf(ERRMSG_LVL_ERROR, _("Unknown/unsupported table type: %s"),
1658
1658
init_status_vars();
1660
errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), my_progname, VERSION,
1661
COMPILATION_COMMENT);
1660
errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), my_progname,
1661
PANDORA_RELEASE_VERSION, COMPILATION_COMMENT);
1664
1664
/* Listen for new connections and start new session for each connection
2052
2053
N_("Directory for plugins."),
2053
2054
(char**) &opt_plugin_dir_ptr, (char**) &opt_plugin_dir_ptr, 0,
2054
2055
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2056
{"plugin_add", OPT_PLUGIN_ADD,
2057
N_("Optional comma separated list of plugins to load at startup in addition "
2058
"to the default list of plugins. "
2059
"[for example: --plugin_add=crc32,logger_gearman]"),
2060
(char**) &opt_plugin_add, (char**) &opt_plugin_add, 0,
2061
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2055
2062
{"plugin_load", OPT_PLUGIN_LOAD,
2056
N_("Optional comma separated list of plugins to load at starup."
2063
N_("Optional comma separated list of plugins to load at starup instead of "
2064
"the default plugin load list. "
2057
2065
"[for example: --plugin_load=crc32,logger_gearman]"),
2058
2066
(char**) &opt_plugin_load, (char**) &opt_plugin_load, 0,
2059
2067
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
2151
2159
version from the output of 'drizzled --version', so don't change it!
2153
2161
printf("%s Ver %s for %s-%s on %s (%s)\n",my_progname,
2154
VERSION, HOST_VENDOR, HOST_OS, HOST_CPU, COMPILATION_COMMENT);
2162
PANDORA_RELEASE_VERSION, HOST_VENDOR, HOST_OS, HOST_CPU,
2163
COMPILATION_COMMENT);
2157
2166
static void usage(void)
2487
2498
(void) my_load_path(drizzle_home, drizzle_home,""); // Resolve current dir
2488
2499
(void) my_load_path(drizzle_real_data_home, drizzle_real_data_home,drizzle_home);
2489
2500
(void) my_load_path(pidfile_name, pidfile_name,drizzle_real_data_home);
2490
(void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr :
2491
get_relative_path(PKGPLUGINDIR),
2502
if (opt_plugin_dir_ptr == NULL)
2504
/* No plugin dir has been specified. Figure out where the plugins are */
2505
if (progname[0] != FN_LIBCHAR)
2507
/* We have a relative path and need to find the absolute */
2508
char working_dir[FN_REFLEN];
2509
char *working_dir_ptr= working_dir;
2510
working_dir_ptr= getcwd(working_dir_ptr, FN_REFLEN);
2511
string new_path(working_dir);
2512
if (*(new_path.end()-1) != '/')
2513
new_path.push_back('/');
2514
if (progname[0] == '.' && progname[1] == '/')
2515
new_path.append(progname.substr(2));
2517
new_path.append(progname);
2518
progname.swap(new_path);
2521
/* Now, trim off the exe name */
2522
string progdir(progname.substr(0, progname.rfind(FN_LIBCHAR)+1));
2523
if (progdir.rfind(".libs/") != string::npos)
2525
progdir.assign(progdir.substr(0, progdir.rfind(".libs/")));
2527
string testfile(progdir);
2528
testfile.append("drizzled.o");
2529
struct stat testfile_stat;
2530
if (stat(testfile.c_str(), &testfile_stat))
2532
/* drizzled.o doesn't exist - we are not in a source dir.
2535
(void) my_load_path(opt_plugin_dir, get_relative_path(PKGPLUGINDIR),
2540
/* We are in a source dir! Plugin dir is ../plugin/.libs */
2541
size_t last_libchar_pos= progdir.rfind(FN_LIBCHAR,progdir.size()-2)+1;
2542
string source_plugindir(progdir.substr(0,last_libchar_pos));
2543
source_plugindir.append("plugin/.libs");
2544
(void) my_load_path(opt_plugin_dir, source_plugindir.c_str(), "");
2549
(void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr, drizzle_home);
2493
2551
opt_plugin_dir_ptr= opt_plugin_dir;
2495
2553
const char *sharedir= get_relative_path(PKGDATADIR);