diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 2 | ||||
-rw-r--r-- | include/my_global.h | 2 | ||||
-rw-r--r-- | include/my_global.h.rej | 17 | ||||
-rw-r--r-- | include/my_pthread.h | 25 | ||||
-rw-r--r-- | include/my_pthread.h.rej | 80 | ||||
-rw-r--r-- | include/my_sys.h | 7 | ||||
-rw-r--r-- | include/my_time.h | 10 | ||||
-rw-r--r-- | include/mysql.h | 3 | ||||
-rw-r--r-- | include/thr_alarm.h | 8 |
9 files changed, 130 insertions, 24 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index 20f681c432d..7b67d9994a2 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -98,7 +98,7 @@ typedef struct { uint beg; uint end; - uint mblen; + uint mb_len; } my_match_t; enum my_lex_states diff --git a/include/my_global.h b/include/my_global.h index f758352b46c..98733711d24 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -629,7 +629,7 @@ typedef unsigned short ushort; duplicate declaration of __cxa_pure_virtual, solved by declaring it a weak symbol. */ -#ifdef USE_MYSYS_NEW +#if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL) C_MODE_START int __cxa_pure_virtual () __attribute__ ((weak)); C_MODE_END diff --git a/include/my_global.h.rej b/include/my_global.h.rej new file mode 100644 index 00000000000..f2953d169e7 --- /dev/null +++ b/include/my_global.h.rej @@ -0,0 +1,17 @@ +*************** +*** 97,103 **** + + + /* Fix problem with S_ISLNK() on Linux */ +! #if defined(HAVE_LINUXTHREADS) + #undef _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif +--- 97,103 ---- + + + /* Fix problem with S_ISLNK() on Linux */ +! #if defined(TARGET_OS_LINUX) || defined(__GLIBC__) + #undef _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif diff --git a/include/my_pthread.h b/include/my_pthread.h index 8ae8e7f9512..4d9f5350b1e 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -269,14 +269,14 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ we want to make sure that no such flags are set. */ #if defined(HAVE_SIGACTION) && !defined(my_sigset) -#define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ - DBUG_ASSERT((A) != 0); \ - sigemptyset(&set); \ - s.sa_handler = (B); \ - s.sa_mask = set; \ - s.sa_flags = 0; \ - rc= sigaction((A), &s, (struct sigaction *) NULL);\ - DBUG_ASSERT(rc == 0); \ +#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \ + DBUG_ASSERT((A) != 0); \ + sigemptyset(&l_set); \ + l_s.sa_handler = (B); \ + l_s.sa_mask = l_set; \ + l_s.sa_flags = 0; \ + l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\ + DBUG_ASSERT(l_rc == 0); \ } while (0) #elif defined(HAVE_SIGSET) && !defined(my_sigset) #define my_sigset(A,B) sigset((A),(B)) @@ -690,6 +690,15 @@ extern uint my_thread_end_wait_time; Keep track of shutdown,signal, and main threads so that my_end() will not report errors with them */ + +/* Which kind of thread library is in use */ + +#define THD_LIB_OTHER 1 +#define THD_LIB_NPTL 2 +#define THD_LIB_LT 4 + +extern uint thd_lib_detected; + /* statistics_xxx functions are for not essential statistic */ #ifndef thread_safe_increment diff --git a/include/my_pthread.h.rej b/include/my_pthread.h.rej new file mode 100644 index 00000000000..1f73655b0bd --- /dev/null +++ b/include/my_pthread.h.rej @@ -0,0 +1,80 @@ +*************** +*** 286,293 **** + #undef HAVE_PTHREAD_RWLOCK_RDLOCK + #undef HAVE_SNPRINTF + +! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) +! #define signal(A,B) pthread_signal((A),(void (*)(int)) (B)) + #define my_pthread_attr_setprio(A,B) + #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ + +--- 294,301 ---- + #undef HAVE_PTHREAD_RWLOCK_RDLOCK + #undef HAVE_SNPRINTF + +! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) +! #define my_signal(A,B) pthread_signal((A),(void (*)(int)) (B)) + #define my_pthread_attr_setprio(A,B) + #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ + +*************** +*** 324,337 **** + #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) + int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ + #endif +! #if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset) +! #define sigset(A,B) do { struct sigaction s; sigset_t set; \ +! sigemptyset(&set); \ +! s.sa_handler = (B); \ +! s.sa_mask = set; \ +! s.sa_flags = 0; \ +! sigaction((A), &s, (struct sigaction *) NULL); \ + } while (0) + #endif + + #ifndef my_pthread_setprio +--- 332,358 ---- + #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) + int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ + #endif +! +! /* +! We define my_sigset() and use that instead of the system sigset() so that +! we can favor an implementation based on sigaction(). On some systems, such +! as Mac OS X, sigset() results in flags such as SA_RESTART being set, and +! we want to make sure that no such flags are set. +! */ +! #if defined(HAVE_SIGACTION) && !defined(my_sigset) +! #define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ +! DBUG_ASSERT((A) != 0); \ +! sigemptyset(&set); \ +! s.sa_handler = (B); \ +! s.sa_mask = set; \ +! s.sa_flags = 0; \ +! rc= sigaction((A), &s, (struct sigaction *) NULL); \ +! DBUG_ASSERT(rc == 0); \ + } while (0) ++ #elif defined(HAVE_SIGSET) && !defined(my_sigset) ++ #define my_sigset(A,B) sigset((A),(B)) ++ #elif !defined(my_sigset) ++ #define my_sigset(A,B) signal((A),(B)) + #endif + + #ifndef my_pthread_setprio +*************** +*** 416,422 **** + #undef pthread_detach_this_thread + #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } + #undef sigset +! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) + #endif + + #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) +--- 437,443 ---- + #undef pthread_detach_this_thread + #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } + #undef sigset +! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) + #endif + + #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) diff --git a/include/my_sys.h b/include/my_sys.h index aa8cef1a25a..8e831b448d7 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -250,9 +250,10 @@ extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks; extern char wild_many,wild_one,wild_prefix; extern const char *charsets_dir; -extern char *defaults_extra_file; -extern const char *defaults_group_suffix; -extern const char *defaults_file; +/* from default.c */ +extern char *my_defaults_extra_file; +extern const char *my_defaults_group_suffix; +extern const char *my_defaults_file; extern my_bool timed_mutexes; diff --git a/include/my_time.h b/include/my_time.h index 4ace9c538b3..a27ac5c1628 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -80,16 +80,16 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, uint flags, int *was_cut); longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, uint flags, int *was_cut); -ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *time); -ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *time); -ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *time); -ulonglong TIME_to_ulonglong(const MYSQL_TIME *time); +ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong(const MYSQL_TIME *); my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, int *warning); -int check_time_range(struct st_mysql_time *time, int *warning); +int check_time_range(struct st_mysql_time *, int *warning); long calc_daynr(uint year,uint month,uint day); uint calc_days_in_year(uint year); diff --git a/include/mysql.h b/include/mysql.h index 8e23421a2ee..aa54a62dca4 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -87,6 +87,7 @@ extern char *mysql_unix_port; #define IS_NUM(t) ((t) <= MYSQL_TYPE_INT24 || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL) #define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) #define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR) +#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING) typedef struct st_mysql_field { @@ -783,7 +784,7 @@ int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned long length); int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); -int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, +int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset); int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 90f785c022f..13940e88c08 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -24,11 +24,6 @@ extern "C" { #ifndef USE_ALARM_THREAD #define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ #endif -#ifdef HAVE_LINUXTHREADS -#define THR_CLIENT_ALARM SIGALRM -#else -#define THR_CLIENT_ALARM SIGUSR1 -#endif #ifdef HAVE_rts_threads #undef USE_ONE_SIGNAL_HAND #define USE_ALARM_THREAD @@ -89,6 +84,9 @@ typedef struct st_alarm { my_bool malloced; } ALARM; +extern uint thr_client_alarm; +extern pthread_t alarm_thread; + #define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)!= 0) void init_thr_alarm(uint max_alarm); |