# HG changeset patch # User Sylvain Thénault # Date 1311762417 -7200 # Node ID 0f49dd8e76b5382d15aaef8d389cecad0b0194b1 # Parent e5ba5de1d48537a5de3c74843e43fe9eabe457cf [rql2sql] don't introduce substitution for Int and Boolean constants. This is needed for COUNT(DISTINCT) support diff -r e5ba5de1d485 -r 0f49dd8e76b5 server/sources/rql2sql.py --- a/server/sources/rql2sql.py Tue Jul 26 16:50:06 2011 +0200 +++ b/server/sources/rql2sql.py Wed Jul 27 12:26:57 2011 +0200 @@ -1438,15 +1438,15 @@ value = constant.value if constant.type == 'etype': return value - if constant.type == 'Int' and isinstance(constant.parent, SortTerm): - return value + if constant.type == 'Int': # XXX Float? + return str(value) if constant.type in ('Date', 'Datetime'): rel = constant.relation() if rel is not None: rel._q_needcast = value return self.keyword_map[value]() if constant.type == 'Boolean': - value = self.dbhelper.boolean_value(value) + return self.dbhelper.boolean_value(value) if constant.type == 'Substitute': try: # we may found constant from simplified var in varmap