diff options
author | svoj@mysql.com/june.mysql.com <> | 2007-01-31 16:15:20 +0400 |
---|---|---|
committer | svoj@mysql.com/june.mysql.com <> | 2007-01-31 16:15:20 +0400 |
commit | a51aae601d82261e9b30d394c8f022e3740aa788 (patch) | |
tree | 2dc7d4b8ebc18a666880e1c94c5f4c8878d0432d /mysql-test/t/merge.test | |
parent | 45aeb7f04d36a3bbed048edd110acef5fa22bf4d (diff) | |
download | mariadb-git-a51aae601d82261e9b30d394c8f022e3740aa788.tar.gz |
WL#3567 - MERGE engine: a check for underlying table conformance
When a merge table is opened compare column and key definition of
underlying tables against column and key definition of merge table.
If any of underlying tables have different column/key definition
refuse to open merge table.
Diffstat (limited to 'mysql-test/t/merge.test')
-rw-r--r-- | mysql-test/t/merge.test | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index bb03b7b8d62..700a807e62c 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -383,7 +383,7 @@ drop table t1, t2, t3; CREATE TABLE t1(a INT); INSERT INTO t1 VALUES(2),(1); CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1); ---error 1030 +--error 1168 SELECT * FROM t2 WHERE a=2; DROP TABLE t1, t2; @@ -401,4 +401,31 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); SELECT * FROM t2; DROP TABLE t2; +# +# Underlying table definition conformance tests. +# +CREATE TABLE t1(a INT, b TEXT); +CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1); +--error 1168 +SELECT * FROM tm1; +DROP TABLE t1, tm1; + +CREATE TABLE t1(a SMALLINT, b SMALLINT); +CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1); +--error 1168 +SELECT * FROM tm1; +DROP TABLE t1, tm1; + +CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(a, b)); +CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); +--error 1168 +SELECT * FROM tm1; +DROP TABLE t1, tm1; + +CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(b)); +CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); +--error 1168 +SELECT * FROM tm1; +DROP TABLE t1, tm1; + # End of 4.1 tests |