• svoj@mysql.com/june.mysql.com's avatar
    BUG#28248 - mysqldump results with MERGE ... UNION=() cannot be executed · 1f0e9f5a
    svoj@mysql.com/june.mysql.com authored
    When there are no underlying tables specified for a merge table,
    SHOW CREATE TABLE outputs a statement that cannot be executed. The
    same is true for mysqldump (it generates dumps that cannot be
    executed).
    
    This happens because SQL parser does not accept empty UNION() clause.
    
    This patch changes the following:
    - it is now possible to execute CREATE/ALTER statement with
      empty UNION() clause.
    - the same as above, but still worth noting: it is now possible to
      remove underlying tables mapping using ALTER TABLE ... UNION=().
    - SHOW CREATE TABLE does not output UNION() clause if there are
      no underlying tables specified for a merge table. This makes
      mysqldump slightly smaller.
    1f0e9f5a
sql_yacc.yy 267 KB