Skip to content
  • Mattias Jonsson's avatar
    8d4a7e70
    Bug#15961327: ALTER TABLE...MODIFY...NOT NULL REFUSES TO · 8d4a7e70
    Mattias Jonsson authored
    SILENTLY CONVERT NULL
    
    In-Place in InnoDB do not convert from NULL to NOT NULL
    due to loss of information, it will always give an error
    for such rows.
    
    But ALGORITHM = COPY will do such conversion with only
    a warning (which in case of strict sql_mode it will turn the
    warning to an error).
    
    So to be consistent, we will only allow INPLACE for
    NULL -> NOT NULL under strict sql_mode, since that will give
    an error for both INPLACE and COPY.
    
    If not strict mode ha_innodbase::check_if_supported_inplace_alter
    will return failure, and depending on ALGORITHM it will fall back to
    COPY or fail.
    
    Also notice that ADD PRIMARY KEY () will implicitly add NOT NULL if
    not already there!
    
    Updated tests that uses INPLACE by setting strict sql_mode.
    
    Also updated some Swedish error messages.
    
    rb 1679 approved by marko.
    8d4a7e70
    Bug#15961327: ALTER TABLE...MODIFY...NOT NULL REFUSES TO
    Mattias Jonsson authored
    SILENTLY CONVERT NULL
    
    In-Place in InnoDB do not convert from NULL to NOT NULL
    due to loss of information, it will always give an error
    for such rows.
    
    But ALGORITHM = COPY will do such conversion with only
    a warning (which in case of strict sql_mode it will turn the
    warning to an error).
    
    So to be consistent, we will only allow INPLACE for
    NULL -> NOT NULL under strict sql_mode, since that will give
    an error for both INPLACE and COPY.
    
    If not strict mode ha_innodbase::check_if_supported_inplace_alter
    will return failure, and depending on ALGORITHM it will fall back to
    COPY or fail.
    
    Also notice that ADD PRIMARY KEY () will implicitly add NOT NULL if
    not already there!
    
    Updated tests that uses INPLACE by setting strict sql_mode.
    
    Also updated some Swedish error messages.
    
    rb 1679 approved by marko.
Loading