summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc54
1 files changed, 39 insertions, 15 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 862ee1a66b2..e19427ceeb0 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -773,15 +773,6 @@ void kill_mysql(void)
CloseHandle(hEvent);
*/
}
-#ifdef HAVE_SMEM
- /*
- Send event to smem_event_connect_request for aborting
- */
- if (!SetEvent(smem_event_connect_request))
- {
- DBUG_PRINT("error",("Got error: %ld from SetEvent of smem_event_connect_request",GetLastError()));
- }
-#endif
#endif
#elif defined(OS2)
pthread_cond_signal( &eventShutdown); // post semaphore
@@ -835,6 +826,18 @@ static void __cdecl kill_server(int sig_ptr)
else
sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
+#if defined(HAVE_SMEM) && defined(__WIN__)
+ /*
+ Send event to smem_event_connect_request for aborting
+ */
+ if (!SetEvent(smem_event_connect_request))
+ {
+ DBUG_PRINT("error",
+ ("Got error: %ld from SetEvent of smem_event_connect_request",
+ GetLastError()));
+ }
+#endif
+
#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2))
my_thread_init(); // If this is a new thread
#endif
@@ -1162,6 +1165,7 @@ static struct passwd *check_user(const char *user)
err:
sql_print_error("Fatal error: Can't change to run as user '%s' ; Please check that the user exists!\n",user);
+ unireg_abort(1);
#endif
return NULL;
}
@@ -2423,8 +2427,10 @@ static int init_common_variables(const char *conf_file_name, int argc,
{
struct tm tm_tmp;
localtime_r(&start_time,&tm_tmp);
- strmov(system_time_zone, tzname[tm_tmp.tm_isdst != 0 ? 1 : 0]);
- }
+ strmake(system_time_zone, tzname[tm_tmp.tm_isdst != 0 ? 1 : 0],
+ sizeof(system_time_zone)-1);
+
+ }
#endif
/*
We set SYSTEM time zone as reasonable default and
@@ -3078,7 +3084,8 @@ we force server id to 2, but this MySQL server will not act as a slave.");
if (opt_bootstrap)
{
- int error=bootstrap(stdin);
+ select_thread_in_use= 0; // Allow 'kill' to work
+ int error= bootstrap(stdin);
end_thr_alarm(1); // Don't allow alarms
unireg_abort(error ? 1 : 0);
}
@@ -4549,7 +4556,7 @@ Disable with --skip-ndbcluster (will save memory).",
"Specify number of autoincrement values that are prefetched.",
(gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
(gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
- 0, GET_INT, REQUIRED_ARG, 32, 1, 256, 0, 0, 0},
+ 0, GET_ULONG, REQUIRED_ARG, 32, 1, 256, 0, 0, 0},
{"ndb-force-send", OPT_NDB_FORCE_SEND,
"Force send of buffers to ndb immediately without waiting for "
"other threads.",
@@ -6181,9 +6188,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case OPT_STORAGE_ENGINE:
{
if ((enum db_type)((global_system_variables.table_type=
- ha_resolve_by_name(argument, strlen(argument)))) == DB_TYPE_UNKNOWN)
+ ha_resolve_by_name(argument, strlen(argument)))) ==
+ DB_TYPE_UNKNOWN)
{
- fprintf(stderr,"Unknown table type: %s\n",argument);
+ fprintf(stderr,"Unknown/unsupported table type: %s\n",argument);
exit(1);
}
break;
@@ -6433,6 +6441,22 @@ static void get_options(int argc,char **argv)
sql_print_warning("this binary does not contain BDB storage engine");
#endif
+ /*
+ Check that the default storage engine is actually available.
+ */
+ if (!ha_storage_engine_is_enabled((enum db_type)
+ global_system_variables.table_type))
+ {
+ if (!opt_bootstrap)
+ {
+ sql_print_error("Default storage engine (%s) is not available",
+ ha_get_storage_engine((enum db_type)
+ global_system_variables.table_type));
+ exit(1);
+ }
+ global_system_variables.table_type= DB_TYPE_MYISAM;
+ }
+
if (argc > 0)
{
fprintf(stderr, "%s: Too many arguments (first extra is '%s').\nUse --help to get a list of available options\n", my_progname, *argv);