Commit 89f487f2 authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 7b5654f3
...@@ -4278,10 +4278,17 @@ innobase_add_instant_try( ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment