Oleg Broytmann wrote: > On Tue, Aug 07, 2007 at 11:02:25PM +0200, Johan Carlsson wrote: > >> def count(self): >> """ Counting elements of current select results """ >> assert not self.ops.get('limit'), "'limit' is meaningless with >> 'distinct'" <===== >> >> Is that that really right? Shouldn't it test for "distinct" also? >> > It's a typo. LIMIT is meaningless with COUNT, not DISTINCT (because LIMIT > will be applied after COUNT and COUNT returns only one row.) > In that cause, isn't kind of unnecessary: Because, limit is converted in to start/end in the __init__, like you said start/end is after the query.
Hm, after revising the code I get the feeling the start/end code in the post processing part of count isn't doing anything at all, but rather destroying the result. Reason, the start/end is already use in the query!? Isn't it. So the result would already be limited. >> And when limit is "sqlobject.sqlbuilder.NoDefault" it triggers, what's >> up with that? >> It only seems to allow count if limit=0!? >> > > Or None. ;) > Duh ;-D >> Bug? >> > Probably, though it's strange nobody has stumbled upon it yet. > Is there any tests for the SelectResults? I can't find any! Maybe it something I should put on my shoulders :-D /Johan ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss