diff options
author | kent@mysql.com <> | 2004-10-22 05:56:27 +0200 |
---|---|---|
committer | kent@mysql.com <> | 2004-10-22 05:56:27 +0200 |
commit | 7a640b44ddcc5bfd8bbda242e523aa9af304e141 (patch) | |
tree | fe9261b433535651944415f1f995aa26f5f6574a /mysql-test | |
parent | 04b8a57b0179b2f38677b369cf51e0c17743fd5f (diff) | |
download | mariadb-git-7a640b44ddcc5bfd8bbda242e523aa9af304e141.tar.gz |
mysqltest.c, mysqltest.result, mysqltest.test:
Added SQLSTATE matching support to test engine
mysqltest.result, mysqltest.test:
new file
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/mysqltest.result | 23 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 78 |
2 files changed, 101 insertions, 0 deletions
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result new file mode 100644 index 00000000000..4e30d5bc110 --- /dev/null +++ b/mysql-test/r/mysqltest.result @@ -0,0 +1,23 @@ +select otto from (select 1 as otto) as t1; +otto +1 +select otto from (select 1 as otto) as t1; +otto +1 +select otto from (select 1 as otto) as t1; +otto +1 +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' +select otto from (select 1 as otto) as t1; +otto +1 +select otto from (select 1 as otto) as t1; +otto +1 +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test new file mode 100644 index 00000000000..c18dfe1e25c --- /dev/null +++ b/mysql-test/t/mysqltest.test @@ -0,0 +1,78 @@ + +# ============================================================================ +# +# Test of mysqltest itself +# +# ============================================================================ + +# ---------------------------------------------------------------------------- +# Positive case(statement) +# ---------------------------------------------------------------------------- + +select otto from (select 1 as otto) as t1; +# expectation = response +!$0 select otto from (select 1 as otto) as t1; +--error 0 +select otto from (select 1 as otto) as t1; + +# expectation <> response +-- // !$1054 select otto from (select 1 as otto) as t1; +-- // --error 1054 +-- // select otto from (select 1 as otto) as t1; + + +# ---------------------------------------------------------------------------- +# Negative case(statement): +# The dervied table t1 does not contain a column named 'friedrich' . +# --> ERROR 42S22: Unknown column 'friedrich' in 'field list and +# --> 1054: Unknown column 'friedrich' in 'field list' +# ---------------------------------------------------------------------------- + +# expectation <> response +#!$0 select friedrich from (select 1 as otto) as t1; +#--error 0 +#select friedrich from (select 1 as otto) as t1; + +# expectation = response +!$1054 select friedrich from (select 1 as otto) as t1; +--error 1054 +select friedrich from (select 1 as otto) as t1; + +# The following unmasked unsuccessful statement must give +# 1. mysqltest gives a 'failed' +# 2. does not produce a r/<test case>.reject file !!! +# PLEASE uncomment it and check it's effect +#select friedrich from (select 1 as otto) as t1; + + +# ---------------------------------------------------------------------------- +# Tests for the new feature - SQLSTATE error code matching +# Positive case(statement) +# ---------------------------------------------------------------------------- + +# expectation = response +!S00000 select otto from (select 1 as otto) as t1; + +--error S00000 +select otto from (select 1 as otto) as t1; + +# expectation <> response +#!S42S22 select otto from (select 1 as otto) as t1; +#--error S42S22 +#select otto from (select 1 as otto) as t1; + + +# ---------------------------------------------------------------------------- +# Negative case(statement) +# ---------------------------------------------------------------------------- + +# expectation = response +!S42S22 select friedrich from (select 1 as otto) as t1; +--error S42S22 +select friedrich from (select 1 as otto) as t1; + +# expectation !=response +#!S00000 select friedrich from (select 1 as otto) as t1; +#--error S00000 +#select friedrich from (select 1 as otto) as t1; + |