List:Commits« Previous MessageNext Message »
From:bjorn.munch Date:December 16 2010 11:53am
Subject:svn commit - mysqldoc@docsrva: r24477 - trunk/mysqltest-2.0
View as plain text  
Author: bmunch
Date: 2010-12-16 12:53:02 +0100 (Thu, 16 Dec 2010)
New Revision: 24477

Log:
Updated for 5.5, a few small things that were missing

Modified:
   trunk/mysqltest-2.0/command-reference.xml
   trunk/mysqltest-2.0/introduction.xml
   trunk/mysqltest-2.0/programs.xml
   trunk/mysqltest-2.0/writing-tests.xml


Modified: trunk/mysqltest-2.0/command-reference.xml
===================================================================
--- trunk/mysqltest-2.0/command-reference.xml	2010-12-16 11:09:30 UTC (rev 24476)
+++ trunk/mysqltest-2.0/command-reference.xml	2010-12-16 11:53:02 UTC (rev 24477)
Changed blocks: 6, Lines Added: 64, Lines Deleted: 13; 4655 bytes

@@ -276,15 +276,23 @@
       <literal>"/"</literal> as the directory separator as in Unix. They
       will be automatically converted when needed if the test is run on
       Windows. We also recommend putting all temporary or auxiliary
-      files made during the test under the directories referred to by
-      <filename>$MYSQLTEST_VARDIR</filename> or
-      <filename>$MYSQL_TMP_DIR</filename> (the latter is equivalent to
-      <filename>$MYSQLTEST_VARDIR/tmp</filename>). Do not put them under
-      fixed full paths like <filename>/tmp</filename>. This will help
-      ensuring portability of the test, and avoiding conflicts with
-      other programs.
+      files made during the test under the directory referred to by
+      <filename>$MYSQL_TMP_DIR</filename>. Do not put them under fixed
+      full paths like <filename>/tmp</filename>. This will help ensuring
+      portability of the test, and avoiding conflicts with other
+      programs.
     </para>
 
+    <para>
+      <filename>$MYSQL_TMP_DIR</filename> is equivalent to
+      <filename>$MYSQLTEST_VARDIR/tmp</filename> if you are not running
+      with parallel test threads, but if you run
+      <command>mysql-test-run.pl</command> with
+      <option>--parallel</option>, they will be different. It is
+      therefore best to be consistent and use
+      <filename>$MYSQL_TMP_DIR</filename>.
+    </para>
+
   </section>
 
   <section id="mysqltest-commands">

@@ -1551,6 +1559,15 @@
 </programlisting>
 
         <para>
+          When assigning a literal string to a variable, no quoting is
+          required even if the string contains spaces. If the string
+          does include quotation marks, they will be trated like any
+          other characters and be included in the string value. This is
+          important to be aware of when using the variable in an SQL
+          statement.
+        </para>
+
+        <para>
           The result from executing a query can be assigned to a
           variable by enclosing the query within backtick
           (<quote><literal>`</literal></quote>) characters:

@@ -1997,7 +2014,7 @@
         </para>
 
         <para>
-          <command>remove_files_wildcard</command> was added in MySQL
+          <literal>remove_files_wildcard</literal> was added in MySQL
           5.1.45.
         </para>
 

@@ -2366,9 +2383,10 @@
         </para>
 
 <programlisting>
-if ( 1 != 0 )
+let $v= 0;
+if (!$v)
 {
-  skip One not equal to zero, skipping test;
+  skip value is zero, skipping test;
 }
 echo This command is never reached;
 </programlisting>

@@ -2380,9 +2398,8 @@
 
 <programlisting>
 The test './mytest' is not supported by this installation
-Detected in file ./mytest at line 3
-reason: One not equal to zero, skipping test
-skipped
+Detected in file ./mytest at line 4
+reason: value is zero, skipping test
 </programlisting>
 
         <para>

@@ -2995,6 +3012,40 @@
     </para>
 
     <para>
+      From MySQL 5.5, the expression can also be a simple comparison,
+      where the left hand side must be a variable, and the right hand
+      side can be any type valid for the single expression except the
+      negated variable. The supported operators are
+      <literal>==</literal>, <literal>!=</literal>,
+      <literal>&lt;</literal>, <literal>&lt;=</literal>,
+      <literal>&gt;</literal> and <literal>&gt;=</literal>. Only the
+      first two may be used if the right hand side does not evaluate to
+      an integer. With <literal>==</literal>, strings must match
+      exactly.
+    </para>
+
+    <para>
+      Note that if you use a string on the right hand side of the
+      comparison, it should not be quoted even if it contains spaces. If
+      you do use quotation marks, they will be assumed part of the
+      string, as in <command>let</command> commands. Please be aware
+      that this is the case for the first release of MySQL 5.5 GA
+      (5.5.8); later releases may strip quoting in this context but will
+      not make it mandatory.
+    </para>
+
+    <para>
+      Examples of the expression syntax with comparisons (only the
+      header shown):
+    </para>
+
+<programlisting>
+while ($counter&lt;5) ...
+if ($value == No such row) ...
+if ($slave_count != $master_count) ...
+</programlisting>
+
+    <para>
       The opening <literal>{</literal> (curly brace) must be separated
       from the preceding <literal>)</literal> (right parenthesis) by
       whitespace, such as a space or a line break.


Modified: trunk/mysqltest-2.0/introduction.xml
===================================================================
--- trunk/mysqltest-2.0/introduction.xml	2010-12-16 11:09:30 UTC (rev 24476)
+++ trunk/mysqltest-2.0/introduction.xml	2010-12-16 11:53:02 UTC (rev 24477)
Changed blocks: 3, Lines Added: 15, Lines Deleted: 2; 1784 bytes

@@ -45,6 +45,16 @@
   </para>
 
   <para>
+    Any feature described here as being available from MySQL 5.1.X is
+    also available in any MySQL 5.5 or higher since the official release
+    of 5.5 (version 5.5.8). It may hovever not be available in all
+    pre-GA releases of 5.5 that have been made available for download.
+    Features described as availbale from MySQL 5.5 or 5.5.X are not
+    available in any 5.1 release (unless otherwise stated) and may not
+    be available in pre-GA releases of 5.5.
+  </para>
+
+  <para>
     The application that runs the test suite is named
     <command>mysql-test-run.pl</command>. Its location is the
     <filename>mysql-test</filename> directory, which is present both in

@@ -53,7 +63,7 @@
 
   <para>
     On platforms other than Windows,
-    <command>mysql-test-run.pl</command>is also available thorugh the
+    <command>mysql-test-run.pl</command>is also available through the
     shortened name <command>mtr</command> in the same directory, as
     either a symbolic link or a copy.
   </para>

@@ -191,7 +201,10 @@
     own scripts and initiating them with your own data. Also, a test
     case can execute an external program, so in some respects the test
     framework can be extended for uses other than testing SQL
-    statements.
+    statements. Finally, it is possible to embed small pieces of Perl
+    code within the test; this can sometimes be used to perform actions
+    or execute logic which is beyond the capabilities of the test
+    language or SQL.
   </para>
 
 </chapter>


Modified: trunk/mysqltest-2.0/programs.xml
===================================================================
--- trunk/mysqltest-2.0/programs.xml	2010-12-16 11:09:30 UTC (rev 24476)
+++ trunk/mysqltest-2.0/programs.xml	2010-12-16 11:53:02 UTC (rev 24477)
Changed blocks: 5, Lines Added: 117, Lines Deleted: 1; 5231 bytes

@@ -2008,6 +2008,37 @@
           <para>
             <indexterm>
               <primary>mysql-test-run.pl</primary>
+              <secondary>clean-vardir option</secondary>
+            </indexterm>
+
+            <indexterm>
+              <primary>clean-vardir option</primary>
+              <secondary>mysql-test-run.pl</secondary>
+            </indexterm>
+
+            <option>--clean-vardir</option>
+          </para>
+
+          <para>
+            Clean up the <literal>var</literal> directory with logs and
+            test results etc. after the test run, but only if there were
+            no test failures. This option only has effect if also
+            running with option <option>--mem</option>. The intent is to
+            alleviate the problem of using up memory for test results,
+            in cases where many different test runs are being done on
+            the same host.
+          </para>
+
+          <para>
+            The <option>--clean-vardir</option> option is available from
+            MySQL 5.5.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            <indexterm>
+              <primary>mysql-test-run.pl</primary>
               <secondary>client-bindir option</secondary>
             </indexterm>
 

@@ -2303,7 +2334,7 @@
           </para>
 
           <para>
-            This option was added in MySQL 5.1.41/5.5.0/6.0.6.
+            This option was added in MySQL 5.1.41.
           </para>
         </listitem>
 

@@ -2311,6 +2342,29 @@
           <para>
             <indexterm>
               <primary>mysql-test-run.pl</primary>
+              <secondary>default-myisam option</secondary>
+            </indexterm>
+
+            <indexterm>
+              <primary>default-myisam option</primary>
+              <secondary>mysql-test-run.pl</secondary>
+            </indexterm>
+
+            <option>--default-myisam</option>
+          </para>
+
+          <para>
+            Use MyISAM as default engine for all except InnoDB-specific
+            tests. This option was added in MySQL 5.5 and is on by
+            default. It may be changed to off by default in a later
+            release. See also <option>--nodefault-myisam</option>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            <indexterm>
+              <primary>mysql-test-run.pl</primary>
               <secondary>defaults-file option</secondary>
             </indexterm>
 

@@ -3015,6 +3069,32 @@
           <para>
             <indexterm>
               <primary>mysql-test-run.pl</primary>
+              <secondary>nodefault-myisam option</secondary>
+            </indexterm>
+
+            <indexterm>
+              <primary>nodefault-myisam option</primary>
+              <secondary>mysql-test-run.pl</secondary>
+            </indexterm>
+
+            <option>--nodefault-myisam</option>
+          </para>
+
+          <para>
+            Do not override the build-in default engine to use MyISAM
+            instead for non-InnoDB tests. This option was added in MySQL
+            5.5. Since the existing collection of tests were originally
+            adapted for MyISAM as default, many tests will fail when
+            this option is used, because the test behaves differently or
+            produces different output when the engine switches to
+            InnoDB.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            <indexterm>
+              <primary>mysql-test-run.pl</primary>
               <secondary>noreorder option</secondary>
             </indexterm>
 

@@ -3276,6 +3356,42 @@
           <para>
             <indexterm>
               <primary>mysql-test-run.pl</primary>
+              <secondary>report-times option</secondary>
+            </indexterm>
+
+            <indexterm>
+              <primary>report-times option</primary>
+              <secondary>mysql-test-run.pl</secondary>
+            </indexterm>
+
+            <option>--report-times</option>
+          </para>
+
+          <para>
+            At the end of the test run, write a summary of how much time
+            was spent in various phases of execution. If you run with
+            <option>--parallel</option>, the total will exceed the wall
+            clock time passed, since it will be summed over all threads.
+          </para>
+
+          <para>
+            The times reported should only be treated as approximations,
+            and the exact points where the time is taken may also change
+            between releases. If the test run is aborted, including if a
+            test fails and <option>--force</option> is not in use, the
+            time report will not be produced.
+          </para>
+
+          <para>
+            The <option>--report-times</option> is available from MySQL
+            5.5.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            <indexterm>
+              <primary>mysql-test-run.pl</primary>
               <secondary>retry option</secondary>
             </indexterm>
 


Modified: trunk/mysqltest-2.0/writing-tests.xml
===================================================================
--- trunk/mysqltest-2.0/writing-tests.xml	2010-12-16 11:09:30 UTC (rev 24476)
+++ trunk/mysqltest-2.0/writing-tests.xml	2010-12-16 11:53:02 UTC (rev 24477)
Changed blocks: 3, Lines Added: 41, Lines Deleted: 6; 2871 bytes

@@ -2153,9 +2153,9 @@
       Before you initiate the action that will stop the server, the test
       case should write either <literal>restart</literal> or
       <literal>wait</literal> to the file
-      <literal>$MYSQL_TMP_DIR/mysqld.1.expect</literal>. The easiest way
-      to do this is using the <command>exec echo</command> construct
-      like in the following example.
+      <literal>$MYSQLTEST_VARDIR/tmp/mysqld.1.expect</literal>. The
+      easiest way to do this is using the <command>exec echo</command>
+      construct like in the following example.
     </para>
 
     <para>

@@ -2167,19 +2167,29 @@
     </para>
 
 <programlisting>
---exec echo "wait" > $MYSQL_TMP_DIR/mysqld.1.expect
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --shutdown_server 10
 --source include/wait_until_disconnected.inc
 # Do something while server is down
 --enable_reconnect
---exec echo "restart" > $MYSQL_TMP_DIR/mysqld.1.expect
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --source include/wait_until_connected_again.inc
 </programlisting>
 
     <para>
+      For your convenience, there is a file
+      <filename>include/restart_mysqld.inc</filename> which you can
+      "source" in your own test case to do what's shown in this code
+      example.
+    </para>
+
+    <para>
       The file name to write the command to will be
       <filename>mysqld.2.expect</filename> for the slave server in
-      replication tests.
+      replication tests. Note that you have to use
+      <filename>$MYSQLTEST_VARDIR/tmp</filename> for the directory here;
+      if you use <filename>$MYSQL_TMP_DIR</filename> instead, it will
+      not work when running tests in parallel.
     </para>
 
     <para>

@@ -2321,6 +2331,31 @@
         </para>
       </listitem>
 
+      <listitem>
+        <para>
+          Skipping consistency check or forcing restart after test
+        </para>
+
+        <para>
+          As mentioned before, a test case should leave the server in a
+          "clean" state for the next test. In cases where this is not
+          possible or too costly, the test may in stead ask for the
+          consistency check to be skipped, and the server(s) to be
+          restarted. This is done by this executing this command at any
+          time during the test:
+        </para>
+
+<programlisting>
+call mtr.force_restart();
+</programlisting>
+
+        <para>
+          This signals to <command>mysql-test-run.pl</command> that it
+          should restart the server before the next test, and also skip
+          the consistency check.
+        </para>
+      </listitem>
+
     </itemizedlist>
 
   </section>


Thread
svn commit - mysqldoc@docsrva: r24477 - trunk/mysqltest-2.0bjorn.munch16 Dec