• Marko Mäkelä's avatar
    MDEV-15563: Instantly change a column to NULL · 7a27db77
    Marko Mäkelä authored
    Allow instant changes of columns in ROW_FORMAT=REDUNDANT
    from NOT NULL to NULL.
    
    Later, this may be implemented for ROW_FORMAT=COMPACT or DYNAMIC,
    but in that case any indexes on the table must be rebuilt.
    
    dict_table_t::prepare_instant(): Add some debug assertions,
    and relax a debug assertion so that the number of fields is
    allowed not to change.
    
    dict_index_t::instant_add_field(): Relax a debug assertion,
    allowing a column to change from NOT NULL to NULL.
    
    dict_table_t::instant_column(): Add debug assertions.
    
    instant_alter_column_possible(): Allow ALTER_COLUMN_NULLABLE
    when applicable.
    
    innodb_insert_sys_columns(): Add the parameter bool update=false
    to run UPDATE instead of INSERT.
    
    innobase_instant_add_col(): Remove; let the only caller invoke
    innodb_insert_sys_columns() directly.
    
    innobase_instant_try(): Update the SYS_COLUMNS record if the
    column is changed. Only convert the table to the instant ALTER TABLE
    format if necessary. For ALTER_COLUMN_NULLABLE in ROW_FORMAT=REDUNDANT,
    there is no data format change.
    7a27db77
instant_alter.result 135 KB