Author: paul
Date: 2006-03-02 22:21:48 +0100 (Thu, 02 Mar 2006)
New Revision: 1499
Log:
r8333@frost: paul | 2006-03-02 15:20:50 -0600
mysqltest material.
Modified:
trunk/
trunk/mysqltest/mysqltest.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:8311
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:3663
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:8333
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:3663
Modified: trunk/mysqltest/mysqltest.xml
===================================================================
--- trunk/mysqltest/mysqltest.xml 2006-03-02 19:10:39 UTC (rev 1498)
+++ trunk/mysqltest/mysqltest.xml 2006-03-02 21:21:48 UTC (rev 1499)
@@ -107,6 +107,222 @@
</chapter>
+ <chapter id="mysql-test-layout">
+
+ <title>Layout of the <filename>mysql-test</filename>
Directory</title>
+
+ <para>
+ The test suite is located in the <filename>mysql-test</filename>
+ directory. For a source distribution,
+ <filename>mysql-test</filename> is found under the source tree
+ root. For a binary distribution, [might vary? Generally under the
+ MySQL installation directory?]
+ </para>
+
+ <para>
+ The <filename>mysql-test</filename> directory contains the
+ following components:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Programs that are used for running tests:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ The <command>mysql-test-run</command> script that is used
+ to run the test suite (and
+ <command>mysql-test-run.pl</command>, which eventually
+ will replace <command>mysql-test-run</command>).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <command>mysql-stress-test.pl</command> stress-testing
+ script. (MySQL 5.0 and up only)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Note: <command>mysqltest</command> is located elsewhere. For a
+ source distribution, it is in the <filename>client</filename>
+ directory. For a binary distribution, it is in the MySQL
+ <filename>bin</filename> directory.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <filename>t</filename> directory contains test case input
+ files. A test case file might also have option files
+ associated with it.
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ A filename ending with <filename>.test</filename> is a
+ test case file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ A filename of the form
+
<filename><replaceable>test_name</replaceable>-master.opt</filename>
+ provides options to associate with the named test case.
+ <literal>mysql-test-run</literal> [?] restarts the server
+ with the options given in the file before running the test
+ case. Then it restarts the server with default options
+ before running the next test case.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ A filename of the form
+
<filename><replaceable>test_name</replaceable>-slave.opt</filename>
+ provides slave options.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ A filename of the form
+
<filename><replaceable>test_name</replaceable>-im.opt</filename>
+ [is for ...?]
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ [What other <quote>magic</quote> filenames are there?]
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <filename>r</filename> directory contains test case result
+ files:.
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ A filename of the form
+
<filename><replaceable>test_name</replaceable>.result</filename>
+ is the expected result for the named test case. This file
+ corresponds to the test case file
+
<filename>t/<replaceable>test_name</replaceable>.test</filename>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ A filename of the form
+
<filename><replaceable>test_name</replaceable>.reject</filename>
+ contains output for the named test case if the test fails.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <filename>include</filename> directory contains files that
+ are included by test case files using the
+ <literal>source</literal> command.
+ </para>
+
+ <para>
+ If you find that several test case files contain a common
+ section of commands (for example, statements that create a
+ standard set of tables), you can put that section in another
+ file and include it into the test cases that need it by means
+ of a <literal>source
+ <replaceable>file_name</replaceable></literal> command. This
+ enables you to write the code just once rather than in
+ multiple test cases.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <filename>lib</filename> directory contains [What?]
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <filename>std_data</filename> directory contains [What?]
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <filename>var</filename> directory contains [What? various
+ output or temp files?]. This directory cannot be shared by
+ simultaneous test runs.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ A <quote>test case</quote> is a single file. The case might
+ contain multiple individual tests. If any individual test fails,
+ the entire test case is considered to fail. Note that
+ <quote>fail</quote> means <quote>does not produce the expected
+ result.</quote> It does not necessarily mean <quote>executes
+ without error,</quote> because some tests are written precisely to
+ verify that an illegal statement does in fact produce an error. In
+ such an instance, if the statement executes successfully without
+ producing the expected error, that is considered failure of the
+ test.
+ </para>
+
+ <para>
+ The test result consists of the input SQL statements and their
+ output. The <literal>disable_query_log</literal> and
+ <literal>enable_query_log</literal> commands control logging of
+ input statements. The <literal>disable_result_log</literal> and
+ <literal>enable_result_log</literal> commands control logging of
+ statement results. [I believe this includes not just normal
+ results, but also warning or error messages.]
+ </para>
+
+ <para>
+ Previous para isn't quite right. The test result also contains
+ output from input commands like <literal>echo</literal> and
+ <literal>exec</literal> (but not the input commands themselves).
+ This command output also seems to be controlled by the
+ <literal>disable_result_log</literal> and
+ <literal>enable_result_log</literal> commands.
+ </para>
+
+ <para>
+ Result files are sometimes called <quote>protocol files.</quote>
+ </para>
+
+ <para>
+ Result output columns are separated by tab characters. [Is there
+ any way to change the separator?]
+ </para>
+
+ </chapter>
+
<chapter id="test-programs">
<title>MySQL Test Programs</title>
@@ -119,13 +335,38 @@
</remark>
<para>
- This chapter describes the test programs that run test cases,
- <command>mysqltest</command> and
- <command>mysql-tesrt-run</command>. For information about the
- language used for writing test cases, see
- <xref linkend="mysqltest-language"/>.
+ This chapter describes the test programs that run test cases:
</para>
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <command>mysqltest</command> runs individual test cases.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>mysql-test-run</command> uses
+ <command>mysqltest</command> to run a suite of test cases.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <command>mysql-stress-test.pl</command> performs
+ stress-testing of the MySQL server.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ For information about the language used for writing test cases,
+ see <xref linkend="mysqltest-language"/>.
+ </para>
+
<section id="fake-id-for-mysqltest-manpage-section-wrapper">
<title>fake title for mysqltest manpage section wrapper</title>
@@ -176,7 +417,8 @@
<listitem>
<para>
Can send statements to MySQL servers for execution or
- execute shell commands, and test result status.
+ execute shell commands, and test whether the result is
+ as expected.
</para>
</listitem>
@@ -203,13 +445,21 @@
</itemizedlist>
<para>
- Invoke <command>mysqltest</command> like this:
+ By default, <command>mysqltest</command> reads the test case
+ on the standard input. To run <command>mysqltest</command>
+ this way, you normally invoke it like this:
</para>
<programlisting>
shell> <userinput>mysqltest [<replaceable>options</replaceable>]
[<replaceable>db_name</replaceable>] <
<replaceable>test_file</replaceable></userinput>
</programlisting>
+ <para>
+ You can also name the test case with a
+
<option>--test-file=<replaceable>file_name</replaceable></option>
+ option.
+ </para>
+
</refsection>
<refsection id="mysqltest-options">
@@ -1123,7 +1373,7 @@
<refsynopsisdiv>
<cmdsynopsis>
- <command>mysql-test-run
[<replaceable>options</replaceable>]
[<replaceable>test_case</replaceable>]</command>
+ <command>mysql-test-run
[<replaceable>options</replaceable>]
[<replaceable>test_case</replaceable>] ...</command>
</cmdsynopsis>
</refsynopsisdiv>
@@ -1133,7 +1383,17 @@
<para>
<command>mysql-test-run</command> invokes
- <command>mysqltest</command> to run test case.
+ <command>mysqltest</command> to run test cases.
+ <command>mysql-test-run</command> is a shell script, so it
+ does not run on Windows. A replacement script
+ (<command>mysql-test-run.pl</command>) is being developed
+ that is written in Perl and therefore has better
+ cross-platform portability. You can substitute
+ <command>mysql-test-run.pl</command> for
+ <command>mysql-test-run</command> whenever you see the
+ latter in this document, but
+ <command>mysql-test-run.pl</command> should still be
+ considered experimental.
</para>
<para>
@@ -1141,14 +1401,35 @@
</para>
<programlisting>
-shell> <userinput>mysql-test-run
[<replaceable>options</replaceable>]
[<replaceable>test_case</replaceable>]</userinput>
+shell> <userinput>mysql-test-run
[<replaceable>options</replaceable>]
[<replaceable>test_case</replaceable>] ...</userinput>
</programlisting>
<para>
- [Can't the <replaceable>test_case</replaceable> argument be
- repeated?]
+ For each <replaceable>test_case</replaceable> argument,
+ <command>mysql-test-run</command> runs [the test found in
+ the
+
<filename>t/<replaceable>test_case</replaceable>.test</filename>
+ file?] With no <replaceable>test_case</replaceable>
+ arguments, <command>mysql-test-run</command> [does what?
+ Runs all <filename>.test</filename> files in the
+ <filename>t</filename> subdirectory?]
</para>
+ <para>
+ <command>mysql-test-run</command> appears to define some
+ environment variables: <literal>MYSQL_TEST</literal> (path
+ to <command>mysqltest</command> binary?),
+ <literal>MYSQLTEST_VARDIR</literal>, [what else?]
+ </para>
+
+ <para>
+ Some tests rely on certain environment variables being
+ defined. For example, some tests assume that
+ <literal>MYSQL_TEST</literal> is defined, so that
+ <command>mysqltest</command> can invoke itself with
+ <literal>exec $MYSQL_TEST</literal>.
+ </para>
+
</refsection>
<refsection id="mysql-test-run-options">
@@ -1389,6 +1670,13 @@
<listitem>
<para>
+ Make the distinction between <quote>command</quote> and
+ <quote>statement/query</quote>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
Verify the syntax of each command.
</para>
</listitem>
@@ -1410,10 +1698,28 @@
<para>
This chapter describes the test language implemented by
- <command>mysqltest</command>.
+ <command>mysqltest</command>. The language allows input to contain
+ a mix of comments, commands executed by
+ <command>mysqltest</command>, and SQL statements to be sent to a
+ MySQL server for execution. Here is an example of input for
+ <command>mysqltest</command>:
</para>
+<programlisting>
+# this is a comment that is ignored
+-- this is a comment because it does not begin with a command word
+-- echo this is a mysqltest command because it begins with a command word
+select 'this is a SQL statement to be sent to the server';
+echo this is a mysqltest command because it begins with a command word;
+</programlisting>
+
<para>
+ [Define <quote>end of line</quote> as meaning newline. CRLF is
+ allowable as a line terminator as well (the carriage return is
+ ignored), but carriage return by itself is not allowed.
+ </para>
+
+ <para>
<command>mysqltest</command> reads input lines and processes them
as follows:
</para>
@@ -1430,11 +1736,6 @@
<programlisting>
# this is a comment
</programlisting>
-
- <para>
- [It appears that ‘<literal>#</literal>’
comments
- also are allowed at the end of commands?]
- </para>
</listitem>
<listitem>
@@ -1443,32 +1744,42 @@
the first non-whitespace content also is treated as a comment
that extends to the end of the line. However, if the first
word of the comment is a valid <command>mysqltest</command>
- command, the comment is executed. This can be useful for
- writing commands that contain embedded instances of the
- command delimiter. Examples:
+ command, <command>mysqltest</command> executes the line from
+ that word to the end of the line as a comment. This can be
+ useful for writing commands that contain embedded instances of
+ the command delimiter. Examples:
</para>
<programlisting>
--disconnect conn1
--- echo write this text to the result file
+-- echo write this text; it goes to the result file
</programlisting>
</listitem>
<listitem>
<para>
- Other input is taken as a <command>mysqltest</command> command
- or an SQL statement to be sent to the server. If the line
+ Other input is taken as normal command input. The command
+ extends to the next occurrence of the command delimiter, which
+ is semicolon (‘<literal>;</literal>’) by
default.
+ The delimiter can be changed with the
+ <literal>delimiter</literal> command.
+ </para>
+
+ <para>
+ Because the command extends to the delimiter, a line can
+ contain multiple commands, or a command can span multiple
+ lines. If the first line of the delimiter-terminated input
begins with a word that is a <command>mysqltest</command>
command, <command>mysqltest</command> executes it as such.
- Otherwise, <command>mysqltest</command> assumes that the line
+ Otherwise, <command>mysqltest</command> assumes that the input
contains an SQL statement and sends it to the server to be
executed.
</para>
<para>
- These commands or statements are delimited by instances of the
- delimiter. Such input can contain multiple commands per line,
- and a given command can span multiple lines. Consider the
+ Input reading restarts following the delimiter and any
+ following input on the line that contains the delimiter is
+ treated as though it begins on a new line. Consider the
following two input lines:
</para>
@@ -1478,26 +1789,31 @@
</programlisting>
<para>
- Three commands result from that input:
+ Three separate commands result from that input:
</para>
<programlisting>
-select 1;
-select 'hello';
-select 'goodbye';
+select 1
+select 'hello'
+select 'goodbye'
</programlisting>
<para>
- The ability to write multiple-line statements is important for
- long statements such as a <literal>create table</literal>
- statement for a table with many columns. Breaking up the
- statement into multiple lines makes it easier to read.
+ Similarly, ‘<literal>#</literal>’ comments or
+ ‘<literal>--</literal>’ comments can be given
on a
+ command line following a delimiter:
</para>
+<programlisting>
+select 'hello'; # select a string value
+select 'hello'; -- echo some text
+</programlisting>
+
<para>
- The default delimiter is the semicolon character
- (‘<literal>;</literal>’). It can be changed
with
- the <literal>delimiter</literal> command.
+ The ability to write multiple-line statements is useful for
+ making long statements more readable, such as a
+ <literal>create table</literal> statement for a table with
+ many columns.
</para>
</listitem>
@@ -1514,13 +1830,11 @@
</para>
<para>
- [So when do you end a command with a semicolon and when not? Is it
- that if you begin a command with
- ‘<literal>--</literal>’, you don't use a semicolon,
- otherwise you do? Is that the way you get a multiple-line
- <literal>let</literal> value (by not beginning
- <literal>--</literal> and ending with
<literal>;</literal>)? Thus,
- these are equivalent?
+ <command>mysqltest</command> commands can be written either as
+ comments (preceded by ‘<literal>--</literal>’) or
as
+ normal command input (no leading
+ ‘<literal>--</literal>’). Use the command delimiter
+ only in the latter case. Thus, these two lines are equivalent:
</para>
<programlisting>
@@ -1529,12 +1843,30 @@
</programlisting>
<para>
- So, is it like this? A <literal>--</literal> command is terminated
- by a newline, regardless of how many delimiters it contains. A
- command without <literal>--</literal> is terminated by semicolon,
- no matter how many newlines it contains.
+ Note that ‘<literal>--</literal>’ comments and
normal
+ commands have complementary properties with regard to how
+ <command>mysqltest</command> reads them:
</para>
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ A ‘<literal>--</literal>’ comment is terminated
by
+ a newline, regardless of how many delimiters it contains.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ A normal command (without
‘<literal>--</literal>’)
+ is terminated by the delimiter (semicolon), no matter how many
+ newlines it contains.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
<para>
[Ambiguity] Although it is <emphasis>possible</emphasis> to write
a comment that begins with ‘<literal>--</literal>’,
it
@@ -1554,31 +1886,31 @@
should be the same as any keyword that can begin an SQL statement?
Presumably also this means that, should extensions to SQL be
implemented in the future, it's possible that a new keyword could
- be impossible to recognize as such if there is a
- <command>mysqltest</command> command that is the same as the
- keyword.
+ be impossible for <command>mysqltest</command> to recognize as
+ such if that keyword is already used as a
+ <command>mysqltest</command> command.
</para>
<para>
- [The preceding description doesn't exactly provide the whole
- picture. For example, this line contains a server statement and a
- <command>mysqltest</command> command, and it's legal]
+ On a multiple-line command, ‘<literal>#</literal>’
or
+ ‘<literal>--</literal>’ at the beginning of the
second
+ or following lines is not special. Thus, the second and third
+ lines of the following command are not take as comments:
</para>
-<programlisting>
-select 1; --echo hello
-</programlisting>
+ <para>
+ let $a = This is a variable # assignment that sets a variable --
+ to a multiple-line value;
+ </para>
<para>
- [One of the Wiki docs mentions this special case syntax for when a
- single error or SQLSTATE value is expected:
+ Describe quoting and escaping rules. How to include a literal
+ quote? Double it? Escape it? Can you escape a delimiter as "\;"?
+ But then what if the delimiter is multiple characters? (I guess
+ that wouldn't matter. If the first char is not taken as a
+ delimiter beginning, the rest wouldn't be recognized, either.
</para>
-<programlisting>
-!<replaceable>error_num</replaceable>
<replaceable>statement</replaceable>
-!<replaceable>sqlstate_code</replaceable>
<replaceable>statement</replaceable>
-</programlisting>
-
<para>
<command>mysqltest</command> supports the following commands:
</para>
@@ -1717,10 +2049,6 @@
<command>mysqltest</command> says <literal>mysqltest: At line
1: Illegal argument for port: 'h4z'</literal>.
</para>
-
- <para>
- Do not
- </para>
</listitem>
<listitem>
@@ -1981,11 +2309,11 @@
<listitem>
<para>
- <literal>echo
<replaceable>text</replaceable>;</literal>
+ <literal>echo <replaceable>text</replaceable></literal>
</para>
<para>
- Echo the text (up to the delimiter) to the test result.
+ Echo the text to the test result.
</para>
<para>
@@ -2026,14 +2354,14 @@
<listitem>
<para>
- <literal>error {<replaceable>error_num</replaceable> | [,
- {<replaceable>error_num</replaceable> |
- <replaceable>sqlstate_code</replaceable>}] ...</literal>
+ <literal>error <replaceable>error_code</replaceable> [,
+ <replaceable>error_code</replaceable>}] ...</literal>
</para>
<para>
Specify one or more comma-separated error values that the next
- command is expected to return. Each argument can be either a
+ command is expected to return. Each
+ <replaceable>error_code</replaceable> value is either a
MySQL-specific error number or a SQLSTATE value. (These are
the kinds of values returned by the
<literal>mysql_errno()</literal> and
@@ -2053,6 +2381,22 @@
[Wiki has some stuff about non-obvious effects for specifying
error 0 in combination with non-zero error codes]
</para>
+
+ <para>
+ [0 and S00000 are equivalent for specifying <quote>no
+ error</quote>?]
+ </para>
+
+ <para>
+ [--error 0 is the same as saying <quote>no error expected, the
+ statement must succeed</quote>?]
+ </para>
+
+ <para>
+ [Can you use <literal>error</literal> to specify shell status
+ values for testing the value of shell commands
+ (<literal>exec</literal>, <literal>system</literal>)?]
+ </para>
</listitem>
<listitem>
@@ -2159,26 +2503,27 @@
<listitem>
<para>
<literal>let $<replaceable>var_name</replaceable> =
- <replaceable>value</replaceable>;</literal>
+ <replaceable>value</replaceable></literal>
</para>
<para>
- Assign a value to a variable. The value can span multiple
- lines and contain anything except the delimiter.
- <command>mysqltest</command> aborts with an error if the value
- is erroneous.
+ Assign a value to a variable. If the <literal>let</literal>
+ command is specified as a normal command (that is, not
+ beginning with ‘<literal>--</literal>’), the
value
+ contains everything up to the command delimiter, and thus can
+ span multiple lines. <command>mysqltest</command> aborts with
+ an error if the value is erroneous.
</para>
<para>
[The <literal>$</literal> seems to be implied if not present?]
- [I'm not sure I understand how that multiple-line behavior
- works; perhaps this is true only when not using -- to begin
- the line?]
</para>
<para>
[The Wiki says there can be no space between the var name and
- the <literal>=</literal> sign. Really true?]
+ the <literal>=</literal> sign. Is that really true? It also
+ seems that whitespace following the <literal>=</literal> sign
+ is discarded.]
</para>
</listitem>
@@ -2259,7 +2604,7 @@
<literal>replace_column <replaceable>col_num</replaceable>
<replaceable>value</replaceable>
[<replaceable>col_num</replaceable>
- <replaceable>value</replaceable>] ...;</literal>
+ <replaceable>value</replaceable>] ...</literal>
</para>
<para>
@@ -2353,13 +2698,20 @@
corresponding <replaceable>to_val</replaceable>. There can be
more than
<replaceable>from_val</replaceable>/<replaceable>to_val</replaceable>
- pair. Values are literal strings. Arguments can be quoted with
- single quotes or double quotes. [Cannot specify values using
- variables?] To use patterns, use the
- <literal>replace_regex</literal> command.
+ pair. Arguments can be quoted with single quotes or double
+ quotes. [Variable references within the arguments are expanded
+ before replacement occurs?] Values are matched literally. To
+ use patterns, use the <literal>replace_regex</literal>
+ command.
</para>
<para>
+ [This applies both to the line of column names at the
+ beginning of statement output, and to the data lines that
+ follow? (Is that true for other replace_xxx commands?)]
+ </para>
+
+ <para>
[The behavior differs from <literal>replace_regex</literal>.
For example <literal>replace_result a b b c</literal> does not
change a to c. Apparently, result replacement for a column
@@ -2372,6 +2724,13 @@
<literal>require
<replaceable>file_name</replaceable></literal>
</para>
+
+ <para>
+ Compare the result [from the current test?] with the contents
+ of the named file. If the content does not match or there is
+ some other error, the test aborts with an
+ "abort_not_supported_test" error message.
+ </para>
</listitem>
<listitem>
@@ -2384,6 +2743,24 @@
<para>
<literal>result
<replaceable>file_name</replaceable></literal>
</para>
+
+ <para>
+ Compare the result from the current test? with the contents of
+ the named file. If the content does not match or there is some
+ other error, write the result to
+
<filename>r/<replaceable>file_name</replaceable>.reject</filename>.
+ </para>
+
+ <para>
+ [Ask these questions, but base them on the Wiki text, not my
+ rewrite in the previous para.] [So, does that mean
+ <replaceable>file_name</replaceable> is given without the
+ <filename>.result</filename> extension? Is the "current" test
+ the most recent command executed within the test case, or the
+ result of the entire test case up to the
+ <literal>result</literal> command? Is "write the result"
+ actually "write the diff of the expected and actual results"?]
+ </para>
</listitem>
<listitem>
@@ -2398,14 +2775,11 @@
</para>
<para>
- For a master replication server, save the binary log position.
+ For a master replication server, save the current binary log
+ filename and position. These values can be used for subsequent
+ <literal>sync_with_master</literal> or
+ <literal>sync_slave_with_master</literal> commands.
</para>
-
- <para>
- [So ... what can you do with this value later? And besides,
- don't replication coordinates consist of a position
- <emphasis>and</emphasis> filename?]
- </para>
</listitem>
<listitem>
@@ -2432,6 +2806,14 @@
</para>
<para>
+ [Does "manager" mean the Instance Manager? If so, is the
+ connection to the manager made using the parameters specified
+ by the
+
<option>--manager-<replaceable>xxx</replaceable></option>
+ command-line options?]
+ </para>
+
+ <para>
[This command is unavailable for
<command>mysqltest_embedded</command>, the version of
<command>mysqltest</command> built with support for
@@ -2485,7 +2867,7 @@
</para>
<para>
- [Can this be used recursively?]
+ [Can this be used recursively? Max recursion level?]
</para>
</listitem>
@@ -2508,29 +2890,51 @@
</para>
<para>
- This seems to be like executing the following commands:
+ Executing this command is equivalent to executing the
+ following commands:
</para>
<programlisting>
save_master_pos
-connection {<replaceable>connection_name</replaceable> | slave}
+connection <replaceable>connection_name</replaceable>
sync_with_master 0
</programlisting>
+
+ <para>
+ If <replaceable>connection_name</replaceable> is not
+ specified, the connection named <literal>slave</literal> is
+ used.
+ </para>
+
+ <para>
+ The effect is to save the replication coordinates (binary log
+ filename and position) for the server on the current
+ connection (which is assumed to be a master replication
+ server), and then switch to a slave server and wait until it
+ catches up with the saved coordinates. Note that this command
+ implicitly changes the current connection.
+ </para>
</listitem>
<listitem>
<para>
<literal>sync_with_master
- <replaceable>position</replaceable></literal>
+ <replaceable>offset</replaceable></literal>
</para>
<para>
For a slave replication server, wait until it has caught up
- with the given position.
+ with the master. The position to synchronize to is the
+ position saved by the most recent
+ <literal>save_master_pos</literal> command plus
+ <replaceable>offset</replaceable>.
</para>
<para>
- [Position where? In the current binary log file?]
+ To use this command, <literal>save_master_pos</literal> must
+ have been executed at some point earlier in the test case to
+ cause <command>mysqltest</command> to save the master's
+ replication coordinates.
</para>
</listitem>
@@ -2575,9 +2979,10 @@
</para>
<para>
- Poll the slave server with <literal>SHOW STATUS LIKE
- 'Slave_running'</literal> until the result is
- <literal>OFF</literal>.
+ Poll the current connection, which is assumed to be a
+ connection to a slave replication server, by using the
+ <literal>SHOW STATUS LIKE 'Slave_running'</literal> statement
+ until the result is <literal>OFF</literal>.
</para>
</listitem>
@@ -2694,146 +3099,4 @@
</chapter>
- <chapter id="mysql-test-layout">
-
- <title><filename>mysql-test</filename> Directory
Layout</title>
-
- <para>
- The <filename>mysql-test</filename> directory contains the
- following components:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- The <command>mysql-test-run</command> script that is used to
- run the test suite.
- </para>
- </listitem>
-
- <listitem>
- <para>
- The <filename>t</filename> directory contains test case input
- files.
- </para>
-
- <para>
- A filename ending with <filename>.test</filename> is a test
- case file. A filename of the form
-
<filename><replaceable>test_name</replaceable>-master.opt</filename>
- provides options to associate with the named test case.
- <literal>mysql-test-run</literal> [?] restarts the server with
- the options given in the file before running the test case.
- Then it restarts the server with default options before
- running the next test case.
- </para>
-
- <para>
- [What other <quote>magic</quote> filenames are there?]
- </para>
- </listitem>
-
- <listitem>
- <para>
- The <filename>r</filename> directory contains test case result
- files.
- </para>
-
- <para>
- A filename of the form
-
<filename><replaceable>test_name</replaceable>.result</filename>
- is the expected result for the named test case. This file
- corresponds to the test case file
-
<filename>t/<replaceable>test_name</replaceable>.test</filename>..
- A filename of the form
-
<filename><replaceable>test_name</replaceable>.reject</filename>
- contains output for the named test case if the test fails.
- </para>
- </listitem>
-
- <listitem>
- <para>
- The <filename>include</filename> directory contains files that
- are included by test case files using the
- <literal>source</literal> command.
- </para>
-
- <para>
- If you find that several test case files contain a common
- section of commands (for example, statements that create a
- standard set of tables), you can put that section in another
- file and include it into the test cases that need it by means
- of a <literal>source
- <replaceable>file_name</replaceable></literal> command. This
- enables you to write the code just once rather than in
- multiple test cases.
- </para>
- </listitem>
-
- <listitem>
- <para>
- The <filename>lib</filename> directory contains [What?]
- </para>
- </listitem>
-
- <listitem>
- <para>
- The <filename>std_data</filename> directory contains [What?]
- </para>
- </listitem>
-
- <listitem>
- <para>
- The <filename>var</filename> directory contains [What? various
- output or temp files?]. This directory cannot be shared by
- simultaneous test runs.
- </para>
- </listitem>
-
- </itemizedlist>
-
- <para>
- A <quote>test case</quote> is a single file. The case might
- contain multiple individual tests. If any individual test fails,
- the entire test case is considered to fail. Note that
- <quote>fail</quote> means <quote>does not produce the expected
- result.</quote> It does not necessarily mean <quote>executes
- without error,</quote> because some tests are written precisely to
- verify that an illegal statement does in fact produce an error. In
- such an instance, if the statement executes successfully without
- producing the expected error, that is considered failure of the
- test.
- </para>
-
- <para>
- The test result consists of the input SQL statements and their
- output. The <literal>disable_query_log</literal> and
- <literal>enable_query_log</literal> commands control logging of
- input statements. The <literal>disable_result_log</literal> and
- <literal>enable_result_log</literal> commands control logging of
- statement results. [I believe this includes not just normal
- results, but also warning or error messages.]
- </para>
-
- <para>
- Previous para isn't quite right. The test result also contains
- output from input commands like <literal>echo</literal> and
- <literal>exec</literal> (but not the input commands themselves).
- This output also seems to be controlled by the
- <literal>disable_result_log</literal> and
- <literal>enable_result_log</literal> commands.
- </para>
-
- <para>
- Result files are sometimes called <quote>protocol files.</quote>
- </para>
-
- <para>
- Result output columns are separated by tab characters. [Is there
- any way to change the separator?]
- </para>
-
- </chapter>
-
</book>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r1499 - in trunk: . mysqltest | paul | 2 Mar |