Project

General

Profile

Actions

Bug #70629

closed

Bug with MySQL mode STRICT_TRANS_TABLES

Added by Markus Hölzle over 8 years ago. Updated over 8 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

Also available in: Atom PDF