Epic #68397: Make TYPO3 work with MySQL strict mode
Default-values for text-fields
In some places text-fields don't have a default-value. phpMyAdmin shows that there is no default-value set.
Unfortunately MySQL (still) does not support default-values for BLOB/TEXT (see bugs.mysql.com/bug.php?id=21532).
Upon insertion of a new content-element (a plugin in this case) I got:
SQL error: 'Field 'filelink_sorting' doesn't have a default value' (tt_content:NEW5240c411f10d4)
This can be prevented by adding a default-value (empty string) in the TCA-definition for that column (in typo3/sysext/frontend/Configuration/TCA/tt_content.php).
I expect this is true for versions down to 4.5 and is just triggered since some newer MySQL/MariaDB-release.
Happens here on Fedora 19 with mariadb-server-5.5.32-8.fc19.
[BUGFIX] Provide default value for field tt_content.filelink_sorting
Changing the field type for filelink_sorting to a text type that supports
a default value allows inserts into tt_content to succeed when no sorting
option was provided, fixing problems with MySQL strict mode.
Reviewed-by: Wouter Wolters <firstname.lastname@example.org>
Reviewed-by: Daniel Goerz <email@example.com>
Reviewed-by: Stefan Neufeind <firstname.lastname@example.org>
Tested-by: Stefan Neufeind <email@example.com>
#2 Updated by Ernesto Baschny about 5 years ago
- Status changed from New to Accepted
Making TYPO3 compatible with MySQL strict mode is probably a huge challenge that we might want to take some time. But not for 6.2. Which is why I added #54883 suggesting to at least document the fact more clearly and officially.
#5 Updated by Hallvard Nygård over 4 years ago
It's default when installing MySQL 5.5 on Windows using Windows Platform installer
C:\Program Files\MySQL\MySQL Server 5.5\my.ini:
Worked after changing it to: