diff options
author | Alexey Botchkov <holyfoot@mysql.com> | 2009-02-05 10:16:00 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@mysql.com> | 2009-02-05 10:16:00 +0400 |
commit | 9036f1aa97ad0a46a338b70673327dd3d8192eee (patch) | |
tree | 0fac8c6c58cccb157687fdd7c3751a2db5b594a6 /include/my_sys.h | |
parent | da44c30130da88ec7839d2c69531c5e84626d8b3 (diff) | |
download | mariadb-git-9036f1aa97ad0a46a338b70673327dd3d8192eee.tar.gz |
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.
Diffstat (limited to 'include/my_sys.h')
-rw-r--r-- | include/my_sys.h | 3 |
1 files changed, 0 insertions, 3 deletions
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 */ |