List:Commits« Previous MessageNext Message »
From:jon Date:May 24 2006 12:19am
Subject:svn commit - mysqldoc@docsrva: r2180 - in trunk: refman-5.1 refman-common
View as plain text  
Author: jstephens
Date: 2006-05-24 02:19:00 +0200 (Wed, 24 May 2006)
New Revision: 2180

Log:

Documenting Event Scheduler bugfixes/feature changes:
  Bug #16428, Bug #17619, Bug #19264
  
Change in behaviour of event scheduler thread / @@global.event_scheduler 
  variable / --event-scheduler startup option.



Modified:
   trunk/refman-5.1/events.xml
   trunk/refman-common/news-5.1.xml

Modified: trunk/refman-5.1/events.xml
===================================================================
--- trunk/refman-5.1/events.xml	2006-05-23 20:45:36 UTC (rev 2179)
+++ trunk/refman-5.1/events.xml	2006-05-24 00:19:00 UTC (rev 2180)
@@ -201,46 +201,69 @@
     </itemizedlist>
 
     <para>
-      MySQL 5.1.6 introduces a global variable
-      <literal>event_scheduler</literal> which determines whether the
-      Event scheduler is enabled for the server. This variable defaults
-      to <literal>OFF</literal> or <literal>0</literal>, meaning that
-      event scheduling is not available:
+      The global variable <literal>event_scheduler</literal> determines
+      whether the Event Scheduler is enabled on the server. Beginning
+      with MySQL 5.1.11, it can have one of these 3 values, which affect
+      event scheduling as follows:
     </para>
+    
+    <itemizedlist>
+      <listitem>
+        <para>
+          <literal>0</literal>: Event scheduling is OFF: The event
+          scheduler thread does not run, and no scheduled events are
+          executed. The <literal>event_scheduler</literal> variable
+          cannot be set to this value while the server is running;
+          instead, to turn off event scheduling altogether, you must
+          start the server with
+          <literal><option>--event-scheduler</option>=0</literal> or
+          <literal><option>--event-scheduler</option>=OFF</literal>. 
+        </para>
+      </listitem>
+      
+      <listitem>
+        <para>
+          <literal>1</literal>: The event scheduler is ON; the event
+          scheduler thread runs and executes all scheduled events.
+        </para>
+      </listitem>
+      
+      <listitem>
+        <para>
+          <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>
+    </itemizedlist>
+    
+    <para>
+      Provided that the event scheduler thread has not been deactivated
+      by starting the server with <option>--event-scheduler=0</option>,
+      you can enable the execution of scheduled events by issuing either
+      of the following two statements:
+    </para>
 
 <programlisting>
-mysql&gt; <userinput>SHOW GLOBAL VARIABLES LIKE 'event%'</userinput>;
-+-----------------+-------+
-| Variable_name   | Value |
-+-----------------+-------+
-| event_scheduler | OFF   |
-+-----------------+-------+
-1 row in set (0.01 sec)
-
-mysql&gt; <userinput>SELECT @@event_scheduler;</userinput>
-+-------------------+
-| @@event_scheduler |
-+-------------------+
-|                 0 |
-+-------------------+
-1 row in set (0.00 sec)
+SET GLOBAL event_scheduler = 1;
 </programlisting>
 
     <para>
-      In order to enable event scheduling, you must first issue one of
-      these statements:
+      or
     </para>
 
 <programlisting>
-SET GLOBAL event_scheduler = ON;
+SET @@global.event_scheduler = 1;
 </programlisting>
-
+    
     <para>
-      or
+      If event scheduling is enabled, you can disable it by issuing
+      either one of these two statements:
     </para>
 
 <programlisting>
-SET GLOBAL event_scheduler = 1;
+SET GLOBAL event_scheduler = 2;
 </programlisting>
 
     <para>
@@ -248,41 +271,67 @@
     </para>
 
 <programlisting>
-SET @@global.event_scheduler = ON;
+SET @@global.event_scheduler = 2;
 </programlisting>
-
+        
     <para>
-      or
+      <emphasis role="bold">Important</emphasis>: Once the server
+      has been started with the event scheduler thread deactivated,
+      the thread cannot be activated &mdash; that is, if the server
+      was started with <option>--event-scheduler=0</option>, then
+      <literal>event_scheduler</literal> cannot be set to 
+      <literal>1</literal> or <literal>2</literal> &mdash; without
+      restarting <command>mysqld</command>. Similarly, if the server
+      was started with the event scheduler thread running &mdash;
+      that is, with <option>--event-scheduler=1</option> or
+      <option>--event-schedule=2</option> &mdash; you cannot stop the
+      event scheduler thread by issuing <literal>SET
+        @@global.event_scheduler = 0;</literal>. Attempting to start or
+      stop the event scheduler thread while the server is running causes
+      an error, as shown here: 
     </para>
+    
+<programlisting>
+mysql&gt; <userinput>SELECT @@global.event_scheduler;</userinput>
++--------------------------+
+| @@global.event_scheduler |
++--------------------------+
+|                        2 |
++--------------------------+
+1 row in set (0.00 sec)
 
-<programlisting>
-SET @@global.event_scheduler = 1;
+mysql&gt; <userinput>SET @@global.event_scheduler = 0;</userinput>
+<errortext>ERROR 1231 (42000): Variable 'event_scheduler' can't be set to the value of '0'</errortext>
+mysql&gt; <userinput>SET @@global.event_scheduler = 1;</userinput>
+Query OK, 0 rows affected (0.01 sec)
 </programlisting>
 
     <para>
-      <emphasis role="bold">Note</emphasis>: You can issue
-      event-manipulation statements when
-      <literal>event_scheduler</literal> is set to
-      <literal>OFF</literal> or <literal>0</literal>. No warnings or
-      errors are generated in such cases (so long as the statements are
-      themselves valid). However, scheduled events cannot execute until
-      this variable is set to <literal>ON</literal> or
-      <literal>1</literal>. (Once this has been done, all events whose
-      scheduling conditions are met become active.)
+      Since <literal>event_scheduler</literal> is a global variable, you
+      must have the <literal>SUPER</literal> privilege to set its value.
     </para>
 
     <para>
-      <emphasis role="bold">Note</emphasis>: Since
-      <literal>event_scheduler</literal> is a global variable, you must
-      have the <literal>SUPER</literal> privilege to set its value.
+      <emphasis role="bold">Note</emphasis>: You can issue
+      event-manipulation statements when
+      <literal>event_scheduler</literal> is set to <literal>0</literal>
+      or <literal>2</literal>. No warnings or errors are generated in
+      such cases (provided that the statements are themselves valid).
+      However, scheduled events cannot execute until this variable is
+      set to <literal>1</literal>. Once this has been done, the event
+      scheduler thread executes all events whose scheduling conditions
+      are satisfied.
     </para>
-
+    
     <para>
-      You can also enable event scheduling by starting
-      <command>mysqld</command> with
-      <option>--event_scheduler=1</option> or more simply
-      <option>--event_scheduler</option>. (<literal>1</literal> is the
-      default value in this case.)
+      <emphasis role="bold">Note</emphasis>: Prior to MySQL 5.1.11,
+      <literal>event_scheduler</literal> could take one of only the 2
+      values <literal>0</literal>|<literal>OFF</literal> or
+      <literal>1</literal>|<literal>ON</literal>, the default value
+      being <literal>0</literal>|<literal>OFF</literal>. It was also
+      possible to start and stop the event scheduler thread while the
+      MySQL server was running. For information concerning the reasons
+      for this change in behaviour, see Bug #17619.
     </para>
 
     <para>

Modified: trunk/refman-common/news-5.1.xml
===================================================================
--- trunk/refman-common/news-5.1.xml	2006-05-23 20:45:36 UTC (rev 2179)
+++ trunk/refman-common/news-5.1.xml	2006-05-24 00:19:00 UTC (rev 2180)
@@ -57,6 +57,23 @@
     </para>
 
     <itemizedlist>
+      
+      <listitem>
+        <para>
+          <emphasis role="bold">Incompatible change</emphasis>: The
+          Event Scheduler can now be in one of three states (on, off, or
+          the new suspended state). In addition, due to the fact that
+          <literal>SET GLOBAL event_scheduler;</literal> now acts in a
+          synchronous rather than asynchronous manner, the Event
+          Scheduler thread can be no longer be activated or deactivated
+          at run time. (Bug #17619)
+        </para>
+        
+        <para>
+          For more information regarding these changes, see 
+          <xref linkend="events-overview"/>. 
+        </para>
+      </listitem>
 
       <listitem>
         <para>
@@ -135,6 +152,20 @@
 
       <listitem>
         <para>
+          Simultaneous scheduled events whose actions conflicted with
+          one another could crash the server. (Bug #16428)
+        </para>
+      </listitem>
+      
+      <listitem>
+        <para>
+          In was not possible to invoke a stored routine containing
+          dynamic SQL from a scheduled event. (Bug #19264)
+        </para>
+      </listitem>
+      
+      <listitem>
+        <para>
           <literal>NDB Cluster</literal>: Running <literal>ALL
           START</literal> in the <literal>NDB</literal> management
           client or restarting multiple nodes simultaneously could under

Thread
svn commit - mysqldoc@docsrva: r2180 - in trunk: refman-5.1 refman-commonjon24 May