Skip to content

Commit

Permalink
[TASK] Speed up SysLogSerializationUpdate
Browse files Browse the repository at this point in the history
Speed up the SysLogSerializationUpdate migration wizard
for trivial cases like a:0:{} and a:1:{i:0;s:0:"";}.

Resolves: #100932
Releases: main, 12.4
Change-Id: I6dd35036f18778a1dac012362dbf6ee4fa614703
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79255
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
thomashohn authored and lolli42 committed Jun 11, 2023
1 parent 0100722 commit 1a7465c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions typo3/sysext/install/Classes/Updates/SysLogSerializationUpdate.php
Expand Up @@ -58,6 +58,20 @@ public function executeUpdate(): bool
{
$connection = $this->getConnectionPool()->getConnectionForTable(self::TABLE_NAME);

// Perform fast update of a:0:{}, since it evaluates to []
$connection->update(
self::TABLE_NAME,
['log_data' => '[]'],
['log_data' => 'a:0:{}']
);

// Perform fast update of a:1:{i:0;s:0:"";}, since it evaluates to [""]
$connection->update(
self::TABLE_NAME,
['log_data' => '[""]'],
['log_data' => 'a:1:{i:0;s:0:"";}']
);

foreach ($this->getRecordsToUpdate() as $record) {
$logData = $this->unserializeLogData($record['log_data'] ?? '');
$connection->update(
Expand Down
Expand Up @@ -3,3 +3,4 @@
,1,"Stage for record was changed to -10. Comment was: """"","a:0:{}"
,2,"New version created of table '%s', uid '%s'. UID of new version is '%s'","a:3:{i:0;s:18:""sys_file_reference"";i:1;i:27421;i:2;i:27422;}"
,3,"Record '%s' (%s) was deleted from page '%s' (%s)","a:5:{i:0;s:19:""gabrielle-bugat.png"";i:1;s:24:""sys_file_reference:32134"";i:2;s:10:""Management"";i:3;i:373;s:12:""originalUser"";i:41;}"
,4,"Stage for record was changed to -20. Comment was: """"","a:1:{i:0;s:0:"""";}"
Expand Up @@ -3,3 +3,4 @@
,1,"Stage for record was changed to -10. Comment was: """"","[]"
,2,"New version created of table '%s', uid '%s'. UID of new version is '%s'","[""sys_file_reference"",27421,27422]"
,3,"Record '%s' (%s) was deleted from page '%s' (%s)","{""0"":""gabrielle-bugat.png"",""1"":""sys_file_reference:32134"",""2"":""Management"",""3"":373,""originalUser"":41}"
,4,"Stage for record was changed to -20. Comment was: """"","[""""]"

0 comments on commit 1a7465c

Please sign in to comment.