Revision 5347
Added by Aaron Marcuse-Kubitza about 12 years ago
lib/sql.py | ||
---|---|---|
1033 | 1033 |
def simplify_expr(expr): |
1034 | 1034 |
expr = expr.replace('(NULL IS NULL)', 'true') |
1035 | 1035 |
expr = expr.replace('(NULL IS NOT NULL)', 'false') |
1036 |
expr = re.sub(r' OR '+bool_re+'|'+bool_re+r' OR ', r'', expr)
|
|
1036 |
expr = re.sub(logic_op_re('OR', bool_re), r'', expr)
|
|
1037 | 1037 |
while True: |
1038 | 1038 |
expr, n = re.subn(r'\((\([^()]*\))\)', r'\1', expr) |
1039 | 1039 |
if n == 0: break |
Also available in: Unified diff
sql.py: simplify_expr(): Use new logic_op_re()