@@ -319,10 +319,9 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event)
319319
320320 print_warnings (thd, &job_data);
321321
322- if (res)
323- sql_print_information (" Event Scheduler: "
324- " [%s].[%s.%s] event execution failed." ,
325- job_data.definer .str ,
322+ if (res && global_system_variables.log_warnings > 2 )
323+ sql_print_information (" Event Scheduler: [%s].[%s.%s] event execution "
324+ " failed." , job_data.definer .str ,
326325 job_data.dbname .str , job_data.name .str );
327326end:
328327#ifdef HAVE_PSI_STATEMENT_INTERFACE
@@ -471,8 +470,9 @@ Event_scheduler::run(THD *thd)
471470 int res= FALSE ;
472471 DBUG_ENTER (" Event_scheduler::run" );
473472
474- sql_print_information (" Event Scheduler: scheduler thread started with id %lu" ,
475- (ulong) thd->thread_id );
473+ if (global_system_variables.log_warnings )
474+ sql_print_information (" Event Scheduler: scheduler thread started with "
475+ " id %llu" , (ulonglong) thd->thread_id );
476476 /*
477477 Recalculate the values in the queue because there could have been stops
478478 in executions of the scheduler and some times could have passed by.
@@ -486,9 +486,8 @@ Event_scheduler::run(THD *thd)
486486 /* Gets a minimized version */
487487 if (queue->get_top_for_execution_if_time (thd, &event_name))
488488 {
489- sql_print_information (" Event Scheduler: "
490- " Serious error during getting next "
491- " event to execute. Stopping" );
489+ sql_print_error (" Event Scheduler: Serious error during getting next "
490+ " event to execute. Stopping" );
492491 break ;
493492 }
494493
@@ -660,14 +659,16 @@ Event_scheduler::stop()
660659 DBUG_PRINT (" info" , (" Scheduler thread has id %lu" ,
661660 (ulong) scheduler_thd->thread_id ));
662661 /* This will wake up the thread if it waits on Queue's conditional */
663- sql_print_information (" Event Scheduler: Killing the scheduler thread, "
664- " thread id %lu" ,
665- (ulong) scheduler_thd->thread_id );
662+ if (global_system_variables.log_warnings )
663+ sql_print_information (" Event Scheduler: Killing the scheduler thread, "
664+ " thread id %llu" ,
665+ (ulonglong) scheduler_thd->thread_id );
666666 scheduler_thd->awake (KILL_CONNECTION);
667667
668668 /* thd could be 0x0, when shutting down */
669- sql_print_information (" Event Scheduler: "
670- " Waiting for the scheduler thread to reply" );
669+ if (global_system_variables.log_warnings > 1 )
670+ sql_print_information (" Event Scheduler: "
671+ " Waiting for the scheduler thread to reply" );
671672
672673 /*
673674 Wait only 2 seconds, as there is a small chance the thread missed the
@@ -678,7 +679,8 @@ Event_scheduler::stop()
678679 COND_STATE_WAIT (thd, &top_time, &stage_waiting_for_scheduler_to_stop);
679680 } while (state == STOPPING);
680681 DBUG_PRINT (" info" , (" Scheduler thread has cleaned up. Set state to INIT" ));
681- sql_print_information (" Event Scheduler: Stopped" );
682+ if (global_system_variables.log_warnings )
683+ sql_print_information (" Event Scheduler: Stopped" );
682684end:
683685 UNLOCK_DATA ();
684686 DBUG_RETURN (FALSE );
0 commit comments