In all above cases, empty strings as well as strings consisting only of space characters were replaced to the DEFAULT value.
Looks wrong. Strings consisting of only spaces should never be replaced to DEFAULT.
CHAR values should be padded with spaces to their full length.
For MariaDB compatibility, the SELECT behaviour should depend on sql_mode=PAD_CHAR_TO_FULL_LENGTH:
- trailing spaces should be preserved on SELECT if PAD_CHAR_TO_FULL_LENGTH is set
- trailing spaces should be trimmed on SELECT, if PAD_CHAR_TO_FULL_LENGTH is not set
Also, inserting an empty string should:
- either fail on NOT NULL violation for now
- or store the true empty string (when we fix the flaw that an empty string is NULL)