Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
None
-
None
-
None
-
None
Description
In the following example, t3 has a column named c instead of b. But everything seems to work, even when a SELECT explicitly names b:
MariaDB [test]> CREATE TABLE t1 (
|
-> a INT,
|
-> b INT
|
-> ) ENGINE = MyISAM;
|
Query OK, 0 rows affected (0.07 sec)
|
|
|
MariaDB [test]> CREATE TABLE t2 (
|
-> a INT,
|
-> b INT
|
-> ) ENGINE = MyISAM;
|
Query OK, 0 rows affected (0.06 sec)
|
|
|
MariaDB [test]> CREATE TABLE t3 (
|
-> a INT,
|
-> c INT
|
-> ) ENGINE = MyISAM;
|
Query OK, 0 rows affected (0.02 sec)
|
|
|
MariaDB [test]> CREATE TABLE t_mrg (
|
-> a INT,
|
-> b INT
|
-> ) ENGINE = MERGE,UNION=(t1,t2,t3);
|
Query OK, 0 rows affected (0.02 sec)
|
|
|
MariaDB [test]> INSERT INTO t1 VALUES (1,1);
|
Query OK, 1 row affected (0.02 sec)
|
|
|
MariaDB [test]> INSERT INTO t3 VALUES (2,2);
|
Query OK, 1 row affected (0.00 sec)
|
|
|
MariaDB [test]> SELECT a,b FROM t_mrg;
|
+------+------+
|
| a | b |
|
+------+------+
|
| 1 | 1 |
|
| 2 | 2 |
|
+------+------+
|
2 rows in set (0.00 sec)
|
From MySQL manual:
http://dev.mysql.com/doc/refman/5.5/en/merge-storage-engine.html
The MERGE storage engine, also known as the MRG_MyISAM engine, is a collection of identical MyISAM tables that can be used as one. “Identical” means that all tables have identical column and index information.
As far as I understand, this includes column names?