MariaDB and MySQL disagree about what information_schema.COLUMNS.COLUMN_DEFAULT contains, and the app reads it as though they agree.
MySQL reports a VALUE. MariaDB reports an EXPRESSION. So a nullable MariaDB column declared with no default reports COLUMN_DEFAULT as the four characters NULL, and on MySQL those same four characters mean a column whose default is the literal string NULL. The app shows the user a default nobody wrote.
This is live today through getSchema() on the mysql provider, which serves MariaDB as a wire-compatible variant, so a MariaDB user sees it now.
Measured during #789 by the agent implementing that provider's object surface. It deliberately did not fix it: the same read has two callers, getSchema() and the new describeObject(), and repairing only the new one would leave two live surfaces disagreeing about one column for the rest of that epic. getSchema() is removed at the end of #789, at which point there is one reader and one place to fix.
The fix has a clean route that does not require branching on the database type id: the provider now measures the server version at connect time, so the distinction is available as data.
Two cases still to measure before fixing:
- What MariaDB reports for a column whose default really is the string
NULL.
- What both engines report for an expression default, for example
CURRENT_TIMESTAMP or a generated column.
Done when: a MariaDB column with no default renders as having no default, a MariaDB column defaulting to the literal string NULL renders as that string, and one test pins each against a live server of each family.
MariaDB and MySQL disagree about what
information_schema.COLUMNS.COLUMN_DEFAULTcontains, and the app reads it as though they agree.MySQL reports a VALUE. MariaDB reports an EXPRESSION. So a nullable MariaDB column declared with no default reports
COLUMN_DEFAULTas the four charactersNULL, and on MySQL those same four characters mean a column whose default is the literal stringNULL. The app shows the user a default nobody wrote.This is live today through
getSchema()on themysqlprovider, which serves MariaDB as a wire-compatible variant, so a MariaDB user sees it now.Measured during #789 by the agent implementing that provider's object surface. It deliberately did not fix it: the same read has two callers,
getSchema()and the newdescribeObject(), and repairing only the new one would leave two live surfaces disagreeing about one column for the rest of that epic.getSchema()is removed at the end of #789, at which point there is one reader and one place to fix.The fix has a clean route that does not require branching on the database type id: the provider now measures the server version at connect time, so the distinction is available as data.
Two cases still to measure before fixing:
NULL.CURRENT_TIMESTAMPor a generated column.Done when: a MariaDB column with no default renders as having no default, a MariaDB column defaulting to the literal string
NULLrenders as that string, and one test pins each against a live server of each family.