Project

General

Profile

Actions

Bug #93830

closed

Wrong type for field `time_micro` in table `sys_log`

Added by Stefano Kowalke over 3 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Logging
Target version:
Start date:
2021-03-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
database, logging,
Complexity:
no-brainer
Is Regression:
Sprint Focus:
Remote Sprint

Description

As we log some custom events to `sys_log` we installed the log extension https://gitlab.com/co-stack.com/co-stack.com/typo3-extensions/logs mentioned at https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Logging/Writers/Index.html.

The backend module sorts the log entries by the field `time_micro` of the table `sys_log`. However, the entries in this field getting stored not correctly because the type is defined as `float`
(https://github.com/TYPO3/TYPO3.CMS/blob/650d5d7ba771d2ad854f2475b7b7d4aff70c9d2c/typo3/sysext/core/ext_tables.sql#L384). While the real microtime in PHP was something like `1617029996.5212` I got `1617030000` in all records:

Changing the type to `decimal(14,4)` fixed the issue.


Files

2021-03-29_16-54-01.png (195 KB) 2021-03-29_16-54-01.png Stefano Kowalke, 2021-03-29 15:21
Actions

Also available in: Atom PDF