List:Commits« Previous MessageNext Message »
From:paul Date:January 17 2006 9:43pm
Subject:svn commit - mysqldoc@docsrva: r880 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-common
View as plain text  
Author: paul
Date: 2006-01-17 22:43:25 +0100 (Tue, 17 Jan 2006)
New Revision: 880

Log:
 r6317@frost:  paul | 2006-01-17 15:42:23 -0600
 General revisions.


Modified:
   trunk/
   trunk/refman-4.1/database-administration.xml
   trunk/refman-4.1/functions.xml
   trunk/refman-4.1/innodb.xml
   trunk/refman-4.1/ndbcluster.xml
   trunk/refman-5.0/database-administration.xml
   trunk/refman-5.0/functions.xml
   trunk/refman-5.0/innodb.xml
   trunk/refman-5.0/ndbcluster.xml
   trunk/refman-5.0/restrictions.xml
   trunk/refman-5.0/stored-procedures.xml
   trunk/refman-5.1/database-administration.xml
   trunk/refman-5.1/functions.xml
   trunk/refman-5.1/innodb.xml
   trunk/refman-5.1/ndbcluster.xml
   trunk/refman-5.1/replication.xml
   trunk/refman-5.1/restrictions.xml
   trunk/refman-5.1/stored-procedures.xml
   trunk/refman-common/titles.en.ent


Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6316
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2265
   + b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6317
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2265

Modified: trunk/refman-4.1/database-administration.xml
===================================================================
--- trunk/refman-4.1/database-administration.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-4.1/database-administration.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -5046,7 +5046,12 @@
             </para>
 
             <para>
-              This is <literal>ON</literal> if you have started
+              If <literal>ON</literal>, the server flushes all changes
+              to disk after each SQL statement. Normally MySQL does a
+              write of all changes to disk only after each SQL statement
+              and lets the operating system handle the synching to disk.
+              See <xref linkend="crashing"/>. This variable is set to
+              <literal>ON</literal> if you start
               <command>mysqld</command> with the
               <option>--flush</option> option. This variable was added
               in MySQL 3.22.9.
@@ -7343,6 +7348,20 @@
             <para>
               This variable was added in MySQL 3.22.4.
             </para>
+
+            <para>
+              This variable is set by the <literal>SET TRANSACTION
+              ISOLATION LEVEL</literal> statement. See
+              <xref linkend="set-transaction"/>. If you set
+              <literal>tx_isolation</literal> level directly to an
+              isolation level name that contains a space, the name
+              should be enclosed within quotes, with the space replaced
+              by a dash. For example:
+            </para>
+
+<programlisting>
+SET tx_isolation = 'READ-COMMITTED';
+</programlisting>
           </listitem>
 
           <listitem>

Modified: trunk/refman-4.1/functions.xml
===================================================================
--- trunk/refman-4.1/functions.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-4.1/functions.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -5520,8 +5520,8 @@
             Returns a random floating-point value
             <replaceable>v</replaceable> between <literal>0</literal>
             and <literal>1</literal> inclusive (that is, in the range
-            <literal>0</literal> &lt;= <replaceable>v</replaceable> &lt;=
-            <literal>1.0</literal>). If an integer argument
+            <literal>0</literal> &lt;= <replaceable>v</replaceable>
+            &lt;= <literal>1.0</literal>). If an integer argument
             <replaceable>N</replaceable> is specified, it is used as the
             seed value, which produces a repeatable sequence.
           </para>

Modified: trunk/refman-4.1/innodb.xml
===================================================================
--- trunk/refman-4.1/innodb.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-4.1/innodb.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -5850,8 +5850,8 @@
       <para>
         (In the preceding query, we are <quote>fooling</quote> the SQL
         optimizer into scanning the clustered index, rather than a
-        secondary index.) Most disks can read 10 to 50MB/s, which can
-        be used to estimate how fast a table scan should run.
+        secondary index.) Most disks can read 10 to 50MB/s, which can be
+        used to estimate how fast a table scan should run.
       </para>
 
       <para>

Modified: trunk/refman-4.1/ndbcluster.xml
===================================================================
--- trunk/refman-4.1/ndbcluster.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-4.1/ndbcluster.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -669,10 +669,9 @@
           For our sample data, we will use the <literal>world</literal>
           database which is available for download from the MySQL AB Web
           site. As this database takes up a relatively small amount of
-          space, we assume that each machine has 256MB RAM, which
-          should be sufficient for running the operating system, host
-          NDB process, and (for the data nodes) for storing the
-          database.
+          space, we assume that each machine has 256MB RAM, which should
+          be sufficient for running the operating system, host NDB
+          process, and (for the data nodes) for storing the database.
         </para>
       </listitem>
 

Modified: trunk/refman-5.0/database-administration.xml
===================================================================
--- trunk/refman-5.0/database-administration.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.0/database-administration.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -6537,7 +6537,12 @@
             </para>
 
             <para>
-              This is <literal>ON</literal> if you have started
+              If <literal>ON</literal>, the server flushes all changes
+              to disk after each SQL statement. Normally MySQL does a
+              write of all changes to disk only after each SQL statement
+              and lets the operating system handle the synching to disk.
+              See <xref linkend="crashing"/>. This variable is set to
+              <literal>ON</literal> if you start
               <command>mysqld</command> with the
               <option>--flush</option> option.
             </para>
@@ -8836,6 +8841,20 @@
               The default transaction isolation level. Defaults to
               <literal>REPEATABLE-READ</literal>.
             </para>
+
+            <para>
+              This variable is set by the <literal>SET TRANSACTION
+              ISOLATION LEVEL</literal> statement. See
+              <xref linkend="set-transaction"/>. If you set
+              <literal>tx_isolation</literal> level directly to an
+              isolation level name that contains a space, the name
+              should be enclosed within quotes, with the space replaced
+              by a dash. For example:
+            </para>
+
+<programlisting>
+SET tx_isolation = 'READ-COMMITTED';
+</programlisting>
           </listitem>
 
           <listitem>

Modified: trunk/refman-5.0/functions.xml
===================================================================
--- trunk/refman-5.0/functions.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.0/functions.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -1574,6 +1574,18 @@
           string. If used in a numeric context, then the result is
           returned as a decimal, real, or integer value.
         </para>
+
+        <para>
+          <emphasis role="bold">Note</emphasis>: The syntax of the
+          <literal>CASE</literal> <emphasis>expression</emphasis> shown
+          here differs slightly from that of the SQL
+          <literal>CASE</literal> <emphasis>statement</emphasis>
+          described in <xref linkend="case-statement"/>, for use inside
+          stored routines. . The <literal>CASE</literal> statement
+          cannot have an <literal>ELSE NULL</literal> clause, and it is
+          terminated with <literal>END CASE</literal> instead of
+          <literal>END</literal>.
+        </para>
       </listitem>
 
       <listitem>
@@ -1691,6 +1703,14 @@
           <replaceable>expr3</replaceable> are both strings, the result
           is case sensitive if either string is case sensitive.
         </para>
+
+        <para>
+          <emphasis role="bold">Note</emphasis>: There is also an
+          <literal>IF</literal> <emphasis>statement</emphasis>, which
+          differs from the <literal>IF()</literal>
+          <emphasis>function</emphasis> described here. See
+          <xref linkend="if-statement"/>.
+        </para>
       </listitem>
 
       <listitem>
@@ -5558,8 +5578,8 @@
             Returns a random floating-point value
             <replaceable>v</replaceable> between <literal>0</literal>
             and <literal>1</literal> inclusive (that is, in the range
-            <literal>0</literal> &lt;= <replaceable>v</replaceable> &lt;=
-            <literal>1.0</literal>). If an integer argument
+            <literal>0</literal> &lt;= <replaceable>v</replaceable>
+            &lt;= <literal>1.0</literal>). If an integer argument
             <replaceable>N</replaceable> is specified, it is used as the
             seed value, which produces a repeatable sequence.
           </para>

Modified: trunk/refman-5.0/innodb.xml
===================================================================
--- trunk/refman-5.0/innodb.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.0/innodb.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -5788,8 +5788,8 @@
       <para>
         (In the preceding query, we are <quote>fooling</quote> the SQL
         optimizer into scanning the clustered index, rather than a
-        secondary index.) Most disks can read 10 to 50MB/s, which can
-        be used to estimate how fast a table scan should run.
+        secondary index.) Most disks can read 10 to 50MB/s, which can be
+        used to estimate how fast a table scan should run.
       </para>
 
       <para>

Modified: trunk/refman-5.0/ndbcluster.xml
===================================================================
--- trunk/refman-5.0/ndbcluster.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.0/ndbcluster.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -668,10 +668,9 @@
           For our sample data, we will use the <literal>world</literal>
           database which is available for download from the MySQL AB Web
           site. As this database takes up a relatively small amount of
-          space, we assume that each machine has 256MB RAM, which
-          should be sufficient for running the operating system, host
-          NDB process, and (for the data nodes) for storing the
-          database.
+          space, we assume that each machine has 256MB RAM, which should
+          be sufficient for running the operating system, host NDB
+          process, and (for the data nodes) for storing the database.
         </para>
       </listitem>
 

Modified: trunk/refman-5.0/restrictions.xml
===================================================================
--- trunk/refman-5.0/restrictions.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.0/restrictions.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -257,6 +257,14 @@
       performed by other threads.
     </para>
 
+    <para>
+      <literal>UNDO</literal> handlers are not supported.
+    </para>
+
+    <para>
+      <literal>FOR</literal> loops are not supported.
+    </para>
+
   </section>
 
   <section id="cursor-restrictions">

Modified: trunk/refman-5.0/stored-procedures.xml
===================================================================
--- trunk/refman-5.0/stored-procedures.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.0/stored-procedures.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -25,7 +25,7 @@
   <remark role="help-category" condition="Stored Routines"/>
 
   <para>
-    Stored procedures and functions are supported in MySQL version
+    Stored routines (procedures and functions) are supported in MySQL
     &current-series;. A stored procedure is a set of SQL statements that
     can be stored in the server. Once this has been done, clients don't
     need to keep reissuing the individual statements but can refer to
@@ -33,7 +33,7 @@
   </para>
 
   <para>
-    Some situations where stored procedures can be particularly useful:
+    Some situations where stored routines can be particularly useful:
   </para>
 
   <itemizedlist>
@@ -49,45 +49,45 @@
     <listitem>
       <para>
         When security is paramount. Banks, for example, use stored
-        procedures for all common operations. This provides a consistent
-        and secure environment, and procedures can ensure that each
-        operation is properly logged. In such a setup, applications and
-        users would not get any access to the database tables directly,
-        but can only execute specific stored procedures.
+        procedures and functions for all common operations. This
+        provides a consistent and secure environment, and routines can
+        ensure that each operation is properly logged. In such a setup,
+        applications and users would have no access to the database
+        tables directly, but can only execute specific stored routines.
       </para>
     </listitem>
 
   </itemizedlist>
 
   <para>
-    Stored procedures can provide improved performance because less
+    Stored routines can provide improved performance because less
     information needs to be sent between the server and the client. The
     tradeoff is that this does increase the load on the database server
-    system because more of the work is done on the server side and less
-    is done on the client (application) side. Consider this if many
-    client machines (such as Web servers) are serviced by only one or a
-    few database servers.
+    because more of the work is done on the server side and less is done
+    on the client (application) side. Consider this if many client
+    machines (such as Web servers) are serviced by only one or a few
+    database servers.
   </para>
 
   <para>
-    Stored procedures also allow you to have libraries of functions in
-    the database server. This is a feature shared by modern application
-    languages that allow such design internally, for example, by using
-    classes. Using these client application language features is
+    Stored routines also allow you to have libraries of functions in the
+    database server. This is a feature shared by modern application
+    languages that allow such design internally (for example, by using
+    classes). Using these client application language features is
     beneficial for the programmer even outside the scope of database
     use.
   </para>
 
   <para>
-    MySQL follows the SQL:2003 syntax for stored procedures, which is
-    also used by IBM's DB2.
+    MySQL follows the SQL:2003 syntax for stored routines, which is also
+    used by IBM's DB2.
   </para>
 
   <para>
-    The MySQL implementation of stored procedures is still in progress.
+    The MySQL implementation of stored routines is still in progress.
     All syntax described in this chapter is supported and any
     limitations and extensions are documented where appropriate. Further
-    discussion of restrictions on use of stored procedures is given in
+    discussion of restrictions on use of stored routines is given in
     <xref linkend="restrictions"/>.
   </para>
 
@@ -101,7 +101,7 @@
     <title>&title-stored-procedure-privileges;</title>
 
     <para>
-      Stored procedures require the <literal>proc</literal> table in the
+      Stored routines require the <literal>proc</literal> table in the
       <literal>mysql</literal> database. This table is created during
       the MySQL &current-series; installation procedure. If you are
       upgrading to MySQL &current-series; from an earlier version, be
@@ -118,8 +118,8 @@
     </para>
 
     <para>
-      Beginning with MySQL 5.0.3, the grant system has been modified to
-      take stored routines into account as follows:
+      Beginning with MySQL 5.0.3, the grant system takes stored routines
+      into account as follows:
     </para>
 
     <itemizedlist>
@@ -145,7 +145,7 @@
           execute stored routines. However, this privilege is granted
           automatically to the creator of a routine. Also, the default
           <literal>SQL SECURITY</literal> characteristic for a routine
-          is <literal>DEFINER</literal>, which allows users who have
+          is <literal>DEFINER</literal>, which enables users who have
           access to the database with which the routine is associated to
           execute the routine.
         </para>
@@ -160,15 +160,14 @@
     <title>&title-stored-procedure-syntax;</title>
 
     <para>
-      Stored procedures and functions are routines that are created with
-      <literal>CREATE PROCEDURE</literal> and <literal>CREATE
-      FUNCTION</literal> statements. A routine is either a procedure or
-      a function. A procedure is invoked using a <literal>CALL</literal>
-      statement, and can only pass back values using output variables. A
-      function can be called from inside a statement just like any other
-      function (that is, by invoking the function's name), and can
-      return a scalar value. Stored routines may call other stored
-      routines.
+      A stored routine is either a procedure or a function. Stored
+      routines are created with <literal>CREATE PROCEDURE</literal> and
+      <literal>CREATE FUNCTION</literal> statements. A procedure is
+      invoked using a <literal>CALL</literal> statement, and can only
+      pass back values using output variables. A function can be called
+      from inside a statement just like any other function (that is, by
+      invoking the function's name), and can return a scalar value.
+      Stored routines may call other stored routines.
     </para>
 
     <para>
@@ -226,11 +225,16 @@
       result sets, so the client must use a MySQL client library that
       supports multiple result sets. This means the client must use a
       client library from a version of MySQL at least as recent as 4.1.
+      The client should also specify the
+      <literal>CLIENT_MULTI_STATEMENTS</literal> option when it
+      connects. For C programs, this can be done with the
+      <literal>mysql_real_connect()</literal> C API function (see
+      <xref linkend="mysql-real-connect"/>).
     </para>
 
     <para>
       The following sections describe the syntax used to create, alter,
-      drop, and query stored procedures and functions.
+      drop, and invoke stored procedures and functions.
     </para>
 
     <section id="create-procedure">
@@ -287,13 +291,13 @@
 
       <para>
         These statements create stored routines. As of MySQL 5.0.3, to
-        create a routine, it is necessary to have the <literal>CREATE
-        ROUTINE</literal> privilege, and the <literal>ALTER
-        ROUTINE</literal> and <literal>EXECUTE</literal> privileges are
-        granted automatically to its creator. If binary logging is
-        enabled, you may also need the <literal>SUPER</literal>
+        use them, it is necessary to have the <literal>CREATE
+        ROUTINE</literal> privilege. If binary logging is enabled, these
+        statements might may also require the <literal>SUPER</literal>
         privilege, as described in
-        <xref linkend="stored-procedure-logging"/>.
+        <xref linkend="stored-procedure-logging"/>. MySQL automatically
+        grants the <literal>ALTER ROUTINE</literal> and
+        <literal>EXECUTE</literal> privileges to the routine creator.
       </para>
 
       <para>
@@ -305,12 +309,12 @@
 
       <para>
         If the routine name is the same as the name of a built-in SQL
-        function, you need to use a space between the name and the
+        function, you must use a space between the name and the
         following parenthesis when defining the routine, or a syntax
         error occurs. This is also true when you invoke the routine
-        later. For this reason &mdash; even though it is possible to do
-        so &mdash; we suggest that it is better to avoid re-using the
-        names of existing SQL functions for your own stored routines.
+        later. For this reason, we suggest that it is better to avoid
+        re-using the names of existing SQL functions for your own stored
+        routines.
       </para>
 
       <para>
@@ -332,10 +336,16 @@
       </para>
 
       <para>
+        Each parameter can be declared to use any valid data type,
+        except that the <literal>COLLATE</literal> attribute cannot be
+        used.
+      </para>
+
+      <para>
         The <literal>RETURNS</literal> clause may be specified only for
-        a <literal>FUNCTION</literal>, for which it is mandatory. It is
-        used to indicate the return type of the function, and the
-        function body must contain a <literal>RETURN
+        a <literal>FUNCTION</literal>, for which it is mandatory. It
+        indicates the return type of the function, and the function body
+        must contain a <literal>RETURN
         <replaceable>value</replaceable></literal> statement.
       </para>
 
@@ -357,8 +367,8 @@
 
       <para>
         The <literal>CREATE FUNCTION</literal> statement was used in
-        earlier versions of MySQL to support UDFs (User Defined
-        Functions). See <xref linkend="adding-functions"/>. UDFs
+        earlier versions of MySQL to support UDFs (user-defined
+        functions). See <xref linkend="adding-functions"/>. UDFs
         continue to be supported, even with the existence of stored
         functions. A UDF can be regarded as an external stored function.
         However, do note that stored functions share their namespace
@@ -383,8 +393,8 @@
         result for the same input parameters, and <quote>not
         deterministic</quote> otherwise. If neither
         <literal>DETERMINISTIC</literal> nor <literal>NOT
-        DETERMINISTIC</literal> is given, the default is <literal>NOT
-        DETERMINISTIC</literal>.
+        DETERMINISTIC</literal> is given in the routine definition, the
+        default is <literal>NOT DETERMINISTIC</literal>.
       </para>
 
       <para>
@@ -402,8 +412,8 @@
       <para>
         Currently, the <literal>DETERMINISTIC</literal> characteristic
         is accepted, but not yet used by the optimizer. However, if
-        binary logging is enabled, this characteristic affects whether
-        MySQL accepts routine definitions. See
+        binary logging is enabled, this characteristic affects which
+        routine definitions MySQL accepts. See
         <xref linkend="stored-procedure-logging"/>.
       </para>
 
@@ -442,6 +452,13 @@
       </para>
 
       <para>
+        When the routine is invoked, an implicit <literal>USE
+        <replaceable>db_name</replaceable></literal> is performed (and
+        undone when the routine terminates). <literal>USE</literal>
+        statements within stored routines are disallowed.
+      </para>
+
+      <para>
         As of MySQL 5.0.18, the server uses the data type of a routine
         parameter or function return value as follows. These rules also
         apply to local routine variables created with the
@@ -490,8 +507,8 @@
 
       <para>
         The <literal>COMMENT</literal> clause is a MySQL extension, and
-        may be used to describe the stored procedure. This information
-        is displayed by the <literal>SHOW CREATE PROCEDURE</literal> and
+        may be used to describe the stored routine. This information is
+        displayed by the <literal>SHOW CREATE PROCEDURE</literal> and
         <literal>SHOW CREATE FUNCTION</literal> statements.
       </para>
 
@@ -559,7 +576,7 @@
 mysql&gt; <userinput>CREATE PROCEDURE simpleproc (OUT param1 INT)</userinput>
     -&gt; <userinput>BEGIN</userinput>
     -&gt;   <userinput>SELECT COUNT(*) INTO param1 FROM t;</userinput>
-    -&gt; <userinput>END</userinput>
+    -&gt; <userinput>END;</userinput>
     -&gt; <userinput>//</userinput>
 Query OK, 0 rows affected (0.00 sec)
 
@@ -589,19 +606,16 @@
       <para>
         The following is an example of a function that takes a
         parameter, performs an operation using an SQL function, and
-        returns the result:
+        returns the result. In this case, it is unnecessary to use
+        <literal>delimiter</literal> because the function definition
+        contains no internal <literal>;</literal> statement delimiters:
       </para>
 
 <programlisting>
-mysql&gt; <userinput>delimiter //</userinput>
-
 mysql&gt; <userinput>CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)</userinput>
     -&gt; <userinput>RETURN CONCAT('Hello, ',s,'!');</userinput>
-    -&gt; <userinput>//</userinput>
 Query OK, 0 rows affected (0.00 sec)
 
-mysql&gt; <userinput>delimiter ;</userinput>
-
 mysql&gt; <userinput>SELECT hello('world');</userinput>
 +----------------+
 | hello('world') |
@@ -612,15 +626,16 @@
 </programlisting>
 
       <para>
-        If the <literal>RETURN</literal> statement in a stored function
-        returns a value that has a different type than is specified in
-        the function's <literal>RETURNS</literal> clause, the return
-        value is coerced to the proper type. For example, if a function
-        returns an <literal>ENUM</literal> or <literal>SET</literal>
-        value, but the <literal>RETURN</literal> statement returns an
-        integer, the value returned from the function is the string for
-        the corresponding <literal>ENUM</literal> member of set of
-        <literal>SET</literal> members.
+        A stored function returns a value of the data type specified in
+        its <literal>RETURNS</literal> clause. If the
+        <literal>RETURN</literal> statement returns a value of a
+        different type, the value is coerced to the proper type. For
+        example, if a function returns an <literal>ENUM</literal> or
+        <literal>SET</literal> value, but the <literal>RETURN</literal>
+        statement returns an integer, the value returned from the
+        function is the string for the corresponding
+        <literal>ENUM</literal> member of set of <literal>SET</literal>
+        members.
       </para>
 
     </section>
@@ -662,12 +677,12 @@
 
       <para>
         This statement can be used to change the characteristics of a
-        stored procedure or function. You must have the <literal>ALTER
-        ROUTINE</literal> privilege for the routine as of MySQL 5.0.3.
-        This privilege is granted automatically to the routine creator.
-        If binary logging is enabled, you may also need the
-        <literal>SUPER</literal> privilege, as described in
-        <xref linkend="stored-procedure-logging"/>.
+        stored procedure or function. As of MySQL 5.0.3, you must have
+        the <literal>ALTER ROUTINE</literal> privilege for the routine.
+        (That privilege is granted automatically to the routine
+        creator.) If binary logging is enabled, this statement might
+        also require the <literal>SUPER</literal> privilege, as
+        described in <xref linkend="stored-procedure-logging"/>.
       </para>
 
       <para>
@@ -708,10 +723,10 @@
 
       <para>
         This statement is used to drop a stored procedure or function.
-        That is, the specified routine is removed from the server. You
-        must have the <literal>ALTER ROUTINE</literal> privilege for the
-        routine as of MySQL 5.0.3. This privilege is granted
-        automatically to the routine creator.
+        That is, the specified routine is removed from the server. As of
+        MySQL 5.0.3, you must have the <literal>ALTER ROUTINE</literal>
+        privilege for the routine. (That privilege is granted
+        automatically to the routine creator.)
       </para>
 
       <para>
@@ -902,41 +917,49 @@
       <remark role="help-description-begin"/>
 
       <para>
-        Stored routines may contain multiple statements, using a
-        <literal>BEGIN ... END</literal> compound statement.
+        <literal>BEGIN &hellip; END</literal> syntax is used for writing
+        compound statements, which can appear within stored routines and
+        triggers. A compound statement can contain multiple statements,
+        enclosed by the <literal>BEGIN</literal> and
+        <literal>END</literal> keywords.
         <replaceable>statement_list</replaceable> represents a list of
         one or more statements. Each statement within
         <replaceable>statement_list</replaceable> must be terminated by
-        a semicolon character (<literal>;</literal>).
+        a semicolon (<literal>;</literal>) statement delimiter. Note
+        that <replaceable>statement_list</replaceable> is optional,
+        which means that the empty compound statement (<literal>BEGIN
+        END</literal>) is legal.
       </para>
 
       <para>
+        Use of multiple statements requires that a client is able to
+        send statement strings containing the <literal>;</literal>
+        statement delimiter. This is handled in the
+        <command>mysql</command> command-line client with the
+        <literal>delimiter</literal> command. Changing the
+        <literal>;</literal> end-of-statement delimiter (for example, to
+        <literal>//</literal>) allows <literal>;</literal> to be used in
+        a routine body. For an example, see
+        <xref linkend="create-procedure"/>.
+      </para>
+
+      <para>
         A compound statement can be labeled.
         <replaceable>end_label</replaceable> cannot be given unless
-        <replaceable>begin_label</replaceable> also is present, and if
-        both are present, they must be the same.
+        <replaceable>begin_label</replaceable> also is present. If both
+        are present, they must be the same.
       </para>
 
       <remark role="help-description-end"/>
 
       <para>
-        Please note that the optional <literal>[NOT] ATOMIC</literal>
-        clause is not yet supported. This means that no transactional
-        savepoint is set at the start of the instruction block and the
+        The optional <literal>[NOT] ATOMIC</literal> clause is not yet
+        supported. This means that no transactional savepoint is set at
+        the start of the instruction block and the
         <literal>BEGIN</literal> clause used in this context has no
         effect on the current transaction.
       </para>
 
-      <para>
-        Using multiple statements requires that a client is able to send
-        query strings containing the <literal>;</literal> statement
-        delimiter. This is handled in the <command>mysql</command>
-        command-line client with the <literal>delimiter</literal>
-        command. Changing the <literal>;</literal> end-of-query
-        delimiter (for example, to <literal>//</literal>) allows
-        <literal>;</literal> to be used in a routine body.
-      </para>
-
     </section>
 
     <section id="declare">
@@ -949,24 +972,48 @@
 
       <para>
         The <literal>DECLARE</literal> statement is used to define
-        various items local to a routine: local variables (see
-        <xref linkend="variables-in-stored-procedures"/>), conditions
-        and handlers (see <xref linkend="conditions-and-handlers"/>) and
-        cursors (see <xref linkend="cursors"/>).
-        <literal>SIGNAL</literal> and <literal>RESIGNAL</literal>
+        various items local to a routine:
+      </para>
+
+      <itemizedlist>
+
+        <listitem>
+          <para>
+            Local variables. See
+            <xref linkend="variables-in-stored-procedures"/>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            Conditions and handlers. See
+            <xref linkend="conditions-and-handlers"/>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            Cursors. See <xref linkend="cursors"/>.
+          </para>
+        </listitem>
+
+      </itemizedlist>
+
+      <para>
+        The <literal>SIGNAL</literal> and <literal>RESIGNAL</literal>
         statements are not currently supported.
       </para>
 
       <para>
-        <literal>DECLARE</literal> may be used only inside a
-        <literal>BEGIN ... END</literal> compound statement and must be
-        at its start, before any other statements.
+        <literal>DECLARE</literal> is allowed only inside a
+        <literal>BEGIN &hellip; END</literal> compound statement and
+        must be at its start, before any other statements.
       </para>
 
       <para>
-        Cursors must be declared before declaring handlers, and
-        variables and conditions must be declared before declaring
-        either cursors or handlers.
+        Declarations must follow a certain order. Cursors must be
+        declared before declaring handlers, and variables and conditions
+        must be declared before declaring either cursors or handlers.
       </para>
 
     </section>
@@ -1013,10 +1060,11 @@
         </para>
 
         <para>
-          The scope of a local variable is within the <literal>BEGIN ...
-          END</literal> block where it is declared. It can be used in
-          nested blocks except those that declare a variable with the
-          same name.
+          The scope of a local variable is within the <literal>BEGIN
+          &hellip; END</literal> block where it is declared. The
+          variable can be referred to in blocks nested within the
+          declaring block, except those blocks that declare a variable
+          with the same name.
         </para>
 
         <remark role="help-description-end"/>
@@ -1046,21 +1094,22 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The <literal>SET</literal> statement in stored procedures is
-          an extended version of the general <literal>SET</literal>
+          The <literal>SET</literal> statement in stored routines is an
+          extended version of the general <literal>SET</literal>
           statement. Referenced variables may be ones declared inside a
           routine, or global server variables.
         </para>
 
         <para>
-          The <literal>SET</literal> statement in stored procedures is
+          The <literal>SET</literal> statement in stored routines is
           implemented as part of the pre-existing <literal>SET</literal>
           syntax. This allows an extended syntax of <literal>SET a=x,
-          b=y, ...</literal> where different variable types (locally
-          declared variables and global and session server variables)
-          can be mixed. This also allows combinations of local variables
-          and some options that make sense only for system variables; in
-          that case, the options are recognized but ignored.
+          b=y, &hellip;</literal> where different variable types
+          (locally declared variables and global and session server
+          variables) can be mixed. This also allows combinations of
+          local variables and some options that make sense only for
+          system variables; in that case, the options are recognized but
+          ignored.
         </para>
 
         <remark role="help-description-end"/>
@@ -1104,15 +1153,14 @@
 </programlisting>
 
         <para>
-          Note that user variable names are <emphasis>not</emphasis>
-          case sensitive in MySQL &current-series;. See
+          User variable names are not case sensitive. See
           <xref linkend="variables"/>.
         </para>
 
         <para>
           <emphasis role="bold">Important</emphasis>: SQL variable names
           should not be the same as column names. If an SQL statement,
-          such as a <literal>SELECT ... INTO</literal> statement,
+          such as a <literal>SELECT &hellip; INTO</literal> statement,
           contains a reference to a column and a declared local variable
           with the same name, MySQL currently interprets the reference
           as the name of a variable. For example, in the following
@@ -1137,9 +1185,8 @@
 
         <para>
           When this procedure is called, the <literal>newname</literal>
-          variable will return the value <literal>'bob'</literal>
-          regardless of the value of the <literal>table1.xname</literal>
-          column.
+          variable returns the value <literal>'bob'</literal> regardless
+          of the value of the <literal>table1.xname</literal> column.
         </para>
 
         <para>
@@ -1156,8 +1203,8 @@
 
       <para>
         Certain conditions may require specific handling. These
-        conditions can relate to errors, as well as general flow control
-        inside a routine.
+        conditions can relate to errors, as well as to general flow
+        control inside a routine.
       </para>
 
       <section id="declare-conditions">
@@ -1195,8 +1242,8 @@
         </para>
 
         <para>
-          In addition to SQLSTATE values, MySQL error codes are also
-          supported.
+          A <replaceable>condition_value</replaceable> can be an
+          SQLSTATE value or a MySQL error code.
         </para>
 
         <remark role="help-description-end"/>
@@ -1247,25 +1294,48 @@
           (for example, <literal>SET <replaceable>var_name</replaceable>
           = <replaceable>value</replaceable></literal>), or it can be a
           compound statement written using <literal>BEGIN</literal> and
-          <literal>END</literal>. Compound statement syntax is described
-          in <xref linkend="begin-end"/>.
+          <literal>END</literal> (see <xref linkend="begin-end"/>).
         </para>
 
         <para>
           For a <literal>CONTINUE</literal> handler, execution of the
           current routine continues after execution of the handler
           statement. For an <literal>EXIT</literal> handler, execution
-          terminates for the <literal>BEGIN...END</literal> compound
-          statement in which the handler is declared. (This is true even
-          if the condition occurs in an inner block.) The
+          terminates for the <literal>BEGIN &hellip; END</literal>
+          compound statement in which the handler is declared. (This is
+          true even if the condition occurs in an inner block.) The
           <literal>UNDO</literal> handler type statement is not yet
           supported.
         </para>
 
+        <para>
+          If a condition occurs for which no handler has been declared,
+          the default action is <literal>EXIT</literal>.
+        </para>
+
+        <para>
+          A <replaceable>condition_value</replaceable> can be any of the
+          following values:
+        </para>
+
         <itemizedlist>
 
           <listitem>
             <para>
+              An SQLSTATE value or a MySQL error code.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
+              A condition name previously specified with
+              <literal>DECLARE &hellip; CONDITION</literal>. See
+              <xref linkend="declare-conditions"/>.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
               <literal>SQLWARNING</literal> is shorthand for all
               SQLSTATE codes that begin with <literal>01</literal>.
             </para>
@@ -1288,15 +1358,10 @@
 
         </itemizedlist>
 
-        <para>
-          In addition to SQLSTATE values, MySQL error codes are also
-          supported.
-        </para>
-
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -1334,14 +1399,16 @@
         <remark role="help-example-end"/>
 
         <para>
-          Notice that <literal>@x</literal> is <literal>3</literal>,
-          which shows that MySQL executed to the end of the procedure.
-          If the line <literal>DECLARE CONTINUE HANDLER FOR SQLSTATE
-          '23000' SET @x2 = 1;</literal> had not been present, MySQL
-          would have taken the default (<literal>EXIT</literal>) path
-          after the second <literal>INSERT</literal> failed due to the
-          <literal>PRIMARY KEY</literal> constraint, and <literal>SELECT
-          @x</literal> would have returned <literal>2</literal>.
+          The example associates a handler with SQLSTATE 23000, which
+          occurs for a duplicate-key error. Notice that
+          <literal>@x</literal> is <literal>3</literal>, which shows
+          that MySQL executed to the end of the procedure. If the line
+          <literal>DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2
+          = 1;</literal> had not been present, MySQL would have taken
+          the default path (<literal>EXIT</literal>) after the second
+          <literal>INSERT</literal> failed due to the <literal>PRIMARY
+          KEY</literal> constraint, and <literal>SELECT @x</literal>
+          would have returned <literal>2</literal>.
         </para>
 
         <para>
@@ -1381,7 +1448,7 @@
       </para>
 
       <para>
-        For example:
+        Example:
       </para>
 
 <programlisting>
@@ -1434,8 +1501,8 @@
 
         <para>
           This statement declares a cursor. Multiple cursors may be
-          defined in a routine, but each cursor in a block must have a
-          unique name.
+          declared in a routine, but each cursor in a given block must
+          have a unique name.
         </para>
 
         <para>
@@ -1552,14 +1619,16 @@
       <para>
         The <literal>IF</literal>, <literal>CASE</literal>,
         <literal>LOOP</literal>, <literal>WHILE</literal>,
-        <literal>ITERATE</literal>, and <literal>LEAVE</literal>
-        constructs are fully implemented.
+        <literal>REPLACE</literal> <literal>ITERATE</literal>, and
+        <literal>LEAVE</literal> constructs are fully implemented.
       </para>
 
       <para>
-        These constructs may each contain either a single statement, or
-        a block of statements using the <literal>BEGIN ... END</literal>
-        compound statement. Constructs may be nested.
+        Many of these constructs contain other statements, as indicated
+        by the grammer specifications in the following sections. Such
+        constructs may be nested. For example, an <literal>IF</literal>
+        statement might contain a <literal>WHILE</literal> loop, which
+        itself contains a <literal>CASE</literal> statement.
       </para>
 
       <para>
@@ -1597,15 +1666,17 @@
           evaluates to true, the corresponding SQL statement list is
           executed. If no <replaceable>search_condition</replaceable>
           matches, the statement list in the <literal>ELSE</literal>
-          clause is executed. <replaceable>statement_list</replaceable>
-          can consist of one or more statements.
+          clause is executed. Each
+          <replaceable>statement_list</replaceable> consists of one or
+          more statements.
         </para>
 
         <para>
-          Please note that there is also an <literal>IF()</literal>
-          <emphasis>function</emphasis>, which differs from the
-          <literal>IF</literal> <emphasis>statement</emphasis> described
-          here.. See <xref linkend="control-flow-functions"/>.
+          <emphasis role="bold">Note</emphasis>: There is also an
+          <literal>IF()</literal> <emphasis>function</emphasis>, which
+          differs from the <literal>IF</literal>
+          <emphasis>statement</emphasis> described here. See
+          <xref linkend="control-flow-functions"/>.
         </para>
 
         <remark role="help-description-end"/>
@@ -1653,19 +1724,21 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The <literal>CASE</literal> statement for stored procedures
+          The <literal>CASE</literal> statement for stored routines
           implements a complex conditional construct. If a
           <replaceable>search_condition</replaceable> evaluates to true,
-          the corresponding SQL statement is executed. If no search
-          condition matches, the statement in the
-          <literal>ELSE</literal> clause is executed.
+          the corresponding SQL statement list is executed. If no search
+          condition matches, the statement list in the
+          <literal>ELSE</literal> clause is executed. Each
+          <replaceable>statement_list</replaceable> consists of one or
+          more statements.
         </para>
 
         <para>
-          <emphasis role="bold">Note</emphasis>: The syntax of a
+          <emphasis role="bold">Note</emphasis>: The syntax of the
           <literal>CASE</literal> <emphasis>statement</emphasis> shown
-          here for use inside a stored procedure differs slightly from
-          that of the SQL <literal>CASE</literal>
+          here for use inside stored routines differs slightly from that
+          of the SQL <literal>CASE</literal>
           <emphasis>expression</emphasis> described in
           <xref linkend="control-flow-functions"/>. The
           <literal>CASE</literal> statement cannot have an <literal>ELSE
@@ -1703,16 +1776,16 @@
 
         <para>
           <literal>LOOP</literal> implements a simple loop construct,
-          enabling repeated execution of a particular statement or
-          statements. The statements within the loop are repeated until
-          the loop is exited; usually this is accomplished with a
-          <literal>LEAVE</literal> statement.
+          enabling repeated execution of the statement list, which
+          consists of one or more statements. The statements within the
+          loop are repeated until the loop is exited; usually this is
+          accomplished with a <literal>LEAVE</literal> statement.
         </para>
 
         <para>
           A <literal>LOOP</literal> statement can be labeled.
           <replaceable>end_label</replaceable> cannot be given unless
-          <replaceable>begin_label</replaceable> also is present, and if
+          <replaceable>begin_label</replaceable> also is present. If
           both are present, they must be the same.
         </para>
 
@@ -1744,8 +1817,9 @@
 
         <para>
           This statement is used to exit any labeled flow control
-          construct. It can be used with <literal>BEGIN ...
-          END</literal> or loops.
+          construct. It can be used within <literal>BEGIN &hellip;
+          END</literal> or loop constructs (<literal>LOOP</literal>,
+          <literal>REPEAT</literal>, <literal>WHILE</literal>).
         </para>
 
         <remark role="help-description-end"/>
@@ -1775,7 +1849,7 @@
         <remark role="help-description-begin"/>
 
         <para>
-          <literal>ITERATE</literal> can only appear within
+          <literal>ITERATE</literal> can appear only within
           <literal>LOOP</literal>, <literal>REPEAT</literal>, and
           <literal>WHILE</literal> statements.
           <literal>ITERATE</literal> means <quote>do the loop
@@ -1785,7 +1859,7 @@
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -1836,22 +1910,25 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The statement or statements within a <literal>REPEAT</literal>
-          statement are repeated until the
-          <replaceable>search_condition</replaceable> is true.
+          The statement list within a <literal>REPEAT</literal>
+          statement is repeated until the
+          <replaceable>search_condition</replaceable> is true. Thus, a
+          <literal>REPEAT</literal> always enters the loop at least
+          once. <replaceable>statement_list</replaceable> consists of
+          one or more statements.
         </para>
 
         <para>
           A <literal>REPEAT</literal> statement can be labeled.
           <replaceable>end_label</replaceable> cannot be given unless
-          <replaceable>begin_label</replaceable> also is present, and if
+          <replaceable>begin_label</replaceable> also is present. If
           both are present, they must be the same.
         </para>
 
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -1908,22 +1985,24 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The statement or statements within a <literal>WHILE</literal>
-          statement are repeated as long as the
+          The statement list within a <literal>WHILE</literal> statement
+          is repeated as long as the
           <replaceable>search_condition</replaceable> is true.
+          <replaceable>statement_list</replaceable> consists of one or
+          more statements.
         </para>
 
         <para>
           A <literal>WHILE</literal> statement can be labeled.
           <replaceable>end_label</replaceable> cannot be given unless
-          <replaceable>begin_label</replaceable> also is present, and if
+          <replaceable>begin_label</replaceable> also is present. If
           both are present, they must be the same.
         </para>
 
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -2012,7 +2091,7 @@
       <listitem>
         <para>
           Are there special security requirements for using stored
-          procedures, functions and replication together?
+          procedures and functions together with replication?
         </para>
 
         <para>
@@ -2037,7 +2116,7 @@
             <para>
               Alternatively, a DBA can set the
               <literal>log_bin_trust_function_creators</literal> system
-              variable to 1, which will allow anyone with the standard
+              variable to 1, which enables anyone with the standard
               <literal>CREATE ROUTINE</literal> privilege to create
               stored functions.
             </para>
@@ -2062,8 +2141,8 @@
           Non-deterministic (random) or time-based actions embedded in
           stored procedures may not replicate properly. By their very
           nature, randomly produced results are not predictable and
-          cannot be exactly cloned, and therefore, random actions
-          replicated to a slave will not mirror those produced on a
+          cannot be exactly reproduced, and therefore, random actions
+          replicated to a slave will not mirror those performed on a
           master. Note that declaring stored functions to be
           <literal>DETERMINISTIC</literal> or setting the
           <literal>log_bin_trust_function_creators</literal> system
@@ -2073,10 +2152,10 @@
 
         <para>
           In addition, time-based actions cannot be reproduced on a
-          slave as the timing of such actions in a stored procedure is
-          not reproducible through the binary log used for replication
-          as it only records DML events and does not factor in timing
-          constraints.
+          slave because the timing of such actions in a stored procedure
+          is not reproducible through the binary log used for
+          replication. It records only DML events and does not factor in
+          timing constraints.
         </para>
 
         <para>
@@ -2094,8 +2173,8 @@
 
       <listitem>
         <para>
-          Do the limitations described above affect MySQL's ability to
-          do point-in-time recovery?
+          Do the preceding limitations affect MySQL's ability to do
+          point-in-time recovery?
         </para>
 
         <para>
@@ -2151,12 +2230,12 @@
 
         <para>
           Triggers and replication in MySQL &current-series; work the
-          same as in most other database engines in that actions carried
-          out through triggers on a master are not replicated to a slave
+          same as in most other database engines: Actions carried out
+          through triggers on a master are not replicated to a slave
           server. Instead, triggers that exist on tables that reside on
-          a MySQL master server need to be created on the tables that
-          exist on any MySQL slave servers so that the triggers activate
-          on the slaves as well as the master.
+          a MySQL master server need to be created on the corresponding
+          tables on any MySQL slave servers so that the triggers
+          activate on the slaves as well as the master.
         </para>
       </listitem>
 
@@ -2207,8 +2286,7 @@
       <listitem>
         <para>
           The replication slave picks up the <literal>INSERT</literal>
-          statement to <literal>EMP</literal> and executes it on the
-          slave.
+          statement to <literal>EMP</literal> and executes it.
         </para>
       </listitem>
 

Modified: trunk/refman-5.1/database-administration.xml
===================================================================
--- trunk/refman-5.1/database-administration.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.1/database-administration.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -6514,7 +6514,12 @@
             </para>
 
             <para>
-              This is <literal>ON</literal> if you have started
+              If <literal>ON</literal>, the server flushes all changes
+              to disk after each SQL statement. Normally MySQL does a
+              write of all changes to disk only after each SQL statement
+              and lets the operating system handle the synching to disk.
+              See <xref linkend="crashing"/>. This variable is set to
+              <literal>ON</literal> if you start
               <command>mysqld</command> with the
               <option>--flush</option> option.
             </para>
@@ -8839,6 +8844,20 @@
               The default transaction isolation level. Defaults to
               <literal>REPEATABLE-READ</literal>.
             </para>
+
+            <para>
+              This variable is set by the <literal>SET TRANSACTION
+              ISOLATION LEVEL</literal> statement. See
+              <xref linkend="set-transaction"/>. If you set
+              <literal>tx_isolation</literal> level directly to an
+              isolation level name that contains a space, the name
+              should be enclosed within quotes, with the space replaced
+              by a dash. For example:
+            </para>
+
+<programlisting>
+SET tx_isolation = 'READ-COMMITTED';
+</programlisting>
           </listitem>
 
           <listitem>

Modified: trunk/refman-5.1/functions.xml
===================================================================
--- trunk/refman-5.1/functions.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.1/functions.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -1556,6 +1556,18 @@
           string. If used in a numeric context, then the result is
           returned as a decimal, real, or integer value.
         </para>
+
+        <para>
+          <emphasis role="bold">Note</emphasis>: The syntax of the
+          <literal>CASE</literal> <emphasis>expression</emphasis> shown
+          here differs slightly from that of the SQL
+          <literal>CASE</literal> <emphasis>statement</emphasis>
+          described in <xref linkend="case-statement"/>, for use inside
+          stored routines. . The <literal>CASE</literal> statement
+          cannot have an <literal>ELSE NULL</literal> clause, and it is
+          terminated with <literal>END CASE</literal> instead of
+          <literal>END</literal>.
+        </para>
       </listitem>
 
       <listitem>
@@ -1673,6 +1685,14 @@
           <replaceable>expr3</replaceable> are both strings, the result
           is case sensitive if either string is case sensitive.
         </para>
+
+        <para>
+          <emphasis role="bold">Note</emphasis>: There is also an
+          <literal>IF</literal> <emphasis>statement</emphasis>, which
+          differs from the <literal>IF()</literal>
+          <emphasis>function</emphasis> described here. See
+          <xref linkend="if-statement"/>.
+        </para>
       </listitem>
 
       <listitem>
@@ -5530,8 +5550,8 @@
             Returns a random floating-point value
             <replaceable>v</replaceable> between <literal>0</literal>
             and <literal>1</literal> inclusive (that is, in the range
-            <literal>0</literal> &lt;= <replaceable>v</replaceable> &lt;=
-            <literal>1.0</literal>). If an integer argument
+            <literal>0</literal> &lt;= <replaceable>v</replaceable>
+            &lt;= <literal>1.0</literal>). If an integer argument
             <replaceable>N</replaceable> is specified, it is used as the
             seed value, which produces a repeatable sequence.
           </para>
@@ -11449,7 +11469,7 @@
           root element.
         </para>
       </listitem>
-      
+
       <listitem>
         <para>
           Multiple locators may be matched using the
@@ -11482,7 +11502,7 @@
           element <literal>&lt;b c="x" d="y"/&gt;</literal> occurring
           anywhere in a given XML fragment.
         </para>
-        
+
         <para>
           To find elements for which the same attribute matches one of
           several values, you must use multiple locators joined by the
@@ -11490,7 +11510,7 @@
           <replaceable>b</replaceable> elements whose
           <replaceable>c</replaceable> attributes have either of the
           values 23 or 17, use the expression
-          <literal>//b[@c="23"]|b[@c="17"]</literal>.          
+          <literal>//b[@c="23"]|b[@c="17"]</literal>.
         </para>
       </listitem>
 
@@ -11502,8 +11522,8 @@
       <ulink url="http://www.w3.org/TR/xpath">XML Path Language (XPath)
       1.0 standard</ulink> for definitive information. A useful resource
       for those new to XPath or who are wishing a refresher in the
-      basics is the 
-      <ulink url="http://www.zvon.org/xxl/XPathTutorial/">Zvon.org XPath 
+      basics is the
+      <ulink url="http://www.zvon.org/xxl/XPathTutorial/">Zvon.org XPath
       Tutorial</ulink>, which is available in several languages.
     </para>
 
@@ -11523,10 +11543,10 @@
           where <replaceable>const</replaceable> is a constant value,
           are currently possible. Note that equality and inequality
           (<literal>=</literal> and (<literal>!=</literal>)) are the
-          only supported comparison operators. 
+          only supported comparison operators.
         </para>
       </listitem>
-      
+
       <listitem>
         <para>
           Relative locator expressions are not supported. XPath
@@ -11534,7 +11554,7 @@
           <literal>//</literal>.
         </para>
       </listitem>
-      
+
       <listitem>
         <para>
           The <literal>::</literal> operator is not supported.

Modified: trunk/refman-5.1/innodb.xml
===================================================================
--- trunk/refman-5.1/innodb.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.1/innodb.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -5744,8 +5744,8 @@
       <para>
         (In the preceding query, we are <quote>fooling</quote> the SQL
         optimizer into scanning the clustered index, rather than a
-        secondary index.) Most disks can read 10 to 50MB/s, which can
-        be used to estimate how fast a table scan should run.
+        secondary index.) Most disks can read 10 to 50MB/s, which can be
+        used to estimate how fast a table scan should run.
       </para>
 
       <para>

Modified: trunk/refman-5.1/ndbcluster.xml
===================================================================
--- trunk/refman-5.1/ndbcluster.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.1/ndbcluster.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -668,10 +668,9 @@
           For our sample data, we will use the <literal>world</literal>
           database which is available for download from the MySQL AB Web
           site. As this database takes up a relatively small amount of
-          space, we assume that each machine has 256MB RAM, which
-          should be sufficient for running the operating system, host
-          NDB process, and (for the data nodes) for storing the
-          database.
+          space, we assume that each machine has 256MB RAM, which should
+          be sufficient for running the operating system, host NDB
+          process, and (for the data nodes) for storing the database.
         </para>
       </listitem>
 

Modified: trunk/refman-5.1/replication.xml
===================================================================
--- trunk/refman-5.1/replication.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.1/replication.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -4304,7 +4304,7 @@
 
       <listitem>
         <para>
-          Statements that use a UDF (user defined function) which is
+          Statements that use a UDF (user-defined function) which is
           non-deterministic (value depends on other things than the
           given parameters) cannot be replicated properly.
         </para>

Modified: trunk/refman-5.1/restrictions.xml
===================================================================
--- trunk/refman-5.1/restrictions.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.1/restrictions.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -234,6 +234,14 @@
       performed by other threads.
     </para>
 
+    <para>
+      <literal>UNDO</literal> handlers are not supported.
+    </para>
+
+    <para>
+      <literal>FOR</literal> loops are not supported.
+    </para>
+
   </section>
 
   <section id="cursor-restrictions">

Modified: trunk/refman-5.1/stored-procedures.xml
===================================================================
--- trunk/refman-5.1/stored-procedures.xml	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-5.1/stored-procedures.xml	2006-01-17 21:43:25 UTC (rev 880)
@@ -25,7 +25,7 @@
   <remark role="help-category" condition="Stored Routines"/>
 
   <para>
-    Stored procedures and functions are supported in MySQL version
+    Stored routines (procedures and functions) are supported in MySQL
     &current-series;. A stored procedure is a set of SQL statements that
     can be stored in the server. Once this has been done, clients don't
     need to keep reissuing the individual statements but can refer to
@@ -33,7 +33,7 @@
   </para>
 
   <para>
-    Some situations where stored procedures can be particularly useful:
+    Some situations where stored routines can be particularly useful:
   </para>
 
   <itemizedlist>
@@ -49,45 +49,45 @@
     <listitem>
       <para>
         When security is paramount. Banks, for example, use stored
-        procedures for all common operations. This provides a consistent
-        and secure environment, and procedures can ensure that each
-        operation is properly logged. In such a setup, applications and
-        users would not get any access to the database tables directly,
-        but can only execute specific stored procedures.
+        procedures and functions for all common operations. This
+        provides a consistent and secure environment, and routines can
+        ensure that each operation is properly logged. In such a setup,
+        applications and users would have no access to the database
+        tables directly, but can only execute specific stored routines.
       </para>
     </listitem>
 
   </itemizedlist>
 
   <para>
-    Stored procedures can provide improved performance because less
+    Stored routines can provide improved performance because less
     information needs to be sent between the server and the client. The
     tradeoff is that this does increase the load on the database server
-    system because more of the work is done on the server side and less
-    is done on the client (application) side. Consider this if many
-    client machines (such as Web servers) are serviced by only one or a
-    few database servers.
+    because more of the work is done on the server side and less is done
+    on the client (application) side. Consider this if many client
+    machines (such as Web servers) are serviced by only one or a few
+    database servers.
   </para>
 
   <para>
-    Stored procedures also allow you to have libraries of functions in
-    the database server. This is a feature shared by modern application
-    languages that allow such design internally, for example, by using
-    classes. Using these client application language features is
+    Stored routines also allow you to have libraries of functions in the
+    database server. This is a feature shared by modern application
+    languages that allow such design internally (for example, by using
+    classes). Using these client application language features is
     beneficial for the programmer even outside the scope of database
     use.
   </para>
 
   <para>
-    MySQL follows the SQL:2003 syntax for stored procedures, which is
-    also used by IBM's DB2.
+    MySQL follows the SQL:2003 syntax for stored routines, which is also
+    used by IBM's DB2.
   </para>
 
   <para>
-    The MySQL implementation of stored procedures is still in progress.
+    The MySQL implementation of stored routines is still in progress.
     All syntax described in this chapter is supported and any
     limitations and extensions are documented where appropriate. Further
-    discussion of restrictions on use of stored procedures is given in
+    discussion of restrictions on use of stored routines is given in
     <xref linkend="restrictions"/>.
   </para>
 
@@ -101,7 +101,7 @@
     <title>&title-stored-procedure-privileges;</title>
 
     <para>
-      Stored procedures require the <literal>proc</literal> table in the
+      Stored routines require the <literal>proc</literal> table in the
       <literal>mysql</literal> database. This table is created during
       the MySQL &current-series; installation procedure. If you are
       upgrading to MySQL &current-series; from an earlier version, be
@@ -118,8 +118,8 @@
     </para>
 
     <para>
-      In MySQL &current-series;, the grant system takes stored routines
-      into account as follows:
+      The MySQL grant system takes stored routines into account as
+      follows:
     </para>
 
     <itemizedlist>
@@ -145,7 +145,7 @@
           execute stored routines. However, this privilege is granted
           automatically to the creator of a routine. Also, the default
           <literal>SQL SECURITY</literal> characteristic for a routine
-          is <literal>DEFINER</literal>, which allows users who have
+          is <literal>DEFINER</literal>, which enables users who have
           access to the database with which the routine is associated to
           execute the routine.
         </para>
@@ -160,21 +160,19 @@
     <title>&title-stored-procedure-syntax;</title>
 
     <para>
-      Stored procedures and functions are routines that are created with
-      <literal>CREATE PROCEDURE</literal> and <literal>CREATE
-      FUNCTION</literal> statements. A routine is either a procedure or
-      a function. A procedure is invoked using a <literal>CALL</literal>
-      statement, and can only pass back values using output variables. A
-      function can be called from inside a statement just like any other
-      function (that is, by invoking the function's name), and can
-      return a scalar value. Stored routines may call other stored
-      routines.
+      A stored routine is either a procedure or a function. Stored
+      routines are created with <literal>CREATE PROCEDURE</literal> and
+      <literal>CREATE FUNCTION</literal> statements. A procedure is
+      invoked using a <literal>CALL</literal> statement, and can only
+      pass back values using output variables. A function can be called
+      from inside a statement just like any other function (that is, by
+      invoking the function's name), and can return a scalar value.
+      Stored routines may call other stored routines.
     </para>
 
     <para>
-      In MySQL &current-series;, a stored procedure or function is
-      associated with a particular database. This has several
-      implications:
+      A stored procedure or function is associated with a particular
+      database. This has several implications:
     </para>
 
     <itemizedlist>
@@ -218,11 +216,16 @@
       result sets, so the client must use a MySQL client library that
       supports multiple result sets. This means the client must use a
       client library from a version of MySQL at least as recent as 4.1.
+      The client should also specify the
+      <literal>CLIENT_MULTI_STATEMENTS</literal> option when it
+      connects. For C programs, this can be done with the
+      <literal>mysql_real_connect()</literal> C API function (see
+      <xref linkend="mysql-real-connect"/>).
     </para>
 
     <para>
       The following sections describe the syntax used to create, alter,
-      drop, and query stored procedures and functions.
+      drop, and invoke stored procedures and functions.
     </para>
 
     <section id="create-procedure">
@@ -278,14 +281,13 @@
       <remark role="help-description-begin"/>
 
       <para>
-        These statements create stored routines. To create a routine in
-        MySQL &current-series;, it is necessary to have the
-        <literal>CREATE ROUTINE</literal> privilege, and the
-        <literal>ALTER ROUTINE</literal> and <literal>EXECUTE</literal>
-        privileges are granted automatically to its creator. If binary
-        logging is enabled, you may also need the
-        <literal>SUPER</literal> privilege, as described in
-        <xref linkend="stored-procedure-logging"/>.
+        These statements create stored routines. To use them, it is
+        necessary to have the <literal>CREATE ROUTINE</literal>
+        privilege. If binary logging is enabled, these statements might
+        may also require the <literal>SUPER</literal> privilege, as
+        described in <xref linkend="stored-procedure-logging"/>. MySQL
+        automatically grants the <literal>ALTER ROUTINE</literal> and
+        <literal>EXECUTE</literal> privileges to the routine creator.
       </para>
 
       <para>
@@ -297,12 +299,12 @@
 
       <para>
         If the routine name is the same as the name of a built-in SQL
-        function, you need to use a space between the name and the
+        function, you must use a space between the name and the
         following parenthesis when defining the routine, or a syntax
         error occurs. This is also true when you invoke the routine
-        later. For this reason &mdash; even though it is possible to do
-        so &mdash; we suggest that it is better to avoid re-using the
-        names of existing SQL functions for your own stored routines.
+        later. For this reason, we suggest that it is better to avoid
+        re-using the names of existing SQL functions for your own stored
+        routines.
       </para>
 
       <para>
@@ -324,10 +326,16 @@
       </para>
 
       <para>
+        Each parameter can be declared to use any valid data type,
+        except that the <literal>COLLATE</literal> attribute cannot be
+        used.
+      </para>
+
+      <para>
         The <literal>RETURNS</literal> clause may be specified only for
-        a <literal>FUNCTION</literal>, for which it is mandatory. It is
-        used to indicate the return type of the function, and the
-        function body must contain a <literal>RETURN
+        a <literal>FUNCTION</literal>, for which it is mandatory. It
+        indicates the return type of the function, and the function body
+        must contain a <literal>RETURN
         <replaceable>value</replaceable></literal> statement.
       </para>
 
@@ -349,8 +357,8 @@
 
       <para>
         The <literal>CREATE FUNCTION</literal> statement was used in
-        earlier versions of MySQL to support UDFs (User Defined
-        Functions). See <xref linkend="adding-functions"/>. UDFs
+        earlier versions of MySQL to support UDFs (user-defined
+        functions). See <xref linkend="adding-functions"/>. UDFs
         continue to be supported, even with the existence of stored
         functions. A UDF can be regarded as an external stored function.
         However, do note that stored functions share their namespace
@@ -375,8 +383,8 @@
         result for the same input parameters, and <quote>not
         deterministic</quote> otherwise. If neither
         <literal>DETERMINISTIC</literal> nor <literal>NOT
-        DETERMINISTIC</literal> is given, the default is <literal>NOT
-        DETERMINISTIC</literal>.
+        DETERMINISTIC</literal> is given in the routine definition, the
+        default is <literal>NOT DETERMINISTIC</literal>.
       </para>
 
       <para>
@@ -394,8 +402,8 @@
       <para>
         Currently, the <literal>DETERMINISTIC</literal> characteristic
         is accepted, but not yet used by the optimizer. However, if
-        binary logging is enabled, this characteristic affects whether
-        MySQL accepts routine definitions. See
+        binary logging is enabled, this characteristic affects which
+        routine definitions MySQL accepts. See
         <xref linkend="stored-procedure-logging"/>.
       </para>
 
@@ -420,10 +428,10 @@
         invokes it. The default value is <literal>DEFINER</literal>.
         This feature is new in SQL:2003. The creator or invoker must
         have permission to access the database with which the routine is
-        associated. In MySQL &current-series;, it is necessary to have
-        the <literal>EXECUTE</literal> privilege to be able to execute
-        the routine. The user that must have this privilege is either
-        the definer or invoker, depending on how the <literal>SQL
+        associated. It is necessary to have the
+        <literal>EXECUTE</literal> privilege to be able to execute the
+        routine. The user that must have this privilege is either the
+        definer or invoker, depending on how the <literal>SQL
         SECURITY</literal> characteristic is set.
       </para>
 
@@ -434,6 +442,13 @@
       </para>
 
       <para>
+        When the routine is invoked, an implicit <literal>USE
+        <replaceable>db_name</replaceable></literal> is performed (and
+        undone when the routine terminates). <literal>USE</literal>
+        statements within stored routines are disallowed.
+      </para>
+
+      <para>
         The server uses the data type of a routine parameter or function
         return value as follows. These rules also apply to local routine
         variables created with the <literal>DECLARE</literal> statement
@@ -474,8 +489,8 @@
 
       <para>
         The <literal>COMMENT</literal> clause is a MySQL extension, and
-        may be used to describe the stored procedure. This information
-        is displayed by the <literal>SHOW CREATE PROCEDURE</literal> and
+        may be used to describe the stored routine. This information is
+        displayed by the <literal>SHOW CREATE PROCEDURE</literal> and
         <literal>SHOW CREATE FUNCTION</literal> statements.
       </para>
 
@@ -532,7 +547,7 @@
 mysql&gt; <userinput>CREATE PROCEDURE simpleproc (OUT param1 INT)</userinput>
     -&gt; <userinput>BEGIN</userinput>
     -&gt;   <userinput>SELECT COUNT(*) INTO param1 FROM t;</userinput>
-    -&gt; <userinput>END</userinput>
+    -&gt; <userinput>END;</userinput>
     -&gt; <userinput>//</userinput>
 Query OK, 0 rows affected (0.00 sec)
 
@@ -562,19 +577,16 @@
       <para>
         The following is an example of a function that takes a
         parameter, performs an operation using an SQL function, and
-        returns the result:
+        returns the result. In this case, it is unnecessary to use
+        <literal>delimiter</literal> because the function definition
+        contains no internal <literal>;</literal> statement delimiters:
       </para>
 
 <programlisting>
-mysql&gt; <userinput>delimiter //</userinput>
-
 mysql&gt; <userinput>CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)</userinput>
     -&gt; <userinput>RETURN CONCAT('Hello, ',s,'!');</userinput>
-    -&gt; <userinput>//</userinput>
 Query OK, 0 rows affected (0.00 sec)
 
-mysql&gt; <userinput>delimiter ;</userinput>
-
 mysql&gt; <userinput>SELECT hello('world');</userinput>
 +----------------+
 | hello('world') |
@@ -585,15 +597,16 @@
 </programlisting>
 
       <para>
-        If the <literal>RETURN</literal> statement in a stored function
-        returns a value that has a different type than is specified in
-        the function's <literal>RETURNS</literal> clause, the return
-        value is coerced to the proper type. For example, if a function
-        returns an <literal>ENUM</literal> or <literal>SET</literal>
-        value, but the <literal>RETURN</literal> statement returns an
-        integer, the value returned from the function is the string for
-        the corresponding <literal>ENUM</literal> member of set of
-        <literal>SET</literal> members.
+        A stored function returns a value of the data type specified in
+        its <literal>RETURNS</literal> clause. If the
+        <literal>RETURN</literal> statement returns a value of a
+        different type, the value is coerced to the proper type. For
+        example, if a function returns an <literal>ENUM</literal> or
+        <literal>SET</literal> value, but the <literal>RETURN</literal>
+        statement returns an integer, the value returned from the
+        function is the string for the corresponding
+        <literal>ENUM</literal> member of set of <literal>SET</literal>
+        members.
       </para>
 
     </section>
@@ -635,10 +648,10 @@
 
       <para>
         This statement can be used to change the characteristics of a
-        stored procedure or function. In MySQL &current-series;, you
-        must have the <literal>ALTER ROUTINE</literal> privilege for the
-        routine. This privilege is granted automatically to the routine
-        creator. If binary logging is enabled, you may also need the
+        stored procedure or function. You must have the <literal>ALTER
+        ROUTINE</literal> privilege for the routine. (That privilege is
+        granted automatically to the routine creator.) If binary logging
+        is enabled, this statement might also require the
         <literal>SUPER</literal> privilege, as described in
         <xref linkend="stored-procedure-logging"/>.
       </para>
@@ -681,10 +694,10 @@
 
       <para>
         This statement is used to drop a stored procedure or function.
-        That is, the specified routine is removed from the server. In
-        MySQL &current-series;, you must have the <literal>ALTER
-        ROUTINE</literal> privilege for the routine. This privilege is
-        granted automatically to the routine creator.
+        That is, the specified routine is removed from the server. You
+        must have the <literal>ALTER ROUTINE</literal> privilege for the
+        routine. (That privilege is granted automatically to the routine
+        creator.)
       </para>
 
       <para>
@@ -875,41 +888,49 @@
       <remark role="help-description-begin"/>
 
       <para>
-        Stored routines may contain multiple statements, using a
-        <literal>BEGIN ... END</literal> compound statement.
+        <literal>BEGIN &hellip; END</literal> syntax is used for writing
+        compound statements, which can appear within stored routines and
+        triggers. A compound statement can contain multiple statements,
+        enclosed by the <literal>BEGIN</literal> and
+        <literal>END</literal> keywords.
         <replaceable>statement_list</replaceable> represents a list of
         one or more statements. Each statement within
         <replaceable>statement_list</replaceable> must be terminated by
-        a semicolon character (<literal>;</literal>).
+        a semicolon (<literal>;</literal>) statement delimiter. Note
+        that <replaceable>statement_list</replaceable> is optional,
+        which means that the empty compound statement (<literal>BEGIN
+        END</literal>) is legal.
       </para>
 
       <para>
+        Use of multiple statements requires that a client is able to
+        send statement strings containing the <literal>;</literal>
+        statement delimiter. This is handled in the
+        <command>mysql</command> command-line client with the
+        <literal>delimiter</literal> command. Changing the
+        <literal>;</literal> end-of-statement delimiter (for example, to
+        <literal>//</literal>) allows <literal>;</literal> to be used in
+        a routine body. For an example, see
+        <xref linkend="create-procedure"/>.
+      </para>
+
+      <para>
         A compound statement can be labeled.
         <replaceable>end_label</replaceable> cannot be given unless
-        <replaceable>begin_label</replaceable> also is present, and if
-        both are present, they must be the same.
+        <replaceable>begin_label</replaceable> also is present. If both
+        are present, they must be the same.
       </para>
 
       <remark role="help-description-end"/>
 
       <para>
-        Please note that the optional <literal>[NOT] ATOMIC</literal>
-        clause is not yet supported. This means that no transactional
-        savepoint is set at the start of the instruction block and the
+        The optional <literal>[NOT] ATOMIC</literal> clause is not yet
+        supported. This means that no transactional savepoint is set at
+        the start of the instruction block and the
         <literal>BEGIN</literal> clause used in this context has no
         effect on the current transaction.
       </para>
 
-      <para>
-        Using multiple statements requires that a client is able to send
-        query strings containing the <literal>;</literal> statement
-        delimiter. This is handled in the <command>mysql</command>
-        command-line client with the <literal>delimiter</literal>
-        command. Changing the <literal>;</literal> end-of-query
-        delimiter (for example, to <literal>//</literal>) allows
-        <literal>;</literal> to be used in a routine body.
-      </para>
-
     </section>
 
     <section id="declare">
@@ -922,24 +943,48 @@
 
       <para>
         The <literal>DECLARE</literal> statement is used to define
-        various items local to a routine: local variables (see
-        <xref linkend="variables-in-stored-procedures"/>), conditions
-        and handlers (see <xref linkend="conditions-and-handlers"/>) and
-        cursors (see <xref linkend="cursors"/>).
-        <literal>SIGNAL</literal> and <literal>RESIGNAL</literal>
+        various items local to a routine:
+      </para>
+
+      <itemizedlist>
+
+        <listitem>
+          <para>
+            Local variables. See
+            <xref linkend="variables-in-stored-procedures"/>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            Conditions and handlers. See
+            <xref linkend="conditions-and-handlers"/>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            Cursors. See <xref linkend="cursors"/>.
+          </para>
+        </listitem>
+
+      </itemizedlist>
+
+      <para>
+        The <literal>SIGNAL</literal> and <literal>RESIGNAL</literal>
         statements are not currently supported.
       </para>
 
       <para>
-        <literal>DECLARE</literal> may be used only inside a
-        <literal>BEGIN ... END</literal> compound statement and must be
-        at its start, before any other statements.
+        <literal>DECLARE</literal> is allowed only inside a
+        <literal>BEGIN &hellip; END</literal> compound statement and
+        must be at its start, before any other statements.
       </para>
 
       <para>
-        Cursors must be declared before declaring handlers, and
-        variables and conditions must be declared before declaring
-        either cursors or handlers.
+        Declarations must follow a certain order. Cursors must be
+        declared before declaring handlers, and variables and conditions
+        must be declared before declaring either cursors or handlers.
       </para>
 
     </section>
@@ -986,10 +1031,11 @@
         </para>
 
         <para>
-          The scope of a local variable is within the <literal>BEGIN ...
-          END</literal> block where it is declared. It can be used in
-          nested blocks except those that declare a variable with the
-          same name.
+          The scope of a local variable is within the <literal>BEGIN
+          &hellip; END</literal> block where it is declared. The
+          variable can be referred to in blocks nested within the
+          declaring block, except those blocks that declare a variable
+          with the same name.
         </para>
 
         <remark role="help-description-end"/>
@@ -1019,21 +1065,22 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The <literal>SET</literal> statement in stored procedures is
-          an extended version of the general <literal>SET</literal>
+          The <literal>SET</literal> statement in stored routines is an
+          extended version of the general <literal>SET</literal>
           statement. Referenced variables may be ones declared inside a
           routine, or global server variables.
         </para>
 
         <para>
-          The <literal>SET</literal> statement in stored procedures is
+          The <literal>SET</literal> statement in stored routines is
           implemented as part of the pre-existing <literal>SET</literal>
           syntax. This allows an extended syntax of <literal>SET a=x,
-          b=y, ...</literal> where different variable types (locally
-          declared variables and global and session server variables)
-          can be mixed. This also allows combinations of local variables
-          and some options that make sense only for system variables; in
-          that case, the options are recognized but ignored.
+          b=y, &hellip;</literal> where different variable types
+          (locally declared variables and global and session server
+          variables) can be mixed. This also allows combinations of
+          local variables and some options that make sense only for
+          system variables; in that case, the options are recognized but
+          ignored.
         </para>
 
         <remark role="help-description-end"/>
@@ -1077,15 +1124,14 @@
 </programlisting>
 
         <para>
-          Note that user variable names are <emphasis>not</emphasis>
-          case sensitive in MySQL &current-series;. See
+          User variable names are not case sensitive. See
           <xref linkend="variables"/>.
         </para>
 
         <para>
           <emphasis role="bold">Important</emphasis>: SQL variable names
           should not be the same as column names. If an SQL statement,
-          such as a <literal>SELECT ... INTO</literal> statement,
+          such as a <literal>SELECT &hellip; INTO</literal> statement,
           contains a reference to a column and a declared local variable
           with the same name, MySQL currently interprets the reference
           as the name of a variable. For example, in the following
@@ -1110,9 +1156,8 @@
 
         <para>
           When this procedure is called, the <literal>newname</literal>
-          variable will return the value <literal>'bob'</literal>
-          regardless of the value of the <literal>table1.xname</literal>
-          column.
+          variable returns the value <literal>'bob'</literal> regardless
+          of the value of the <literal>table1.xname</literal> column.
         </para>
 
         <para>
@@ -1129,8 +1174,8 @@
 
       <para>
         Certain conditions may require specific handling. These
-        conditions can relate to errors, as well as general flow control
-        inside a routine.
+        conditions can relate to errors, as well as to general flow
+        control inside a routine.
       </para>
 
       <section id="declare-conditions">
@@ -1168,8 +1213,8 @@
         </para>
 
         <para>
-          In addition to SQLSTATE values, MySQL error codes are also
-          supported.
+          A <replaceable>condition_value</replaceable> can be an
+          SQLSTATE value or a MySQL error code.
         </para>
 
         <remark role="help-description-end"/>
@@ -1220,25 +1265,48 @@
           (for example, <literal>SET <replaceable>var_name</replaceable>
           = <replaceable>value</replaceable></literal>), or it can be a
           compound statement written using <literal>BEGIN</literal> and
-          <literal>END</literal>. Compound statement syntax is described
-          in <xref linkend="begin-end"/>.
+          <literal>END</literal> (see <xref linkend="begin-end"/>).
         </para>
 
         <para>
           For a <literal>CONTINUE</literal> handler, execution of the
           current routine continues after execution of the handler
           statement. For an <literal>EXIT</literal> handler, execution
-          terminates for the <literal>BEGIN...END</literal> compound
-          statement in which the handler is declared. (This is true even
-          if the condition occurs in an inner block.) The
+          terminates for the <literal>BEGIN &hellip; END</literal>
+          compound statement in which the handler is declared. (This is
+          true even if the condition occurs in an inner block.) The
           <literal>UNDO</literal> handler type statement is not yet
           supported.
         </para>
 
+        <para>
+          If a condition occurs for which no handler has been declared,
+          the default action is <literal>EXIT</literal>.
+        </para>
+
+        <para>
+          A <replaceable>condition_value</replaceable> can be any of the
+          following values:
+        </para>
+
         <itemizedlist>
 
           <listitem>
             <para>
+              An SQLSTATE value or a MySQL error code.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
+              A condition name previously specified with
+              <literal>DECLARE &hellip; CONDITION</literal>. See
+              <xref linkend="declare-conditions"/>.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
               <literal>SQLWARNING</literal> is shorthand for all
               SQLSTATE codes that begin with <literal>01</literal>.
             </para>
@@ -1261,15 +1329,10 @@
 
         </itemizedlist>
 
-        <para>
-          In addition to SQLSTATE values, MySQL error codes are also
-          supported.
-        </para>
-
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -1307,14 +1370,16 @@
         <remark role="help-example-end"/>
 
         <para>
-          Notice that <literal>@x</literal> is <literal>3</literal>,
-          which shows that MySQL executed to the end of the procedure.
-          If the line <literal>DECLARE CONTINUE HANDLER FOR SQLSTATE
-          '23000' SET @x2 = 1;</literal> had not been present, MySQL
-          would have taken the default (<literal>EXIT</literal>) path
-          after the second <literal>INSERT</literal> failed due to the
-          <literal>PRIMARY KEY</literal> constraint, and <literal>SELECT
-          @x</literal> would have returned <literal>2</literal>.
+          The example associates a handler with SQLSTATE 23000, which
+          occurs for a duplicate-key error. Notice that
+          <literal>@x</literal> is <literal>3</literal>, which shows
+          that MySQL executed to the end of the procedure. If the line
+          <literal>DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2
+          = 1;</literal> had not been present, MySQL would have taken
+          the default path (<literal>EXIT</literal>) after the second
+          <literal>INSERT</literal> failed due to the <literal>PRIMARY
+          KEY</literal> constraint, and <literal>SELECT @x</literal>
+          would have returned <literal>2</literal>.
         </para>
 
         <para>
@@ -1354,7 +1419,7 @@
       </para>
 
       <para>
-        For example:
+        Example:
       </para>
 
 <programlisting>
@@ -1407,8 +1472,8 @@
 
         <para>
           This statement declares a cursor. Multiple cursors may be
-          defined in a routine, but each cursor in a block must have a
-          unique name.
+          declared in a routine, but each cursor in a given block must
+          have a unique name.
         </para>
 
         <para>
@@ -1525,14 +1590,16 @@
       <para>
         The <literal>IF</literal>, <literal>CASE</literal>,
         <literal>LOOP</literal>, <literal>WHILE</literal>,
-        <literal>ITERATE</literal>, and <literal>LEAVE</literal>
-        constructs are fully implemented.
+        <literal>REPLACE</literal> <literal>ITERATE</literal>, and
+        <literal>LEAVE</literal> constructs are fully implemented.
       </para>
 
       <para>
-        These constructs may each contain either a single statement, or
-        a block of statements using the <literal>BEGIN ... END</literal>
-        compound statement. Constructs may be nested.
+        Many of these constructs contain other statements, as indicated
+        by the grammer specifications in the following sections. Such
+        constructs may be nested. For example, an <literal>IF</literal>
+        statement might contain a <literal>WHILE</literal> loop, which
+        itself contains a <literal>CASE</literal> statement.
       </para>
 
       <para>
@@ -1570,15 +1637,17 @@
           evaluates to true, the corresponding SQL statement list is
           executed. If no <replaceable>search_condition</replaceable>
           matches, the statement list in the <literal>ELSE</literal>
-          clause is executed. <replaceable>statement_list</replaceable>
-          can consist of one or more statements.
+          clause is executed. Each
+          <replaceable>statement_list</replaceable> consists of one or
+          more statements.
         </para>
 
         <para>
-          Please note that there is also an <literal>IF()</literal>
-          <emphasis>function</emphasis>, which differs from the
-          <literal>IF</literal> <emphasis>statement</emphasis> described
-          here.. See <xref linkend="control-flow-functions"/>.
+          <emphasis role="bold">Note</emphasis>: There is also an
+          <literal>IF()</literal> <emphasis>function</emphasis>, which
+          differs from the <literal>IF</literal>
+          <emphasis>statement</emphasis> described here. See
+          <xref linkend="control-flow-functions"/>.
         </para>
 
         <remark role="help-description-end"/>
@@ -1626,19 +1695,21 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The <literal>CASE</literal> statement for stored procedures
+          The <literal>CASE</literal> statement for stored routines
           implements a complex conditional construct. If a
           <replaceable>search_condition</replaceable> evaluates to true,
-          the corresponding SQL statement is executed. If no search
-          condition matches, the statement in the
-          <literal>ELSE</literal> clause is executed.
+          the corresponding SQL statement list is executed. If no search
+          condition matches, the statement list in the
+          <literal>ELSE</literal> clause is executed. Each
+          <replaceable>statement_list</replaceable> consists of one or
+          more statements.
         </para>
 
         <para>
-          <emphasis role="bold">Note</emphasis>: The syntax of a
+          <emphasis role="bold">Note</emphasis>: The syntax of the
           <literal>CASE</literal> <emphasis>statement</emphasis> shown
-          here for use inside a stored procedure differs slightly from
-          that of the SQL <literal>CASE</literal>
+          here for use inside stored routines differs slightly from that
+          of the SQL <literal>CASE</literal>
           <emphasis>expression</emphasis> described in
           <xref linkend="control-flow-functions"/>. The
           <literal>CASE</literal> statement cannot have an <literal>ELSE
@@ -1676,16 +1747,16 @@
 
         <para>
           <literal>LOOP</literal> implements a simple loop construct,
-          enabling repeated execution of a particular statement or
-          statements. The statements within the loop are repeated until
-          the loop is exited; usually this is accomplished with a
-          <literal>LEAVE</literal> statement.
+          enabling repeated execution of the statement list, which
+          consists of one or more statements. The statements within the
+          loop are repeated until the loop is exited; usually this is
+          accomplished with a <literal>LEAVE</literal> statement.
         </para>
 
         <para>
           A <literal>LOOP</literal> statement can be labeled.
           <replaceable>end_label</replaceable> cannot be given unless
-          <replaceable>begin_label</replaceable> also is present, and if
+          <replaceable>begin_label</replaceable> also is present. If
           both are present, they must be the same.
         </para>
 
@@ -1717,8 +1788,9 @@
 
         <para>
           This statement is used to exit any labeled flow control
-          construct. It can be used with <literal>BEGIN ...
-          END</literal> or loops.
+          construct. It can be used within <literal>BEGIN &hellip;
+          END</literal> or loop constructs (<literal>LOOP</literal>,
+          <literal>REPEAT</literal>, <literal>WHILE</literal>).
         </para>
 
         <remark role="help-description-end"/>
@@ -1748,7 +1820,7 @@
         <remark role="help-description-begin"/>
 
         <para>
-          <literal>ITERATE</literal> can only appear within
+          <literal>ITERATE</literal> can appear only within
           <literal>LOOP</literal>, <literal>REPEAT</literal>, and
           <literal>WHILE</literal> statements.
           <literal>ITERATE</literal> means <quote>do the loop
@@ -1758,7 +1830,7 @@
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -1809,22 +1881,25 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The statement or statements within a <literal>REPEAT</literal>
-          statement are repeated until the
-          <replaceable>search_condition</replaceable> is true.
+          The statement list within a <literal>REPEAT</literal>
+          statement is repeated until the
+          <replaceable>search_condition</replaceable> is true. Thus, a
+          <literal>REPEAT</literal> always enters the loop at least
+          once. <replaceable>statement_list</replaceable> consists of
+          one or more statements.
         </para>
 
         <para>
           A <literal>REPEAT</literal> statement can be labeled.
           <replaceable>end_label</replaceable> cannot be given unless
-          <replaceable>begin_label</replaceable> also is present, and if
+          <replaceable>begin_label</replaceable> also is present. If
           both are present, they must be the same.
         </para>
 
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -1881,22 +1956,24 @@
         <remark role="help-description-begin"/>
 
         <para>
-          The statement or statements within a <literal>WHILE</literal>
-          statement are repeated as long as the
+          The statement list within a <literal>WHILE</literal> statement
+          is repeated as long as the
           <replaceable>search_condition</replaceable> is true.
+          <replaceable>statement_list</replaceable> consists of one or
+          more statements.
         </para>
 
         <para>
           A <literal>WHILE</literal> statement can be labeled.
           <replaceable>end_label</replaceable> cannot be given unless
-          <replaceable>begin_label</replaceable> also is present, and if
+          <replaceable>begin_label</replaceable> also is present. If
           both are present, they must be the same.
         </para>
 
         <remark role="help-description-end"/>
 
         <para>
-          For example:
+          Example:
         </para>
 
         <remark role="help-example-begin"/>
@@ -1985,7 +2062,7 @@
       <listitem>
         <para>
           Are there special security requirements for using stored
-          procedures, functions and replication together?
+          procedures and functions together with replication?
         </para>
 
         <para>
@@ -2010,7 +2087,7 @@
             <para>
               Alternatively, a DBA can set the
               <literal>log_bin_trust_function_creators</literal> system
-              variable to 1, which will allow anyone with the standard
+              variable to 1, which enables anyone with the standard
               <literal>CREATE ROUTINE</literal> privilege to create
               stored functions.
             </para>
@@ -2029,8 +2106,8 @@
           Non-deterministic (random) or time-based actions embedded in
           stored procedures may not replicate properly. By their very
           nature, randomly produced results are not predictable and
-          cannot be exactly cloned, and therefore, random actions
-          replicated to a slave will not mirror those produced on a
+          cannot be exactly reproduced, and therefore, random actions
+          replicated to a slave will not mirror those performed on a
           master. Note that declaring stored functions to be
           <literal>DETERMINISTIC</literal> or setting the
           <literal>log_bin_trust_function_creators</literal> system
@@ -2040,10 +2117,10 @@
 
         <para>
           In addition, time-based actions cannot be reproduced on a
-          slave as the timing of such actions in a stored procedure is
-          not reproducible through the binary log used for replication
-          as it only records DML events and does not factor in timing
-          constraints.
+          slave because the timing of such actions in a stored procedure
+          is not reproducible through the binary log used for
+          replication. It records only DML events and does not factor in
+          timing constraints.
         </para>
 
         <para>
@@ -2061,8 +2138,8 @@
 
       <listitem>
         <para>
-          Do the limitations described above affect MySQL's ability to
-          do point-in-time recovery?
+          Do the preceding limitations affect MySQL's ability to do
+          point-in-time recovery?
         </para>
 
         <para>
@@ -2077,27 +2154,15 @@
         </para>
 
         <para>
-          A future release of MySQL is expected to feature a choice in
-          how replication should be handled:
+          As of MySQL 5.1.5, you can choose either statement-based
+          replication, or row-based replication. The original
+          replication implement is based on statement-based binary
+          logging. Row-based binary logging resolves the limitations
+          mentioned earlier. For additional information, see
+          <xref linkend="replication-row-based"/>.
         </para>
 
-        <itemizedlist>
-
-          <listitem>
-            <para>
-              Statement-based replication (current implementation).
-            </para>
-          </listitem>
-
-          <listitem>
-            <para>
-              Row-level replication (that will solve all the limitations
-              described earlier).
-            </para>
-          </listitem>
-
 <!-- this hybrid form isn't implemented yet
-        <listitem>
           <para>
             A hybrid form of replication that will utilize a
             <quote>smart</quote> form of both statement-based and
@@ -2105,10 +2170,7 @@
             <quote>know</quote> when it can use statement-level
             replication and when row-level will be required.
           </para>
-        </listitem>
 -->
-
-        </itemizedlist>
       </listitem>
 
       <listitem>
@@ -2118,12 +2180,12 @@
 
         <para>
           Triggers and replication in MySQL &current-series; work the
-          same as in most other database engines in that actions carried
-          out through triggers on a master are not replicated to a slave
+          same as in most other database engines: Actions carried out
+          through triggers on a master are not replicated to a slave
           server. Instead, triggers that exist on tables that reside on
-          a MySQL master server need to be created on the tables that
-          exist on any MySQL slave servers so that the triggers activate
-          on the slaves as well as the master.
+          a MySQL master server need to be created on the corresponding
+          tables on any MySQL slave servers so that the triggers
+          activate on the slaves as well as the master.
         </para>
       </listitem>
 
@@ -2174,8 +2236,7 @@
       <listitem>
         <para>
           The replication slave picks up the <literal>INSERT</literal>
-          statement to <literal>EMP</literal> and executes it on the
-          slave.
+          statement to <literal>EMP</literal> and executes it.
         </para>
       </listitem>
 

Modified: trunk/refman-common/titles.en.ent
===================================================================
--- trunk/refman-common/titles.en.ent	2006-01-17 21:42:45 UTC (rev 879)
+++ trunk/refman-common/titles.en.ent	2006-01-17 21:43:25 UTC (rev 880)
@@ -1559,7 +1559,7 @@
 <!ENTITY title-storage-engines "Storage Engines and Table Types">
 <!ENTITY title-storage-requirements "Data Type Storage Requirements">
 <!ENTITY title-stored-procedure-logging "Binary Logging of Stored Routines and Triggers">
-<!ENTITY title-stored-procedure-privileges "Stored Procedures and the Grant Tables">
+<!ENTITY title-stored-procedure-privileges "Stored Routines and the Grant Tables">
 <!ENTITY title-stored-procedure-replication-faq "Stored Procedures, Functions, Triggers, and Replication: Frequently Asked Questions">
 <!ENTITY title-stored-procedure-syntax "Stored Procedure Syntax">
 <!ENTITY title-stored-procedures "Stored Procedures and Functions">
@@ -1666,7 +1666,7 @@
 <!ENTITY title-using-stack-trace "Using a Stack Trace">
 <!ENTITY title-using-triggers "Using Triggers">
 <!ENTITY title-variables "User-Defined Variables">
-<!ENTITY title-variables-in-stored-procedures "Variables in Stored Procedures">
+<!ENTITY title-variables-in-stored-procedures "Variables in Stored Routines">
 <!ENTITY title-vb-types "How Do I Map Visual Basic Data Types to MySQL Types?">
 <!ENTITY title-verifying-md5-checksum "Verifying the MD5 Checksum">
 <!ENTITY title-verifying-package-integrity "Verifying Package Integrity Using MD5 Checksums or <literal>GnuPG</literal>">

Thread
svn commit - mysqldoc@docsrva: r880 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-commonpaul17 Jan