• Dmitry Lenev's avatar
    Fix for bug #11759990 - "52354: 'CREATE TABLE .. LIKE ... ' · 600647c7
    Dmitry Lenev authored
    STATEMENTS FAIL".
    
    Attempt to execute CREATE TABLE LIKE statement on a MyISAM
    table with INDEX or DATA DIRECTORY options specified as a
    source resulted in "MyISAM table '...' is in use..." error.
    According to our documentation such a statement should create
    a copy of source table with DATA/INDEX DIRECTORY options
    omitted.
    
    The problem was that new implementation of CREATE TABLE LIKE
    statement in 5.5 tried to copy value of INDEX and DATA DIRECTORY
    parameters from the source table. Since in description of source
    table this parameters also included name of this table, attempt
    to create target table with these parameter led to file name
    conflict and error.
    
    This fix addresses the problem by preserving documented and
    backward-compatible behavior. I.e. by ensuring that contents
    of DATA/INDEX DIRECTORY clauses for the source table is
    ignored when target table is created.
    
    mysql-test/r/symlink.result:
      Added test for bug #11759990 - "52354: 'CREATE TABLE ..
      LIKE ... ' STATEMENTS FAIL".
    mysql-test/t/symlink.test:
      Added test for bug #11759990 - "52354: 'CREATE TABLE ..
      LIKE ... ' STATEMENTS FAIL".
    sql/sql_table.cc:
      Changed CREATE TABLE LIKE implementation to ignore contents
      of DATA/INDEX DIRECTORY clauses for source table when target
      table is created. This is documented and backward-compatible
      behavior.
    600647c7
symlink.result 7.44 KB