From 77b7ad33986c84fb7183890a3dd17d69af10b2af Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Fri, 22 Aug 2008 12:40:21 +0200 Subject: Fixning compiler warnings. Fixing build failure for valgrind platform. --- include/my_global.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/my_global.h b/include/my_global.h index 6cfc4d67305..c6ac90d4a34 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1130,6 +1130,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */ #define dbug_volatile #endif +/* Some helper macros */ +#define YESNO(X) ((X) ? "yes" : "no") + /* Defines for time function */ #define SCALE_SEC 100 #define SCALE_USEC 10000 -- cgit v1.2.1 From bc03c9ef19c567fa26ecb2a2e35c3b49b241b101 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 3 Feb 2009 15:16:24 -0200 Subject: Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock, even with low_priority_updates The problem is that there is no mechanism to control whether a delayed insert takes a high or low priority lock on a table. The solution is to modify the delayed insert thread ("handler") to take into account the global value of low_priority_updates when taking table locks. The value of low_priority_updates is retrieved when the insert delayed thread is created and will remain the same for the duration of the thread. --- include/thr_lock.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/thr_lock.h b/include/thr_lock.h index c7754ada299..e409df30972 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -159,7 +159,8 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count); void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock); my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread); void thr_print_locks(void); /* For debugging */ -my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data); +my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data, + enum thr_lock_type new_lock_type); void thr_downgrade_write_lock(THR_LOCK_DATA *data, enum thr_lock_type new_lock_type); my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data); -- cgit v1.2.1 From cf0d0a5e96e6625cfb04fddbb452c4ca3c15851c Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 5 Feb 2009 10:16:00 +0400 Subject: Bug#37995 Error message truncation in test "innodb" in embedded mode. code backported from 6.0 per-file messages: include/my_global.h Remove SC_MAXWIDTH. This is unused and irrelevant nowadays. include/my_sys.h Remove errbuf declaration and unused definitions. mysys/my_error.c Remove errbuf definition and move and adjust ERRMSGSIZE. mysys/my_init.c Declare buffer on the stack and use my_snprintf. mysys/safemalloc.c Use size explicitly. It's more than enough for the message at hand. sql/sql_error.cc Use size explicitly. It's more than enough for the message at hand. sql/sql_parse.cc Declare buffer on the stack. Use my_snprintf as it will result in less stack space being used than by a system provided sprintf -- this allows us to put the buffer on the stack without causing much trouble. Also, the use of errbuff here was not thread-safe as the function can be entered concurrently from multiple threads. sql/sql_table.cc Use MYSQL_ERRMSG_SIZE. Extra space is not needed as my_snprintf will nul terminate strings. storage/myisam/ha_myisam.cc Use MYSQL_ERRMSG_SIZE. sql/share/errmsg.txt Error message truncation in test "innodb" in embedded mode filename in the error message can safely take up to 210 symbols. --- include/my_global.h | 1 - include/my_sys.h | 3 --- 2 files changed, 4 deletions(-) (limited to 'include') diff --git a/include/my_global.h b/include/my_global.h index ac49d48e78d..4581dd6785c 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -724,7 +724,6 @@ typedef SOCKET_SIZE_TYPE size_socket; #define UNSINT32 /* unsigned int32 */ /* General constants */ -#define SC_MAXWIDTH 256 /* Max width of screen (for error messages) */ #define FN_LEN 256 /* Max file name len */ #define FN_HEADLEN 253 /* Max length of filepart of file name */ #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */ diff --git a/include/my_sys.h b/include/my_sys.h index 60122eab94e..5335b65822f 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -39,8 +39,6 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;} #define MY_INIT(name); { my_progname= name; my_init(); } -#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */ -#define NRERRBUFFS (2) /* Buffers for parameters */ #define MY_FILE_ERROR ((size_t) -1) /* General bitmaps for my_func's */ @@ -208,7 +206,6 @@ extern void my_large_free(uchar * ptr, myf my_flags); extern int errno; /* declare errno */ #endif #endif /* #ifndef errno */ -extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ extern const char *my_progname; /* program-name (printed in errors) */ extern char NEAR curr_dir[]; /* Current directory for user */ -- cgit v1.2.1