[BUGFIX] Avoid SQL error in ProcessedFileChecksumUpdate 25/47925/2
authorStephan Großberndt <stephan@grossberndt.de>
Tue, 26 Apr 2016 16:53:27 +0000 (18:53 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 27 Apr 2016 21:12:00 +0000 (23:12 +0200)
Avoid an 'Illegal mix of collations'-SQL error when using collation
utf8_unicode_ci and accessing the ProcessedFileChecksumUpdate wizard
by casting both comparison arguments.

Resolves: #75932
Related: #67708
Releases: master, 7.6
Change-Id: I3c7355eab35bf7d7301eaf10b87f7e5b00bd6908
Reviewed-on: https://review.typo3.org/47925
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/install/Classes/Updates/ProcessedFileChecksumUpdate.php

index 214ea9f..aed94af 100644 (file)
@@ -40,7 +40,7 @@ class ProcessedFileChecksumUpdate extends AbstractUpdate
             return false;
         }
 
-        $join = 'sys_file_processedfile LEFT JOIN sys_registry ON entry_key = CAST(sys_file_processedfile.uid AS CHAR) AND entry_namespace = \'ProcessedFileChecksumUpdate\'';
+        $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\'';
         $count = $this->getDatabaseConnection()->exec_SELECTcountRows('*', $join, '(entry_key IS NULL AND sys_file_processedfile.identifier <> \'\') OR sys_file_processedfile.width IS NULL');
         if (!$count) {
             return false;