diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-09-24 12:35:16 +0200 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-09-24 12:35:16 +0200 |
commit | 626bac84719e8c30890e22806c1075f64b34ed5b (patch) | |
tree | 0718249009da3fd00d987bef459d1617571e454e /include | |
parent | 2b2ef99ebf63634d6da81f27aa2ee94e09e5b197 (diff) | |
parent | b0220ff9ff6fbc9fc65a9b04f25e337951edd259 (diff) | |
download | mariadb-git-626bac84719e8c30890e22806c1075f64b34ed5b.tar.gz |
merge mysql-next-mr-alik
Diffstat (limited to 'include')
-rw-r--r-- | include/my_sys.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index ea568b10cb6..451c8418ebd 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -39,6 +39,17 @@ 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(); } +/** + Max length of an error message generated by mysys utilities. + Some mysys functions produce error messages. These mostly go + to stderr. + This constant defines the size of the buffer used to format + the message. It should be kept in sync with MYSQL_ERRMSG_SIZE, + since sometimes mysys errors are stored in the server diagnostics + area, and we would like to avoid unexpected truncation. +*/ +#define MYSYS_ERRMSG_SIZE (512) + #define MY_FILE_ERROR ((size_t) -1) /* General bitmaps for my_func's */ @@ -90,8 +101,6 @@ extern int NEAR my_errno; /* Last error in mysys */ #define ME_COLOUR2 ((2 << ME_HIGHBYTE)) #define ME_COLOUR3 ((3 << ME_HIGHBYTE)) #define ME_FATALERROR 1024 /* Fatal statement error */ -#define ME_NO_WARNING_FOR_ERROR 2048 /* Don't push a warning for error */ -#define ME_NO_SP_HANDLER 4096 /* Don't call stored routine error handlers */ /* Bits in last argument to fn_format */ #define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */ @@ -210,8 +219,8 @@ extern int errno; /* declare errno */ 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 */ -extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); -extern int (*fatal_error_handler_hook)(uint my_err, const char *str, +extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); +extern void (*fatal_error_handler_hook)(uint my_err, const char *str, myf MyFlags); extern uint my_file_limit; extern ulong my_thread_stack_size; @@ -658,15 +667,15 @@ extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); extern int my_sync(File fd, myf my_flags); extern int my_sync_dir(const char *dir_name, myf my_flags); extern int my_sync_dir_by_file(const char *file_name, myf my_flags); -extern int my_error _VARARGS((int nr,myf MyFlags, ...)); -extern int my_printf_error _VARARGS((uint my_err, const char *format, - myf MyFlags, ...)) - ATTRIBUTE_FORMAT(printf, 2, 4); +extern void my_error _VARARGS((int nr,myf MyFlags, ...)); +extern void my_printf_error _VARARGS((uint my_err, const char *format, + myf MyFlags, ...)) + ATTRIBUTE_FORMAT(printf, 2, 4); extern int my_error_register(const char **errmsgs, int first, int last); extern const char **my_error_unregister(int first, int last); -extern int my_message(uint my_err, const char *str,myf MyFlags); -extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags); -extern int my_message_curses(uint my_err, const char *str,myf MyFlags); +extern void my_message(uint my_err, const char *str,myf MyFlags); +extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags); +extern void my_message_curses(uint my_err, const char *str,myf MyFlags); extern my_bool my_init(void); extern void my_end(int infoflag); extern int my_redel(const char *from, const char *to, int MyFlags); |