mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug #4466 Nothing in .err when mysql service ends because of malformed my.ini options
mysqld.cc: Changed LOGLEVEL enum to loglevel mysql_priv.h, log.cc: Changed LOGLEVEL to loglevel. Removed startup_ from some of the DBUG_ENTER macros. Removed the print_msg_to_log function as it was unused. my_getopt.c, my_getopt.h: Renamed LOGLEVEL to loglevel to match coding standards
This commit is contained in:
@ -53,14 +53,14 @@ struct my_option
|
|||||||
extern char *disabled_my_option;
|
extern char *disabled_my_option;
|
||||||
extern my_bool my_getopt_print_errors;
|
extern my_bool my_getopt_print_errors;
|
||||||
|
|
||||||
enum LOGLEVEL {
|
enum loglevel {
|
||||||
ERROR_LEVEL,
|
ERROR_LEVEL,
|
||||||
WARNING_LEVEL,
|
WARNING_LEVEL,
|
||||||
INFORMATION_LEVEL
|
INFORMATION_LEVEL
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
|
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
|
||||||
typedef void (* my_error_reporter) (enum LOGLEVEL level, const char *format, ... );
|
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
|
||||||
|
|
||||||
extern int handle_options (int *argc, char ***argv,
|
extern int handle_options (int *argc, char ***argv,
|
||||||
const struct my_option *longopts, my_get_one_option,
|
const struct my_option *longopts, my_get_one_option,
|
||||||
|
@ -56,7 +56,7 @@ char *disabled_my_option= (char*) "0";
|
|||||||
|
|
||||||
my_bool my_getopt_print_errors= 1;
|
my_bool my_getopt_print_errors= 1;
|
||||||
|
|
||||||
void default_reporter( enum LOGLEVEL level, const char *format, ... )
|
void default_reporter( enum loglevel level, const char *format, ... )
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start( args, format );
|
va_start( args, format );
|
||||||
|
45
sql/log.cc
45
sql/log.cc
@ -1716,13 +1716,13 @@ static bool test_if_number(register const char *str,
|
|||||||
} /* test_if_number */
|
} /* test_if_number */
|
||||||
|
|
||||||
|
|
||||||
void print_buffer_to_file( enum LOGLEVEL level, const char *buffer )
|
void print_buffer_to_file( enum loglevel level, const char *buffer )
|
||||||
{
|
{
|
||||||
time_t skr;
|
time_t skr;
|
||||||
struct tm tm_tmp;
|
struct tm tm_tmp;
|
||||||
struct tm *start;
|
struct tm *start;
|
||||||
|
|
||||||
DBUG_ENTER("startup_print_buffer_to_log");
|
DBUG_ENTER("print_buffer_to_log");
|
||||||
|
|
||||||
VOID(pthread_mutex_lock(&LOCK_error_log));
|
VOID(pthread_mutex_lock(&LOCK_error_log));
|
||||||
|
|
||||||
@ -1802,35 +1802,16 @@ bool flush_error_log()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* prints a printf style message to the error log and, under NT, to the Windows event log.
|
|
||||||
* @param event_type type of even to log.
|
|
||||||
* @param timestamp true to add a timestamp to the entry, false otherwise.
|
|
||||||
* @param format The printf style format of the message
|
|
||||||
* @param ... values for the message
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
void print_msg_to_log( LOGLEVEL level, const char *format, ... )
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
DBUG_ENTER("startup_print_msg_to_log");
|
|
||||||
|
|
||||||
va_start( args, format );
|
|
||||||
vprint_msg_to_log( level, format, args );
|
|
||||||
va_end( args );
|
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __NT__
|
#ifdef __NT__
|
||||||
void print_buffer_to_nt_eventlog( enum LOGLEVEL level, char *buff, int buffLen )
|
void print_buffer_to_nt_eventlog( enum loglevel level, char *buff, int buffLen )
|
||||||
{
|
{
|
||||||
HANDLE event;
|
HANDLE event;
|
||||||
char *buffptr;
|
char *buffptr;
|
||||||
LPCSTR *buffmsgptr;
|
LPCSTR *buffmsgptr;
|
||||||
|
|
||||||
|
DBUG_ENTER( "print_buffer_to_nt_eventlog" );
|
||||||
|
|
||||||
buffptr = buff;
|
buffptr = buff;
|
||||||
if (strlen(buff) > (uint)(buffLen-4))
|
if (strlen(buff) > (uint)(buffLen-4))
|
||||||
{
|
{
|
||||||
@ -1885,11 +1866,11 @@ void print_buffer_to_nt_eventlog( enum LOGLEVEL level, char *buff, int buffLen )
|
|||||||
RETURN VALUES
|
RETURN VALUES
|
||||||
void
|
void
|
||||||
*/
|
*/
|
||||||
void vprint_msg_to_log(enum LOGLEVEL level, const char *format, va_list args)
|
void vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
char buff[1024];
|
char buff[1024];
|
||||||
|
|
||||||
DBUG_ENTER("startup_vprint_msg_to_log");
|
DBUG_ENTER("vprint_msg_to_log");
|
||||||
|
|
||||||
my_vsnprintf( buff, sizeof(buff)-5, format, args );
|
my_vsnprintf( buff, sizeof(buff)-5, format, args );
|
||||||
|
|
||||||
@ -1909,11 +1890,11 @@ void vprint_msg_to_log(enum LOGLEVEL level, const char *format, va_list args)
|
|||||||
|
|
||||||
void sql_print_error( const char *format, ... )
|
void sql_print_error( const char *format, ... )
|
||||||
{
|
{
|
||||||
DBUG_ENTER( "startup_sql_print_error" );
|
DBUG_ENTER( "sql_print_error" );
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start( args, format );
|
va_start( args, format );
|
||||||
print_msg_to_log( ERROR_LEVEL, format, args );
|
vprint_msg_to_log( ERROR_LEVEL, format, args );
|
||||||
va_end( args );
|
va_end( args );
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
@ -1921,11 +1902,11 @@ void sql_print_error( const char *format, ... )
|
|||||||
|
|
||||||
void sql_print_warning( const char *format, ... )
|
void sql_print_warning( const char *format, ... )
|
||||||
{
|
{
|
||||||
DBUG_ENTER( "startup_sql_print_warning" );
|
DBUG_ENTER( "sql_print_warning" );
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start( args, format );
|
va_start( args, format );
|
||||||
print_msg_to_log( WARNING_LEVEL, format, args );
|
vprint_msg_to_log( WARNING_LEVEL, format, args );
|
||||||
va_end( args );
|
va_end( args );
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
@ -1933,11 +1914,11 @@ void sql_print_warning( const char *format, ... )
|
|||||||
|
|
||||||
void sql_print_information( const char *format, ... )
|
void sql_print_information( const char *format, ... )
|
||||||
{
|
{
|
||||||
DBUG_ENTER( "startup_sql_print_information" );
|
DBUG_ENTER( "sql_print_information" );
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start( args, format );
|
va_start( args, format );
|
||||||
print_msg_to_log( INFORMATION_LEVEL, format, args );
|
vprint_msg_to_log( INFORMATION_LEVEL, format, args );
|
||||||
va_end( args );
|
va_end( args );
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
|
@ -640,10 +640,9 @@ void key_unpack(String *to,TABLE *form,uint index);
|
|||||||
bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields);
|
bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields);
|
||||||
void init_errmessage(void);
|
void init_errmessage(void);
|
||||||
|
|
||||||
void vprint_msg_to_log( enum LOGLEVEL level, const char *format, va_list args );
|
|
||||||
void print_msg_to_log( enum LOGLEVEL level, const char *format, ... );
|
|
||||||
void sql_perror(const char *message);
|
void sql_perror(const char *message);
|
||||||
|
|
||||||
|
void vprint_msg_to_log( enum loglevel level, const char *format, va_list args );
|
||||||
void sql_print_error( const char *format, ... );
|
void sql_print_error( const char *format, ... );
|
||||||
void sql_print_warning( const char *format, ...);
|
void sql_print_warning( const char *format, ...);
|
||||||
void sql_print_information( const char *format, ...);
|
void sql_print_information( const char *format, ...);
|
||||||
|
@ -5095,7 +5095,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
/* Initiates DEBUG - but no debugging here ! */
|
/* Initiates DEBUG - but no debugging here ! */
|
||||||
|
|
||||||
void option_error_reporter( enum LOGLEVEL level, const char *format, ... )
|
void option_error_reporter( enum loglevel level, const char *format, ... )
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start( args, format );
|
va_start( args, format );
|
||||||
|
Reference in New Issue
Block a user