MDEV-21088 Table cannot be loaded after instant ADD/DROP COLUMN
In MariaDB Server 10.4, btr_cur_instant_init_low() assumes that all PRIMARY KEY columns that are internally variable-length will be encoded in 0 bytes in the metadata record. Sometimes, CHAR columns can be encoded as variable-length. We should not unnecessarily reserve space for a dummy string value in the metadata record.
This commit is contained in:
parent
7b5654f3e9
commit
89f487f2e2
@ -4278,10 +4278,17 @@ innobase_add_instant_try(
|
|||||||
case MYSQL_TYPE_MEDIUM_BLOB:
|
case MYSQL_TYPE_MEDIUM_BLOB:
|
||||||
case MYSQL_TYPE_BLOB:
|
case MYSQL_TYPE_BLOB:
|
||||||
case MYSQL_TYPE_LONG_BLOB:
|
case MYSQL_TYPE_LONG_BLOB:
|
||||||
|
variable_length:
|
||||||
/* Store the empty string for 'core'
|
/* Store the empty string for 'core'
|
||||||
variable-length NOT NULL columns. */
|
variable-length NOT NULL columns. */
|
||||||
dfield_set_data(d, field_ref_zero, 0);
|
dfield_set_data(d, field_ref_zero, 0);
|
||||||
break;
|
break;
|
||||||
|
case MYSQL_TYPE_STRING:
|
||||||
|
if (col->mbminlen != col->mbmaxlen
|
||||||
|
|| !dict_table_is_comp(user_table)) {
|
||||||
|
goto variable_length;
|
||||||
|
}
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
/* For fixed-length NOT NULL 'core' columns,
|
/* For fixed-length NOT NULL 'core' columns,
|
||||||
get a dummy default value from SQL. Note that
|
get a dummy default value from SQL. Note that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user