Context
The beta stack runs MariaDB 12, which enables STRICT_TRANS_TABLES by default. The application was built against Lion's MariaDB which had no strict mode, so many write paths silently rely on non-strict behaviour. With strict mode on, the following break:
- Gallery image uploads
- Sending messages
- Forum post submission
- Any INSERT/UPDATE hitting a NOT NULL column without a default value, a string longer than its column definition, or an invalid date literal
Current decision: STRICT_TRANS_TABLES is explicitly excluded from sql_mode in the beta DB config to match Lion's historical behaviour and unblock the migration:
sql_mode = NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
This is tracked in sysadmins-infra hosts/bewelcome_alpha/compose/bewelcome/mariadb-tuning.cnf.
What needs fixing before re-enabling strict mode
- Missing defaults — find NOT NULL columns that have no DEFAULT and ensure the application always provides a value on INSERT.
- Silent string truncation — find VARCHAR/TINYTEXT columns where the application may insert a value longer than the column definition.
- Invalid datetime literals —
0000-00-00 dates in queries or inserts must be replaced with NULL or a valid date.
- Implicit integer coercion — out-of-range values on TINYINT/SMALLINT columns that were silently clamped.
How to find them
Run the application manually on beta with strict mode temporarily re-enabled and collect the resulting SQL errors from the slow query log or application logs. Each error points to a specific query.
Definition of done
All functional tests pass with sql_mode = STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION. At that point the override in sysadmins-infra can be removed.
Context
The beta stack runs MariaDB 12, which enables
STRICT_TRANS_TABLESby default. The application was built against Lion's MariaDB which had no strict mode, so many write paths silently rely on non-strict behaviour. With strict mode on, the following break:Current decision:
STRICT_TRANS_TABLESis explicitly excluded fromsql_modein the beta DB config to match Lion's historical behaviour and unblock the migration:sql_mode = NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONThis is tracked in sysadmins-infra
hosts/bewelcome_alpha/compose/bewelcome/mariadb-tuning.cnf.What needs fixing before re-enabling strict mode
0000-00-00dates in queries or inserts must be replaced with NULL or a valid date.How to find them
Run the application manually on beta with strict mode temporarily re-enabled and collect the resulting SQL errors from the slow query log or application logs. Each error points to a specific query.
Definition of done
All functional tests pass with
sql_mode = STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION. At that point the override in sysadmins-infra can be removed.