Author: jstephens
Date: 2006-05-25 11:56:24 +0200 (Thu, 25 May 2006)
New Revision: 2197
Log:
Event scheduler thread and SHOW PROCESSLIST
You can't actually kill this thread (Andrey)
Modified:
trunk/refman-5.1/events.xml
Modified: trunk/refman-5.1/events.xml
===================================================================
--- trunk/refman-5.1/events.xml 2006-05-24 19:26:47 UTC (rev 2196)
+++ trunk/refman-5.1/events.xml 2006-05-25 09:56:24 UTC (rev 2197)
@@ -199,6 +199,15 @@
</listitem>
</itemizedlist>
+
+ <para>
+ Events are executed by a special <firstterm>event scheduler
+ thread</firstterm>; when we refer to the Event Scheduler, we
+ actually refer to this thread. When running, the event scheduler
+ thread and its current state can be seen by users having the
+ <literal>SUPER</literal> privilege in the output of <literal>SHOW
+ PROCESSLIST</literal>, as shown in the discussion that follows.
+ </para>
<para>
The global variable <literal>event_scheduler</literal> determines
@@ -219,23 +228,87 @@
<literal><option>--event-scheduler</option>=0</literal> or
<literal><option>--event-scheduler</option>=OFF</literal>.
</para>
+
+ <para>
+ When the Event Scheduler is turned OFF, the event scheduler
+ thread does not run, and so cannot be seen listed in the
+ output of <literal>SHOW PROCESSLIST</literal>.
+ </para>
</listitem>
<listitem>
<para>
- <literal>1</literal>: The event scheduler is ON; the event
+ <literal>1</literal>: The Event Scheduler is ON; the event
scheduler thread runs and executes all scheduled events.
</para>
+
+ <para>
+ When the Event Scheduler is in the ON state, it will appear to
+ be sleeping:
+ </para>
+
+<programlisting>
+mysql> <userinput>SHOW PROCESSLIST\G</userinput>
+*************************** 1. row ***************************
+ Id: 1
+ User: event_scheduler
+ Host: localhost
+ db: NULL
+Command: Connect
+ Time: 0
+ State: Sleeping
+ Info: NULL
+*************************** 2. row ***************************
+ Id: 52
+ User: root
+ Host: localhost
+ db: NULL
+Command: Query
+ Time: 0
+ State: NULL
+ Info: SHOW PROCESSLIST
+2 rows in set (0.00 sec)
+</programlisting>
</listitem>
<listitem>
<para>
- <literal>2</literal>: The event scheduler is SUSPENDED; the
+ <literal>2</literal>: The Event Scheduler is SUSPENDED; the
event scheduler thread runs, but it does not execute any
scheduled events. This is the default value for
<literal>event_scheduler</literal>.
</para>
- </listitem>
+
+ <para>
+ When the Event Scheduler is in the SUSPENDED state, this can
+ be seen from the <literal>State</literal> column in the output
+ of <literal>SHOW PROCESSLIST</literal> as shown here:
+ </para>
+
+<programlisting>
+mysql> <userinput>SHOW PROCESSLIST\G</userinput>
+*************************** 1. row ***************************
+ Id: 1
+ User: event_scheduler
+ Host: localhost
+ db: NULL
+Command: Connect
+ Time: 1
+ State: Suspended
+ Info: NULL
+*************************** 2. row ***************************
+ Id: 52
+ User: root
+ Host: localhost
+ db: NULL
+Command: Query
+ Time: 0
+ State: NULL
+ Info: SHOW PROCESSLIST
+2 rows in set (0.00 sec)
+</programlisting>
+ </listitem>
+
</itemizedlist>
<para>
@@ -258,7 +331,7 @@
</programlisting>
<para>
- If event scheduling is enabled, you can disable it by issuing
+ If event scheduling is enabled, you can suspend it by issuing
either one of these two statements:
</para>
@@ -310,6 +383,16 @@
Since <literal>event_scheduler</literal> is a global variable, you
must have the <literal>SUPER</literal> privilege to set its value.
</para>
+
+ <para>
+ The event scheduler thread cannot be killed. If you attempt to
+ <literal>KILL</literal> the event scheduler thread, the effect is
+ the same as suspending it. It can be re-enabled by setting the
+ global <literal>event_scheduler</literal> variable to
+ <literal>1</literal>, just as if you had previously set its value
+ to <literal>2</literal>. The only way to stop this thread is by
+ stopping the server.
+ </para>
<para>
<emphasis role="bold">Note</emphasis>: You can issue
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r2197 - trunk/refman-5.1 | jon | 25 May |