[BUGFIX] Dummy WHERE condition compatibility 01/32801/4
authorAndreas Fernandez <andreas.fernandez@aspedia.de>
Tue, 16 Sep 2014 12:12:30 +0000 (14:12 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Tue, 16 Sep 2014 13:18:07 +0000 (15:18 +0200)
The Typo3DbBackend.php places a dummy where condition in case
$statementParts['where'] is empty. The condition is changed
for compatibility reasons with some DBMS.

Resolves: #61639
Releases: 6.3, 6.2
Change-Id: If3f23af43fea6460407e8b05f9bcd782c6e08f0d
Reviewed-on: http://review.typo3.org/32801
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php

index 05cc5a0..a76f821 100644 (file)
@@ -312,7 +312,7 @@ class Typo3DbBackend implements BackendInterface, \TYPO3\CMS\Core\SingletonInter
                return array(
                        'selectFields' => implode(' ', $statementParts['keywords']) . ' ' . implode(',', $statementParts['fields']),
                        'fromTable'    => implode(' ', $statementParts['tables']) . ' ' . implode(' ', $statementParts['unions']),
-                       'whereClause'  => (!empty($statementParts['where']) ? implode('', $statementParts['where']) : '1')
+                       'whereClause'  => (!empty($statementParts['where']) ? implode('', $statementParts['where']) : '1=1')
                                . (!empty($statementParts['additionalWhereClause'])
                                        ? ' AND ' . implode(' AND ', $statementParts['additionalWhereClause'])
                                        : ''