MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
check_events_off.inc
1 ########## include/check_events_off.inc ####################################
2 # #
3 # Purpose: #
4 # Wait till we can expect that we have no event activity till the scheduler is #
5 # switched on again. #
6 # = There will be no modifications of user tables by existing events #
7 # except they use "INSERT DELAYED" or the server system variable #
8 # "concurrent_inserts" is not switched off. #
9 # Only some storage engines support concurrent_inserts" or "INSERT DELAYED". #
10 # #
11 # Creation: #
12 # 2008-12-19 mleich Implement this check needed for bug fixes in tests #
13 # #
14 ################################################################################
15 
16 # 1. Check that the server system variable shows the state needed
17 if (`SELECT @@global.event_scheduler <> 'OFF'`)
18 {
19  --echo # Error: We expect here that the event scheduler is switched off.
20  SELECT @@global.event_scheduler;
21  --echo # Thinkable reasons:
22  --echo # 1. SET GLOBAL event_scheduler = OFF had not the expected effect.
23  --echo # 2. Use of the current routine (include/check_events_off.inc)
24  --echo # within the wrong situation
25  --die
26 }
27 # 2. Wait till we have no event_scheduler session within the processlist
28 --source include/no_running_event_scheduler.inc
29 # 3. Wait till we have no event executor sessions within the processlist
30 --source include/no_running_events.inc
31