diff options
author | unknown <guilhem@gbichot4.local> | 2007-11-16 17:09:51 +0100 |
---|---|---|
committer | unknown <guilhem@gbichot4.local> | 2007-11-16 17:09:51 +0100 |
commit | fc0a25ec49f32fd292cb87c8a855e1569ccf8878 (patch) | |
tree | 123becbb97b9230e9b90a9b32b9b885ab9a7fd93 /mysys/my_static.c | |
parent | ce2fbd9e9abdf37c0db07564c1f9d62d17f1315a (diff) | |
download | mariadb-git-fc0a25ec49f32fd292cb87c8a855e1569ccf8878.tar.gz |
WL#3071 Maria checkpoint, WL#3072 Maria recovery
instead of fprintf(stderr) when a task (with no user connected) gets
an error, use my_printf_error(). Flags ME_JUST_WARNING and ME_JUST_INFO
added to my_error()/my_printf_error(), which pass it to
my_message_sql() which is modified to call the appropriate
sql_print_*(). This way recovery can signal its start and end with
[Note] and not [ERROR] (but failure with [ERROR]).
Recovery's detailed progress (percents etc) still uses stderr as they
have to stay on one single line.
sql_print_error() changed to use my_progname_short (nicer display).
mysql-test-run.pl --gdb/--ddd does not run mysqld, because
a breakpoint in mysql_parse is too late to debug startup problems;
instead, dev should set the breakpoints it wants and then "run" ("r").
include/my_sys.h:
new flags to tell error_handler_hook that this is not an error
but an information or warning
mysql-test/mysql-test-run.pl:
when running with --gdb/--ddd to debug mysqld, breaking at mysql_parse
is too late to debug startup problems; now, it does not run mysqld,
does not set breakpoints, developer can set as early breakpoints
as it wants and is responsible for typing "run" (or "r")
mysys/my_init.c:
set my_progname_short
mysys/my_static.c:
my_progname_short added
sql/mysqld.cc:
* my_message_sql() can now receive info or warning, not only error;
this allows mysys to tell the user (or the error log if no user)
about an info or warning. Used from Maria.
* plugins (or engines like Maria) may want to call my_error(), so
set up the error handler hook (my_message_sql) before initializing
plugins; otherwise they get my_message_no_curses which is less
integrated into mysqld (is just fputs())
* using my_progname_short instead of my_progname, in my_message_sql()
(less space on screen)
storage/maria/ma_checkpoint.c:
fprintf(stderr) -> ma_message_no_user()
storage/maria/ma_checkpoint.h:
function for any Maria task, not connected to a user (example:
checkpoint, recovery; soon could be deleted records purger)
to report a message (calls my_printf_error() which, when inside ha_maria,
leads to sql_print_*(), and when outside, leads to
my_message_no_curses i.e. stderr).
storage/maria/ma_recovery.c:
To tell that recovery starts and ends we use ma_message_no_user()
(sql_print_*() in practice). Detailed progress info still uses
stderr as sql_print() cannot put several messages on one line.
071116 18:42:16 [Note] mysqld: Maria engine: starting recovery
recovered pages: 0% 67% 100% (0.0 seconds); transactions to roll back: 1 0 (0.0
seconds); tables to flush: 1 0 (0.0 seconds);
071116 18:42:16 [Note] mysqld: Maria engine: recovery done
storage/maria/maria_chk.c:
my_progname_short moved to mysys
storage/maria/maria_read_log.c:
my_progname_short moved to mysys
storage/myisam/myisamchk.c:
my_progname_short moved to mysys
Diffstat (limited to 'mysys/my_static.c')
-rw-r--r-- | mysys/my_static.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/my_static.c b/mysys/my_static.c index cb482b19b57..ef25a89bad9 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -26,7 +26,7 @@ my_bool timed_mutexes= 0; /* from my_init */ char * home_dir=0; -const char *my_progname=0; +const char *my_progname= NULL, *my_progname_short= NULL; char NEAR curr_dir[FN_REFLEN]= {0}, NEAR home_dir_buff[FN_REFLEN]= {0}; ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0; |