• Martin Skold's avatar
    bug #31231 mysql_alter_table() tries to drop a non-existing table · 08421a83
    Martin Skold authored
    bug#31233 mysql_alter_table() fails to drop UNIQUE KEY
    
    mysql-test/suite/ndb/r/ndb_alter_table.result:
      bug#31233 mysql_alter_table() fails to drop UNIQUE KEY: added test cases
    mysql-test/suite/ndb/t/ndb_alter_table.test:
      bug#31233 mysql_alter_table() fails to drop UNIQUE KEY: added test cases
    sql/ha_ndbcluster.cc:
      bug#31233 mysql_alter_table() fails to drop UNIQUE KEY: Removed check for non-pk
      tables, not needed when mysql_alter_table checks apropriate flags
    sql/mysql_priv.h:
      bug #31231  mysql_alter_table() tries to drop a non-existing table: added FRM_ONLY
      flag
    sql/sql_table.cc:
      bug #31231  mysql_alter_table() tries to drop a non-existing table
      Don't invoke handler for tables defined with FRM_ONLY flag.
      bug#31233 mysql_alter_table() fails to drop UNIQUE KEY
      When a table is defined without an explicit primary key
      mysql will choose the first found unique index defined over
      non-nullable fields (if such an index exists). This means
      that if such an index is added (the first) or dropped (the last)
      through an alter table, this equals adding or dropping a primary key.
      The implementation for on-line add/drop index did not consider
      this semantics. This patch ensures that only handlers with the
       correctly defined flags (see handler.h for explanation of the flags):
      HA_ONLINE_ADD_PK_INDEX
      HA_ONLINE_ADD_PK_INDEX_NO_WRITES
      HA_ONLINE_DROP_PK_INDEX
      HA_ONLINE_DROP_PK_INDEX_NO_WRITES
      are invoked for such on-line operations. All others handlers must
      perform a full (offline) alter table.
    08421a83
ha_ndbcluster.cc 299 KB