Project

General

Profile

Actions

Bug #89103

closed

impexp: sql error when strict_mode is enabled on database server

Added by Rémy DANIEL about 5 years ago. Updated about 2 years 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

Also available in: Atom PDF