diff options
-rw-r--r-- | include/mysql_embed.h | 1 | ||||
-rw-r--r-- | libmysqld/lib_sql.cc | 6 | ||||
-rw-r--r-- | sql/log_event.h | 4 | ||||
-rw-r--r-- | sql/mysqld.cc | 10 | ||||
-rw-r--r-- | sql/sql_parse.cc | 6 |
5 files changed, 9 insertions, 18 deletions
diff --git a/include/mysql_embed.h b/include/mysql_embed.h index bc75c3fbcb8..d48b0440660 100644 --- a/include/mysql_embed.h +++ b/include/mysql_embed.h @@ -25,6 +25,7 @@ #undef HAVE_OPENSSL #undef HAVE_VIO #undef HAVE_ISAM +#undef HAVE_SMEM /* No shared memory */ #define DONT_USE_RAID diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index cc3358de186..68a7b940220 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -200,12 +200,6 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0]) opt_mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */ - if (init_thread_environment()) - { - mysql_server_end(); - return 1; - } - umask(((~my_umask) & 0666)); if (init_server_components()) { diff --git a/sql/log_event.h b/sql/log_event.h index b9b1355a304..62b5873fabb 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -583,7 +583,7 @@ public: ~Intvar_log_event() {} Log_event_type get_type_code() { return INTVAR_EVENT;} const char* get_var_type_name(); - int get_data_size() { return sizeof(type) + sizeof(val);} + int get_data_size() { return 9; /* sizeof(type) + sizeof(val) */;} int write_data(IO_CACHE* file); bool is_valid() { return 1; } }; @@ -616,7 +616,7 @@ class Rand_log_event: public Log_event Rand_log_event(const char* buf, bool old_format); ~Rand_log_event() {} Log_event_type get_type_code() { return RAND_EVENT;} - int get_data_size() { return sizeof(ulonglong) * 2; } + int get_data_size() { return 16; /* sizeof(ulonglong) * 2*/ } int write_data(IO_CACHE* file); bool is_valid() { return 1; } }; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ce87a8c15ac..85cde682c58 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -494,6 +494,7 @@ static void start_signal_handler(void); extern "C" pthread_handler_decl(signal_hand, arg); static void set_options(void); static void get_options(int argc,char **argv); +static int init_thread_environment(); static char *get_relative_path(const char *path); static void fix_paths(void); extern "C" pthread_handler_decl(handle_connections_sockets,arg); @@ -504,11 +505,9 @@ static bool read_init_file(char *file_name); #ifdef __NT__ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg); #endif -#if !defined(EMBEDDED_LIBRARY) #ifdef HAVE_SMEM static pthread_handler_decl(handle_connections_shared_memory,arg); #endif -#endif /* EMBEDDED_LIBRARY */ extern "C" pthread_handler_decl(handle_slave,arg); #ifdef SET_RLIMIT_NOFILE static uint set_maximum_open_files(uint max_file_limit); @@ -2033,6 +2032,8 @@ static int init_common_variables(const char *conf_file_name, int argc, defaults_argv=argv; set_options(); get_options(argc,argv); + if (init_thread_environment()) + return 1; if (opt_log || opt_update_log || opt_slow_log || opt_bin_log) strcat(server_version,"-log"); DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname, @@ -2300,7 +2301,6 @@ static void handle_connections_methods() handler_count--; } } -#if !defined(EMBEDDED_LIBRARY) #ifdef HAVE_SMEM if (opt_enable_shared_memory) { @@ -2313,7 +2313,6 @@ static void handle_connections_methods() } } #endif -#endif // EMBEDDED_LIBRARY while (handler_count > 0) pthread_cond_wait(&COND_handler_count,&LOCK_thread_count); @@ -2349,8 +2348,6 @@ int main(int argc, char **argv) init_signals(); if (!(opt_specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(),CONNECT_PRIOR); - if (init_thread_environment()) - unireg_abort(1); pthread_attr_setstacksize(&connection_attrib,thread_stack); #ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE { @@ -2683,6 +2680,7 @@ static int bootstrap(FILE *file) int error= 0; DBUG_ENTER("bootstrap"); #ifndef EMBEDDED_LIBRARY // TODO: Enable this + THD *thd= new THD; thd->bootstrap=1; thd->client_capabilities=0; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d9aea74c55e..b336f41aa7e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1059,9 +1059,6 @@ bool do_command(THD *thd) bool dispatch_command(enum enum_server_command command, THD *thd, char* packet, uint packet_length) { -#ifndef EMBEDDED_LIBRARY - int res; -#endif NET *net= &thd->net; bool error= 0; /* @@ -1138,7 +1135,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, char tmp_db[NAME_LEN+1]; ACL_USER* cached_user ; /* Cached user */ uint cur_priv_version; /* Cached grant version */ - ulong pkt_len=0; /* Length of reply packet */ + int res; + ulong pkt_len= 0; /* Length of reply packet */ bzero((char*) prepared_scramble, sizeof(prepared_scramble)); /* Small check for incomming packet */ |