Project

General

Profile

Actions

Bug #70629

closed

Bug with MySQL mode STRICT_TRANS_TABLES

Added by Markus Hölzle about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2015-10-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello,

there is a bug if the MySQL mode "STRICT_TRANS_TABLES" is enabled: The function saveTask($task) for example tries to store TRUE or FALSE to a TINYINT database field 'disabled'. This throws an error in the strict mode, because TINYINT only accepts integer values.

The consequences are massive: The scheduler doesn't save the 'nextexecution' field and ignores the error. Then the scheduler starts the next (= the same) task immediately because the 'nextexecution' isn't in the feature... So we have a endless loop, and this will be started by the unix cron command every minute... In worst case, this works until the server crashes!

So this line should be changed from

 241             $fields = array(
 242                 'nextexecution' => $executionTime,
 243                 'disable' => $task->isDisabled(),
 244                 'description' => $task->getDescription(),
 245                 'task_group' => $task->getTaskGroup(),
 246                 'serialized_task_object' => serialize($task)
 247             );
 248             $result = $this->getDatabaseConnection()->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . $taskUid, $fields);

to
 241             $fields = array(
 242                 ...
 243                 'disable' => $task->isDisabled() === TRUE ? 1 : 0,
 244                 ...
 247             );

What do you think?
This kind of saving data is often found in this extension...

Best regards,
Markus


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #80035: Strict MySQL sql_mode breaks workspacesClosed2017-02-27

Actions
Actions #1

Updated by Morton Jonuschat about 9 years ago

  • Status changed from New to Needs Feedback

Hi!

MySQL strict mode isn't supported at the moment but we are working to get TYPO3 running with it. Which version of TYPO3 7 are you using? A fix for storing bool values in integer columns is included TYPO3 7.5 ...

Actions #2

Updated by Markus Hölzle about 9 years ago

Hi,
I didn't use the latest TYPO3 version... So I think this could be closed.
The fastest solution for me was to disable the unsupported strict mode via Install-Tool:

[SYS][setDBinit] = SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION';

Maybe TYPO3 should show a warning if the strict mode is enabled?

Actions #3

Updated by Wouter Wolters about 9 years ago

  • Status changed from Needs Feedback to Closed

This check is available in the Install Tool in 7.5

Actions

Also available in: Atom PDF