Project

General

Profile

« Previous | Next » 

Revision 2578

sql_gen.py CompareCond.to_str(), callers of combine_conds(): Removed unnecessary grouping () to make SQL clearer

View differences:

sql_gen.py
280 280
        # Create str
281 281
        str_ = left+' '+operator+' '+right
282 282
        if equals and not passthru_null_ref[0] and isinstance(right_value, Col):
283
            str_ += ' OR ('+left+' IS NULL AND '+right+' IS NULL)'
284
        if neg_ref[0]: str_ = 'NOT ('+str_+')'
283
            str_ = '('+str_+' OR ('+left+' IS NULL AND '+right+' IS NULL))'
284
        if neg_ref[0]: str_ = 'NOT '+str_
285 285
        return str_
286 286

  
287 287
# Tells as_ValueCond() to assume a non-ValueCond is a literal value
......
342 342
                right = CompareCond(as_Col(left, right_table), '~=')
343 343
            
344 344
            right = as_ValueCond(right, right_table)
345
            return '('+right.to_str(db, as_Col(left, left_table))+')'
345
            return right.to_str(db, as_Col(left, left_table))
346 346
        
347 347
        # Create join condition
348 348
        type_ = self.type_

Also available in: Unified diff