diff options
author | unknown <svoj@mysql.com/june.mysql.com> | 2007-01-31 16:15:20 +0400 |
---|---|---|
committer | unknown <svoj@mysql.com/june.mysql.com> | 2007-01-31 16:15:20 +0400 |
commit | f7b3c7c531cb4cc3960e64c96a670949ee3a2ffa (patch) | |
tree | 2dc7d4b8ebc18a666880e1c94c5f4c8878d0432d /mysql-test/r/merge.result | |
parent | 402c0426ff172b5cbe97ab222929bcd2f20cabba (diff) | |
download | mariadb-git-f7b3c7c531cb4cc3960e64c96a670949ee3a2ffa.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.
mysql-test/r/merge.result:
A test case for WL#3456.
mysql-test/t/merge.test:
A test case for WL#3456.
sql/ha_myisam.cc:
Moved a part of code that converts TABLE object to MyISAM key and column
definition to a separate function.
Added check_definition() function that compares MyISAM table definitions.
sql/ha_myisammrg.cc:
Check if underlying table definition conforms to merge table definition,
and in case underlying table definition differs, refuse to open merge
table.
Diffstat (limited to 'mysql-test/r/merge.result')
-rw-r--r-- | mysql-test/r/merge.result | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index a1ef7597143..eb333cdadb7 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -770,7 +770,7 @@ CREATE TABLE t1(a INT); INSERT INTO t1 VALUES(2),(1); CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM t2 WHERE a=2; -ERROR HY000: Got error 124 from storage engine +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, t2; CREATE TABLE t1(a INT) ENGINE=MEMORY; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1); @@ -781,3 +781,23 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); SELECT * FROM t2; ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t2; +CREATE TABLE t1(a INT, b TEXT); +CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1); +SELECT * FROM tm1; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +DROP TABLE t1, tm1; +CREATE TABLE t1(a SMALLINT, b SMALLINT); +CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1); +SELECT * FROM tm1; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +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); +SELECT * FROM tm1; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +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); +SELECT * FROM tm1; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +DROP TABLE t1, tm1; |