|
@@ -436,14 +436,17 @@ WHEN (new.%(col_name)s IS NULL)
|
|
|
value.second, value.microsecond)
|
|
|
|
|
|
def combine_expression(self, connector, sub_expressions):
|
|
|
- "Oracle requires special cases for %% and & operators in query expressions"
|
|
|
+ lhs, rhs = sub_expressions
|
|
|
if connector == '%%':
|
|
|
return 'MOD(%s)' % ','.join(sub_expressions)
|
|
|
elif connector == '&':
|
|
|
return 'BITAND(%s)' % ','.join(sub_expressions)
|
|
|
elif connector == '|':
|
|
|
- lhs, rhs = sub_expressions
|
|
|
return 'BITAND(-%(lhs)s-1,%(rhs)s)+%(lhs)s' % {'lhs': lhs, 'rhs': rhs}
|
|
|
+ elif connector == '<<':
|
|
|
+ return '(%(lhs)s * POWER(2, %(rhs)s))' % {'lhs': lhs, 'rhs': rhs}
|
|
|
+ elif connector == '>>':
|
|
|
+ return 'FLOOR(%(lhs)s / POWER(2, %(rhs)s))' % {'lhs': lhs, 'rhs': rhs}
|
|
|
elif connector == '^':
|
|
|
return 'POWER(%s)' % ','.join(sub_expressions)
|
|
|
return super(DatabaseOperations, self).combine_expression(connector, sub_expressions)
|