DISTINCT option logic incorrect in Database::makeSelectOptions
Closed, ResolvedPublic


Author: rhaertel80

When using Database::select and specifying the "DISTINCT" option, DISTINCT is never added to the query. Turns out to be a logic flaw (line 1135 of Rev 23756 of Database.php):

if ( isset( $noKeyOptions['DISTINCT'] ) && isset( $noKeyOptions['DISTINCTROW'] ) ) $startOpts .= 'DISTINCT';

The "&&" should be change to an "||"

Version: 1.11.x
Severity: trivial

bzimport added a project: MediaWiki-API.Via ConduitNov 21 2014, 9:52 PM
bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz10496.
bzimport created this task.Via LegacyJul 7 2007, 9:43 PM
Yurik added a comment.Via ConduitJul 7 2007, 9:53 PM

fixed in 23857

Add Comment