Author: paul
Date: 2006-06-15 22:01:11 +0200 (Thu, 15 Jun 2006)
New Revision: 2396
Log:
r11349@frost: paul | 2006-06-15 14:49:15 -0500
Add more examples.
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:10603
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:11328
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:7663
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:10577
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:11349
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:7663
Modified: trunk/mysqltest/command-reference.xml
===================================================================
--- trunk/mysqltest/command-reference.xml 2006-06-15 14:54:25 UTC (rev 2395)
+++ trunk/mysqltest/command-reference.xml 2006-06-15 20:01:11 UTC (rev 2396)
@@ -1034,10 +1034,6 @@
<literal>eval <replaceable>statement</replaceable></literal>
</para>
- <remark role="todo">
- Examples added to here.
- </remark>
-
<para>
Evaluate the statement by replacing references to variables
within the text with the corresponding values. Then send the
@@ -1052,6 +1048,12 @@
<replaceable>statement</replaceable> is that
<literal>eval</literal> provides variable expansion.
</para>
+
+<programlisting>
+eval use $DB;
+eval change master to master_port=$SLAVE_MYPORT;
+eval prepare stmt1 from "$my_stmt";
+</programlisting>
</listitem>
<listitem>
@@ -1085,6 +1087,12 @@
<literal>exec</literal>. Use <literal>system</literal>
instead.
</para>
+
+<programlisting>
+--exec $MYSQL_DUMP --xml --skip-create test
+--exec rm $MYSQLTEST_VARDIR/tmp/t1
+exec $MYSQL_SHOW test -v -v;
+</programlisting>
</listitem>
<listitem>
@@ -1109,6 +1117,10 @@
Set the default query result display format to horizontal.
Initially, the default is to display results horizontally.
</para>
+
+<programlisting>
+--horizontal_results
+</programlisting>
</listitem>
<listitem>
@@ -1123,6 +1135,18 @@
<xref linkend="mysqltest-flow-control"/>, for further
information about <literal>if</literal> statements.
</para>
+
+<programlisting>
+let $counter=0;
+if ($counter)
+{
+ echo Counter is greater than 0, (counter=0);
+}
+if (!$counter)
+{
+ echo Counter is not 0, (counter=0);
+}
+</programlisting>
</listitem>
<listitem>
@@ -1134,6 +1158,11 @@
Increment a numeric variable. If the variable does not have a
numeric value, the result is undefined.
</para>
+
+<programlisting>
+inc $i;
+inc $3;
+</programlisting>
</listitem>
<listitem>
@@ -1157,7 +1186,22 @@
command delimiter, and thus can span multiple lines.
</para>
+<programlisting>
+--let $1 = 0
+let $count = 10;
+</programlisting>
+
<para>
+ The result from executing a query can be assigned to a
+ variable by enclosing the query within backtick
+ (‘<literal>`</literal>’) characters:
+ </para>
+
+<programlisting>
+let $q = `select version()`;
+</programlisting>
+
+ <para>
[Q: It appears that there can be no space between the variable
name and the <literal>=</literal> operator before MySQL
4.1.15? (Otherwise, the statement might assign no value.)]
@@ -1211,6 +1255,10 @@
<para>
Execute the statement and display its result horizontally.
</para>
+
+<programlisting>
+query_horizontal select pi();
+</programlisting>
</listitem>
<listitem>
@@ -1222,6 +1270,10 @@
<para>
Execute the statement and display its result vertically.
</para>
+
+<programlisting>
+query_vertical select pi();
+</programlisting>
</listitem>
<listitem>
@@ -1236,6 +1288,11 @@
<literal>real_sleep</literal> is not affected by the
<option>--sleep</option> command-line option.
</para>
+
+<programlisting>
+--real_sleep 10
+real_sleep 5;
+</programlisting>
</listitem>
<listitem>
@@ -1291,6 +1348,11 @@
does not because <literal>exec</literal> output is not
necessarily columnar.
</para>
+
+<programlisting>
+--replace_column 9 #
+replace_column 1 b 2 d;
+</programlisting>
</listitem>
<listitem>
@@ -1373,6 +1435,11 @@
command.
</para>
+<programlisting>
+--replace_result 1024 MAX_KEY_LENGTH 3072 MAX_KEY_LENGTH
+replace_result $MASTER_MYPORT MASTER_PORT;
+</programlisting>
+
<para>
[Q: Inconsistencies: <literal>replace_column</literal> applies
only to the data rows, and not to the row of column headers.
@@ -1408,6 +1475,11 @@
aborts with a <quote>this test is not supported</quote> error
message.
</para>
+
+<programlisting>
+--require r/slave-stopped.result
+--require r/have_moscow_leap_timezone.require
+</programlisting>
</listitem>
<listitem>
@@ -1416,7 +1488,7 @@
</para>
<para>
- [TODO: Unknown]
+ Unknown.
</para>
</listitem>
@@ -1445,7 +1517,7 @@
</para>
<para>
- [TODO: Unknown]
+ Unknown.
</para>
</listitem>
@@ -1500,30 +1572,22 @@
<replaceable>server_name</replaceable></literal>
</para>
- <remark role="note">
- The "manager" here is not mysqlmanager. It is/was used by a
- few tests. It's from tools/mysqlmanager.c.
- </remark>
-
<para>
- Contact the manager to start a server. The timeout value is 10
- seconds.
+ Contact <command>mysqlmanager</command> to start a server. The
+ timeout value is 10 seconds.
</para>
+<programlisting>
+server_start master;
+server_start slave;
+</programlisting>
+
<para>
This command is unavailable for
<command>mysqltest_embedded</command>, the version of
<command>mysqltest</command> built with support for
<literal>libmysqld</literal>.
</para>
-
- <para>
- [Q: 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>
</listitem>
<listitem>
@@ -1537,6 +1601,11 @@
seconds.
</para>
+<programlisting>
+server_stop master;
+server_stop slave;
+</programlisting>
+
<para>
This command is unavailable for
<command>mysqltest_embedded</command>, the version of
@@ -1560,6 +1629,11 @@
<option>--sleep=10</option>, the command <literal>sleep
15</literal> sleeps 10 seconds, not 15.
</para>
+
+<programlisting>
+--real_sleep 10
+real_sleep 5;
+</programlisting>
</listitem>
<listitem>
@@ -1594,6 +1668,11 @@
files, but take care to avoid a loop. The maximum nesting
level is 16.
</para>
+
+<programlisting>
+--source include/have_csv.inc
+source include/varchar.inc;
+</programlisting>
</listitem>
<listitem>
@@ -1620,9 +1699,9 @@
</para>
<programlisting>
-save_master_pos
-connection <replaceable>connection_name</replaceable>
-sync_with_master 0
+save_master_pos;
+connection <replaceable>connection_name</replaceable>;
+sync_with_master 0;
</programlisting>
<para>
@@ -1647,6 +1726,10 @@
<replaceable>offset</replaceable></literal>
</para>
+ <remark role="todo">
+ Is the argument optional? If so, what is the default?
+ </remark>
+
<para>
For a slave replication server, wait until it has caught up
with the master. The position to synchronize to is the
@@ -1685,6 +1768,12 @@
<literal>exec</literal>. Use <literal>system</literal>
instead.
</para>
+
+<programlisting>
+--system echo '[mysqltest1]' > $MYSQLTEST_VARDIR/tmp/tmp.cnf
+--system echo 'port=1234' >> $MYSQLTEST_VARDIR/tmp/tmp.cnf
+system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI;
+</programlisting>
</listitem>
<listitem>
@@ -1696,6 +1785,10 @@
Set the default query result display format to vertical.
Initially, the default is to display results horizontally.
</para>
+
+<programlisting>
+--vertical_results
+</programlisting>
</listitem>
<listitem>
@@ -1731,6 +1824,15 @@
<replaceable>expr</replaceable> so that it becomes false at
some point.
</para>
+
+<programlisting>
+let $i=5;
+while ($i)
+{
+ echo $i;
+ dec $i;
+}
+</programlisting>
</listitem>
</itemizedlist>
Modified: trunk/mysqltest/programs.xml
===================================================================
--- trunk/mysqltest/programs.xml 2006-06-15 14:54:25 UTC (rev 2395)
+++ trunk/mysqltest/programs.xml 2006-06-15 20:01:11 UTC (rev 2396)
@@ -2027,7 +2027,6 @@
</para>
</listitem>
-
<listitem>
<para>
<indexterm>
@@ -3266,8 +3265,8 @@
<option>--ndb_mgm-extra-opts</option>,
<option>--ndb_mgmd-extra-opts</option>,
<option>--ndbd-extra-opts</option>,
- <option>--old-master</option>,
- <option>--purify</option>, <option>--use-old-data</option>,
+ <option>--old-master</option>, <option>--purify</option>,
+ <option>--use-old-data</option>,
<option>--valgrind-mysqltest-all</option>.
</para>
@@ -3790,10 +3789,6 @@
tells <command>mysqltest</command> to use it. This is the
default as of MySQL 4.1.
</para>
-
- <para>
- [TODO: remove final sentence for .pl version]
- </para>
</listitem>
<listitem>
@@ -4762,10 +4757,6 @@
file. The default file is named
<filename>./var/log/timer</filename>.
</para>
-
- <para>
- [TODO: .pl supports --notimer as well]
- </para>
</listitem>
<listitem>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r2396 - in trunk: . mysqltest | paul | 15 Jun |