Bug #88469 MERGE documentation is not precise about table requirements
Submitted: 13 Nov 2017 22:22 Modified: 16 Nov 2017 7:44
Reporter: Federico Razzoli (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5/5.6/5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any

[13 Nov 2017 22:22] Federico Razzoli
Description:
Documentation for MERGE engine:

https://dev.mysql.com/doc/refman/8.0/en/merge-storage-engine.html

states:

"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. You cannot merge MyISAM tables in which the columns are listed in a different order, do not have exactly the same columns, or have the indexes in different order. However, any or all of the MyISAM tables can be compressed with myisampack."

However, I've found some differences not mentioned:

* Columns and indexes names can be different (definitely not obvious)
* Comments for tables, columns and indexes can be different (maybe more intuitive, but useful to mention)

How to repeat:
mysql> CREATE TABLE t1 (
    -> one INT COMMENT '000',
    -> two INT,
    -> INDEX idx_one(one) COMMENT '!!!'
    -> )
    -> ENGINE MyISAM
    -> COMMENT 'xxx';
Query OK, 0 rows affected (0.05 sec)

mysql> CREATE TABLE t2 (
    -> uno INT COMMENT '999',
    -> due INT,
    -> INDEX idx_uno(uno) COMMENT '???'
    -> )
    -> ENGINE MyISAM
    -> COMMENT 'YYY';
Query OK, 0 rows affected (0.05 sec)

mysql> CREATE TABLE t_mrg (
    -> a INT,
    -> b INT
    -> ) ENGINE MERGE, UNION=(t1,t2);
Query OK, 0 rows affected (0.05 sec)

mysql> INSERT INTO t1 VALUES (1,1);
Query OK, 1 row affected (0.02 sec)

mysql> INSERT INTO t2 VALUES (2,2);
Query OK, 1 row affected (0.02 sec)

mysql> SELECT a,b FROM t_mrg;
+------+------+
| a    | b    |
+------+------+
|    1 |    1 |
|    2 |    2 |
+------+------+
2 rows in set (0.00 sec)

Suggested fix:
Clearly list all permitted differences.
[13 Nov 2017 22:45] MySQL Verification Team
Thank you for the bug report.
[16 Nov 2017 7:44] Erlend Dahl
[14 Nov 2017 18:20] Paul Dubois

https://dev.mysql.com/doc/refman/8.0/en/merge-storage-engine.html
updated with the addition nonsignificant differences.