diff options
-rw-r--r-- | Docs/manual.texi | 16 | ||||
-rw-r--r-- | include/my_pthread.h | 7 | ||||
-rw-r--r-- | mysys/my_pthread.c | 18 | ||||
-rw-r--r-- | sql/item_func.cc | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 51 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 |
6 files changed, 61 insertions, 35 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 5b4fb2932f7..4d12a2689fe 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46854,7 +46854,6 @@ users use this code as the rest of the code and because of this we are not yet 100% confident in this code. @menu -* News-3.23.51:: * News-3.23.50:: Changes in release 3.23.50 * News-3.23.49:: Changes in release 3.23.49 * News-3.23.48:: Changes in release 3.23.48 @@ -46909,20 +46908,19 @@ not yet 100% confident in this code. * News-3.23.0:: Changes in release 3.23.0 @end menu -@node News-3.23.51, News-3.23.50, News-3.23.x, News-3.23.x -@appendixsubsec Changes in release 3.23.51 +@node News-3.23.50, News-3.23.49, News-3.23.x, News-3.23.x +@appendixsubsec Changes in release 3.23.50 @itemize @bullet @item +Fixed timeout for @code{GET_LOCK()} on HPUX with DCE threads. +@item +Fixed memory allocation bug in the glibc library used to build Linux +binaries, which caused mysqld to die in 'free()'. +@item Fixed @code{SIGINT} and @code{SIGQUIT} problems in @code{mysql}. @item Fixed bug in character table converts when used with big ( > 64K) strings. -@end itemize - -@node News-3.23.50, News-3.23.49, News-3.23.51, News-3.23.x -@appendixsubsec Changes in release 3.23.50 - -@itemize @bullet @item @code{InnoDB} now retains foreign key constraints through @code{ALTER TABLE} and @code{CREATE/DROP INDEX}. diff --git a/include/my_pthread.h b/include/my_pthread.h index cd72bcced83..30e9ea95e02 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -349,6 +349,13 @@ extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority); #undef HAVE_GETHOSTBYADDR_R /* No definition */ #endif +#if defined(HAVE_DEC_THREADS) +extern int my_pthread_cond_timedwait(pthread_cond_t *cond, + pthread_mutex_t *mutex, + struct timespec *abstime); +#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C)) +#endif + #if defined(OS2) #define my_pthread_getspecific(T,A) ((T) &(A)) #define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A)) diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 8bdbc0f7fd8..8c6b366e9b1 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -410,9 +410,23 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr) #endif +/* Change functions on HP to work according to POSIX */ + +#ifdef HAVE_DEC_THREADS +#undef pthread_cond_timedwait + +int my_pthread_cond_timedwait(pthread_cond_t *cond, + pthread_mutex_t *mutex, + struct timespec *abstime) +{ + int error=pthread_cond_timedwait(cond,mutex,abstime); + return error == EAGAIN ? ETIMEDOUT : error; +} +#endif /* HAVE_DEC_THREADS */ + /* -** Emulate SOLARIS style calls, not because it's better, but just to make the -** usage of getbostbyname_r simpler. + Emulate SOLARIS style calls, not because it's better, but just to make the + usage of getbostbyname_r simpler. */ #if !defined(my_gethostbyname_r) && defined(HAVE_GETHOSTBYNAME_R) diff --git a/sql/item_func.cc b/sql/item_func.cc index 023b79b3ff7..2e54aa56b4b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1514,7 +1514,7 @@ longlong Item_func_get_lock::val_int() while (!thd->killed && (error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime)) - != ETIME && error != ETIMEDOUT && ull->locked) ; + != ETIME && error != ETIMEDOUT && error != EINVAL && ull->locked) ; if (thd->killed) error=EINTR; // Return NULL if (ull->locked) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fa5f6ae395e..16eace54978 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -89,6 +89,16 @@ extern "C" { // Because of SCO 3.2V4.2 #endif /* NEED_SYS_SYSLOG_H */ int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; + +#ifdef __linux__ +#define my_fromhost(A) fromhost() +#define my_hosts_access(A) hosts_access() +#define my_eval_client(A) eval_client() +#else +#define my_fromhost(A) fromhost(A) +#define my_hosts_access(A) hosts_access(A) +#define my_eval_client(A) eval_client(A) +#endif #endif /* HAVE_LIBWRAP */ #ifdef HAVE_SYS_MMAN_H @@ -2258,7 +2268,6 @@ static void create_new_thread(THD *thd) if (cached_thread_count > wake_thread) { start_cached_thread(thd); - (void) pthread_mutex_unlock(&LOCK_thread_count); } else { @@ -2285,9 +2294,9 @@ static void create_new_thread(THD *thd) (void) pthread_mutex_unlock(&LOCK_thread_count); DBUG_VOID_RETURN; } - - (void) pthread_mutex_unlock(&LOCK_thread_count); } + (void) pthread_mutex_unlock(&LOCK_thread_count); + } DBUG_PRINT("info",("Thread created")); DBUG_VOID_RETURN; @@ -2415,29 +2424,27 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) struct request_info req; signal(SIGCHLD, SIG_DFL); request_init(&req, RQ_DAEMON, libwrapName, RQ_FILE, new_sock, NULL); -#ifndef __linux__ - fromhost(&req); - if (!hosts_access(&req)) - { - // This may be stupid but refuse() includes an exit(0) - // which we surely don't want... - // clean_exit() - same stupid thing ... - syslog(deny_severity, "refused connect from %s", eval_client(&req)); -#else - fromhost(); - if (!hosts_access()) + my_fromhost(&req); + if (!my_hosts_access(&req)) { - syslog(deny_severity, "refused connect from %s", eval_client()); -#endif + /* + This may be stupid but refuse() includes an exit(0) + which we surely don't want... + clean_exit() - same stupid thing ... + */ + syslog(deny_severity, "refused connect from %s", + my_eval_client(&req)); + + /* + C++ sucks (the gibberish in front just translates the supplied + sink function pointer in the req structure from a void (*sink)(); + to a void(*sink)(int) if you omit the cast, the C++ compiler + will cry... + */ if (req.sink) ((void (*)(int))req.sink)(req.fd); - // C++ sucks (the gibberish in front just translates the supplied - // sink function pointer in the req structure from a void (*sink)(); - // to a void(*sink)(int) if you omit the cast, the C++ compiler - // will cry... - - (void) shutdown(new_sock,2); // This looks fine to me... + (void) shutdown(new_sock,2); (void) closesocket(new_sock); continue; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index fa4a4fd4f3b..4f9140cc3f2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -530,7 +530,7 @@ pthread_handler_decl(handle_one_connection,arg) if ((error=check_connections(thd))) { // Wrong permissions if (error > 0) - net_printf(net,error,thd->host ? thd->host : thd->ip); + net_printf(net,error,thd->host ? thd->host : (thd->ip ? thd->ip : "")); #ifdef __NT__ if (vio_type(net->vio) == VIO_TYPE_NAMEDPIPE) sleep(1); /* must wait after eof() */ |