[TYPO3-core] FYI #15396: Wrong query - crashes with DBAL

Xavier Perseguers typo3 at perseguers.ch
Fri Aug 13 08:27:30 CEST 2010


Hi,

>> the problem rise up when you compute where clause with enableField
>> function which always add ' AND ...' which doesn't work with empty where
>> clause.
>
> I know, but in this case there's no enableField clause added afterwards.
>
>> Normal select should work with empty string though, but not NULL
>
> Indeed. So I would like to have '' instead of '1=1'.
>
>> Anyway adding "1=1" as dummy doesn't harm imho, having where present is
>> cleaner than omitting it, especially when you modify at later point.
>
> I disagree. I think having all these '1=1' lying around is really lousy
> programming style.

OK, what's the point here? Should I follow-up with an empty where clause 
as the first line of method quoteWhereClause() takes care of empty where 
clause:

if ($where_clause === '' || $this->runningNative()) return $where_clause;

Xavier


More information about the TYPO3-team-core mailing list