Bug #89103
closedimpexp: sql error when strict_mode is enabled on database server
100%
Description
When strict mode [1] is enabled on the database server, if a value has a wrong data type for the column, the INSERT or UPDATE query will fail.
This happens in t3d import.
During an import:
- first, records are stored without their relations
- then relations are stored
- and finaly, records and relations are connected together
The offending code is in \TYPO3\CMS\Impexp\Import::addSingle():
$this->import_data[$table][$ID][$field] = '';
Here, if $field is an integer in the database, the INSERT query will fail.
The relations records will not be created, and the t3d import will failed, leading to an inconsistent state of records in database.
The code should be fixed in order to guess the right datatype to store in the database.
Note: this bug was found when exporting/importing mask content elements with repeatable elements.
See also https://github.com/Gernott/mask/pull/249
[1] https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-strict
Updated by Rémy DANIEL about 5 years ago
- Related to Epic #68397: Make TYPO3 work with MySQL strict mode added
Updated by Gerrit Code Review over 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75385
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75385
Updated by Gerrit Code Review over 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75385
Updated by Gerrit Code Review over 2 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75385
Updated by Gerrit Code Review over 2 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75385
Updated by Rémy DANIEL over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 3c7fbcca409932e70a9d6e718da1baa9d76e2c72.
Updated by Gerrit Code Review over 2 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75391
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75391
Updated by Rémy DANIEL over 2 years ago
- Status changed from Under Review to Resolved
Applied in changeset 42f137f4fe10b21c37d0f5d27a61765099f5d01b.