Force MySQL to use mode STRICT_ALL_TABLES

NEW
Unassigned

Status

()

--
enhancement
3 years ago
3 years ago

People

(Reporter: LpSolit, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
We currently disable the MySQL strict mode for bad reasons; see bug 321645 for details. This has the side-effect to put MySQL in a lenient mode, where too long strings are truncated before being inserted into the DB instead of throwing an error like PostgreSQL does. This can have dramatic consequences, such as bug 1202447.

The right fix is to force MySQL strict mode using STRICT_ALL_TABLES and to fix our DB schema and upgrade tools accordingly. This way, when a too long string is inserted into the DB, you get:

DBD::mysql::db do failed: Data too long for column '...' at row 1 [for Statement "INSERT INTO ..."

and the whole DB transaction is reverted. This is much better and safer than to insert truncated data (data corruption).
(Reporter)

Comment 1

3 years ago
Created attachment 8657953 [details] [diff] [review]
WIP, v0.1

Very early work. But this lets you create a new DB with strict mode enabled.
You need to log in before you can comment on or make changes to this bug.