#75932SQL-Error in ProcessedFileChecksumUpdate
Description
We use utf8_unicode_ci on our servers. Using the ProcessedFileChecksumUpdate leads to an SQL error:
Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
array(4 items)
caller => "TYPO3\CMS\Core\Database\DatabaseConnection::exec_SELECTquery" (60 chars)
ERROR => "Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IM
PLICIT) for operation '='" (101 chars)
lastBuiltQuery => "SELECT COUNT(*) FROM sys_file_processedfile LEFT JOIN sys_registry ON entry_
key = CAST(sys_file_processedfile.uid AS CHAR) AND entry_namespace = 'Proces
sedFileChecksumUpdate' WHERE (entry_key IS NULL AND sys_file_processedfile.i
dentifier <> '') OR sys_file_processedfile.width IS NULL" (284 chars)
debug_backtrace => "call_user_func#109 // {closure}# // TYPO3\CMS\Install\Http\Application->run#
108 // TYPO3\CMS\Core\Core\Bootstrap->handleRequest#74 // TYPO3\CMS\Install\
Http\RequestHandler->handleRequest#302 // TYPO3\CMS\Install\Controller\ToolC
ontroller->execute#64 // TYPO3\CMS\Install\Controller\ToolController->dispat
chAuthenticationActions#64 // TYPO3\CMS\Install\Controller\Action\AbstractAc
tion->handle#192 // TYPO3\CMS\Install\Controller\Action\Tool\UpgradeWizard->
executeAction#92 // TYPO3\CMS\Install\Controller\Action\Tool\UpgradeWizard->
listUpdates#72 // TYPO3\CMS\Install\Updates\AbstractUpdate->shouldRenderWiza
rd#98 // TYPO3\CMS\Install\Updates\ProcessedFileChecksumUpdate->checkForUpda
te#120 // TYPO3\CMS\Core\Database\DatabaseConnection->exec_SELECTcountRows#4
4 // TYPO3\CMS\Core\Database\DatabaseConnection->exec_SELECTquery#440 // TYP
O3\CMS\Core\Database\DatabaseConnection->debug#314" (886 chars)
In the patch https://review.typo3.org/#/c/32117/ for issue #36754 this has been solved for the TceformsUpdateWizard and TtContentUploadsUpdateWizard
In the patch https://review.typo3.org/#/c/40576/ for issue #66614 this behaviour leading to the SQL error has been introduced in ProcessedFileChecksumUpdate
This is related to #36754.
Casting both sides of the comparison solves the issue:
Instead of
$join = 'sys_file_processedfile LEFT JOIN sys_registry ON entry_key = CAST(sys_file_processedfile.uid AS CHAR) AND entry_namespace = \'ProcessedFileChecksumUpdate\'';
use
$join = 'sys_file_processedfile LEFT JOIN sys_registry ON CAST(entry_key AS CHAR) = CAST(sys_file_processedfile.uid AS CHAR) AND entry_namespace = \'ProcessedFileChecksumUpdate\'';