[BUGFIX] Cannot use equal operator on data type text 86/39086/2
authorXavier Perseguers <xavier@typo3.org>
Thu, 30 Apr 2015 12:50:29 +0000 (14:50 +0200)
committerXavier Perseguers <xavier@typo3.org>
Thu, 30 Apr 2015 13:39:29 +0000 (15:39 +0200)
MSSQL does not allow a column of type "text" to be compared with
an equal operator. It fails with:

    The data types text and varchar are incompatible in the equal to operator

Change-Id: I59e955e53127854fb44ec1af9d81388801438222
Releases: master, 6.2
Resolves: #66686
Reviewed-on: http://review.typo3.org/39086
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php

index f7627b8..1dae720 100644 (file)
@@ -323,7 +323,7 @@ class FileIndexRepository implements SingletonInterface {
                        $where = 'uid=' . (int)$file->getUid();
                } else {
                        $where = sprintf(
-                               'storage=%u AND identifier=%s',
+                               'storage=%u AND identifier LIKE %s',
                                (int)$file->getStorage()->getUid(),
                                $this->getDatabaseConnection()->fullQuoteStr($file->_getPropertyRaw('identifier'), $this->table)
                        );