• unknown's avatar
    Fix for bug#24395: · 610d12c5
    unknown authored
    ALTER TABLE DISABLE KEYS doesn't work when modifying the table
      
    ENABLE|DISABLE KEYS combined with another ALTER TABLE option, different
    than RENAME TO did nothing. Also, if the table had disabled keys
    and was ALTER-ed then the end table was with enabled keys.
      
    Fixed by checking whether the table had disabled keys and enabling them
    in the copied table.
    
    
    myisam/mi_open.c:
      Extend mi_indexes_are_disabled to implement return value
      2 - Non-unique indexes are disabled
    mysql-test/r/alter_table.result:
      update result
    mysql-test/t/alter_table.test:
      update test
    sql/sql_table.cc:
      When ENABLE|DISABLE index is combined with another option
      different than RENAME TO, we should ENABLE|DISABLE the keys of
      the modified table. Also when modifying we should preserve the
      previous state of the indices.
      (This problem exists in 5.0 and 5.1 but since the codebase has
      diverged, this fix won't automerge, but the fix will be quite
      similar).
    610d12c5
sql_table.cc 114 KB