Project

General

Profile

Actions

Bug #89103

closed

impexp: sql error when strict_mode is enabled on database server

Added by Rémy DANIEL almost 5 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Import/Export (T3D)
Target version:
-
Start date:
2019-09-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Epic #68397: Make TYPO3 work with MySQL strict modeClosed2008-05-20

Actions
Actions #1

Updated by Rémy DANIEL almost 5 years ago

  • Related to Epic #68397: Make TYPO3 work with MySQL strict mode added
Actions #2

Updated by Gerrit Code Review almost 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

Actions #3

Updated by Gerrit Code Review almost 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

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Gerrit Code Review almost 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

Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Rémy DANIEL almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Gerrit Code Review almost 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

Actions #10

Updated by Rémy DANIEL almost 2 years ago

  • Status changed from Under Review to Resolved
Actions #11

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF