Author: paul
Date: 2006-06-09 17:05:37 +0200 (Fri, 09 Jun 2006)
New Revision: 2322
Log:
r11132@frost: paul | 2006-06-09 10:02:23 -0500
mysqltest:
- Additional information about error handling.
- mysql-test-run.pl now supports --, like mysql-test-run.
Modified:
trunk/
trunk/mysqltest/command-reference.xml
trunk/mysqltest/programs.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:10377
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:11117
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:7663
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:10377
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:11132
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:7663
Modified: trunk/mysqltest/command-reference.xml
===================================================================
--- trunk/mysqltest/command-reference.xml 2006-06-09 10:28:24 UTC (rev 2321)
+++ trunk/mysqltest/command-reference.xml 2006-06-09 15:05:37 UTC (rev 2322)
@@ -808,28 +808,112 @@
</programlisting>
<para>
- You use <literal>error</literal> to specify shell status
- values for testing the value of shell commands executed via
- the <literal>exec</literal> command. This does not apply to
- <literal>system</literal>, for which the command status is
- ignored.
+ If a statement fails with an error that has not been specified
+ as expected by means of a <literal>error</literal> command,
+ <command>mysqltest</command> aborts and reports theh error
+ message returned by the MySQL server.
</para>
<para>
- [TODO: Wiki has some stuff about non-obvious effects for
- specifying error 0 in combination with non-zero error codes.
- Need to add that here.]
+ If a statement fails with an error that has been specified as
+ expected by means of a <literal>error</literal> command,
+ <command>mysqltest</command> does not abort. Instead, it
+ continues and writes a message to the result output.
</para>
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ If an <literal>error</literal> command is given with a
+ single error value and the statement fails with that
+ error, <command>mysqltest</command> reports the error
+ message returned by the MySQL server.
+ </para>
+
+ <para>
+ Input:
+ </para>
+
+<programlisting>
+--error S42S02
+drop table t;
+</programlisting>
+
+ <para>
+ <command>mysqltest</command> reports:
+ </para>
+
+<programlisting>
+ERROR 42S02: Unknown table 't'
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ If an <literal>error</literal> command is given with
+ multiple error values and the statement fails with that
+ error, <command>mysqltest</command> reports a generic
+ message. (This is true even if the error values are all
+ the same, a fact that can be used if you want a message
+ that does not contain varying information such as table
+ names.)
+ </para>
+
+ <para>
+ Input:
+ </para>
+
+<programlisting>
+--error S41S01,S42S02
+drop table t;
+</programlisting>
+
+ <para>
+ <command>mysqltest</command> reports:
+ </para>
+
+<programlisting>
+Got one of the listed errors
+</programlisting>
+ </listitem>
+
+ </itemizedlist>
+
<para>
- [Q: <literal>error 0</literal> is the same as saying <quote>no
- error expected, the statement must succeed</quote>?]
+ An error value of 0 or <literal>S00000</literal> means
+ <quote>no error,</quote> so using either for an
+ <literal>error</literal> command is the same as saying
+ explicitly, <quote>no error is expected, the statement must
+ succeed.</quote>.
</para>
+ <remark role="note">
+ [PD] The following behavior was documented in the Wiki, so
+ apparently it is deliberate. I don't understand the intent of
+ the different behavior, though. It seems like a bug to me.
+ </remark>
+
<para>
- [Q: 0 and S00000 are equivalent for specifying <quote>no
- error</quote>?]
+ To indicate that you expect success or a given error or
+ errors, specify 0 or <literal>S00000</literal> first in the
+ error list. If you put the no-error value later in the list,
+ the test will abort if the statement is successful. That is,
+ these two commands have different effects:
</para>
+
+<programlisting>
+--error 0,1051
+--error 1051,0
+</programlisting>
+
+ <para>
+ You can use <literal>error</literal> to specify shell status
+ values for testing the value of shell commands executed via
+ the <literal>exec</literal> command. This does not apply to
+ <literal>system</literal>, for which the command status is
+ ignored.
+ </para>
</listitem>
<listitem>
Modified: trunk/mysqltest/programs.xml
===================================================================
--- trunk/mysqltest/programs.xml 2006-06-09 10:28:24 UTC (rev 2321)
+++ trunk/mysqltest/programs.xml 2006-06-09 15:05:37 UTC (rev 2322)
@@ -1204,8 +1204,10 @@
</para>
<para>
- <command>mysql-test-run.pl</command> supports the following
- options:
+ <command>mysql-test-run.pl</command> supports the options in
+ the following list. An argument of <option>--</option> tells
+ <command>mysql-test-run.pl</command> not to process any
+ following arguments as options.
</para>
<itemizedlist>
@@ -1413,8 +1415,7 @@
<command>mysql-test-run</command> supports the options in the
following list. An argument of <option>--</option> tells
<command>mysql-test-run</command> not to process any following
- arguments as options. [Q: Does <literal>--</literal> also have
- that effect for <command>mysql-test-run.pl</command>?]
+ arguments as options.
</para>
<itemizedlist>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r2322 - in trunk: . mysqltest | paul | 9 Jun |