Commit e5793d1a authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0

parents 21255c19 ddd735c6
Loading
Loading
Loading
Loading

mysql-test/xml/README

deleted100644 → 0
+0 −74
Original line number Diff line number Diff line
This directory contains all of the test cases for the MySQL Test Suite
marked up in XML.

To convert these test cases from XML into 'mysqltest' format, one needs
an XSL translator installed on their system. At MySQL, we use Sablotron
(http://www.gingerall.com/). Once installed, conversion happens with a 
command like this:

	sabcmd xsl/mysqltest.xsl < tests/sel000001.xml > sel000001.test

The file 'sel000001.test' contains the plain text conversion that is
to be fed into the 'mysqltest' program.

Below is an example of a test case marked up in XML; illustrating all
of the XML mark-up currently supported in our 'mysqltest.xsl' stylesheet.

----------------------------------------------------
<?xml version="1.0" standalone="no"?>

<!-- This file is maintained by matt@mysql.com -->

<test name="sel000001">

   <version value="3.22"/>
   <version value="3.23"/>

   <description>This test will monkey around trying to kill mysqld.</description>

   <connect name="Test_Connect1"
            host="MyHostName"
            user="Matt"
            pass="MattPass"
              db="MyDB"
            port="3306"
            sock="MyDB.sock"
    />

    <connection name="Test_Connect1">
       <resultfile name="sel000001.result">
           <sql>SELECT y FROM foo WHERE bar='2'</sql>
        </resultfile>
           <sql>INSERT INTO foo  VALUES (y='2') WHERE bar='1'</sql> 
    </connection>

</test>
----------------------------------------------------


The converted (mysqltest format) output of this source XML file looks
like:

 
----------------------------------------------------
# sel000001
#
# Versions
# --------
#   3.22
#   3.23
#
# Description
# -----------
# This test will monkey around trying to kill mysqld.
#


connect(Test_Connect1, MyHostName, Matt, MattPass, MyDB, 3306, MyDB.sock)

connection Test_Connect1
INSERT INTO foo  VALUES (y='2') WHERE bar='1';
@sel000001.result SELECT y FROM foo WHERE bar='2';
----------------------------------------------------

+0 −21
Original line number Diff line number Diff line
<?xml version="1.0" standalone="no"?>

<!-- This file is maintained by matt@mysql.com -->

<test name="sel000001">

   <version value="3.22"/>
   <version value="3.23"/>

   <description>This test is just a simple select.</description>
   <description>Testing WHERE clause.</description>

   <sql>DROP TABLE IF EXISTS t</sql>
   <sql>CREATE TABLE t (s CHAR(20) PRIMARY KEY, id INT)</sql>
   <sql>INSERT INTO t VALUES ('cat', 1), ('mouse', 3), ('dog', 2), ('snake', 77)</sql>

   <resultfile name="r/3.23/sel000001.result">
        <sql>SELECT s, id FROM t WHERE s = 'mouse'</sql>
   </resultfile>

</test>
+0 −20
Original line number Diff line number Diff line
<?xml version="1.0" standalone="no"?>

<!-- This file is maintained by matt@mysql.com -->

<test name="sel000002">

   <version value="3.22"/>
   <version value="3.23"/>

   <description>This test is just a simple select.</description>

   <sql>DROP TABLE IF EXISTS t</sql>
   <sql>CREATE TABLE t (n INT)</sql>
   <sql>INSERT INTO t VALUES (1), (2), (3)</sql>

   <resultfile name="r/3.23/sel000002.result">
        <sql>SELECT * FROM t</sql>
   </resultfile>

</test>
+0 −21
Original line number Diff line number Diff line
<?xml version="1.0" standalone="no"?>

<!-- This file is maintained by matt@mysql.com -->

<test name="sel000003">

   <version value="3.22"/>
   <version value="3.23"/>

   <description>This test is just a simple select.</description>
   <description>Testing count() function and GROUP BY clause.</description>

   <sql>DROP TABLE IF EXISTS t</sql>
   <sql>CREATE TABLE t (name CHAR(20) NOT NULL PRIMARY KEY, score SMALLINT NOT NULL, KEY(score))</sql>
   <sql>INSERT INTO t VALUES ('Sasha', 20), ('Matt', 20), ('Monty', 10), ('David', 10), ('Tim', 10), ('Jeremy', 10)</sql>

   <resultfile name="r/3.23/sel000003.result">
        <sql>SELECT COUNT(*) as n, score FROM t GROUP BY score</sql>
   </resultfile>

</test>
+0 −17
Original line number Diff line number Diff line
<?xml version="1.0" standalone="no"?>

<!-- This file is maintained by matt@mysql.com -->

<test name="sel000004">

   <version value="3.22"/>
   <version value="3.23"/>

   <description>Simple arithmetic.</description>
   <description>Testing MOD(), SIGN(), and arithmetic grouping.</description>

   <resultfile name="r/3.23/sel000004.result">
        <sql>SELECT 1+1,1-1,1+1*2,8/5,8%5,MOD(8,5),MOD(8,5)|0,-(1+1)*-2,SIGN(-5)</sql>
   </resultfile>

</test>
Loading