diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py
index 0951647..ac952d0 100644
|
a
|
b
|
class BaseDatabaseFeatures(object):
|
| 57 | 57 | has_real_datatype = False |
| 58 | 58 | supports_subqueries_in_group_by = True |
| 59 | 59 | supports_bitwise_or = True |
| | 60 | supports_bitwise_leftshift = True |
| | 61 | supports_bitwise_rightshift = True |
| 60 | 62 | |
| 61 | 63 | # Is there a true datatype for uuid? |
| 62 | 64 | has_native_uuid_field = False |
diff --git a/django/db/backends/oracle/features.py b/django/db/backends/oracle/features.py
index 1ef0f23..5ca1a27 100644
|
a
|
b
|
class DatabaseFeatures(BaseDatabaseFeatures):
|
| 20 | 20 | supports_timezones = False |
| 21 | 21 | has_zoneinfo_database = pytz is not None |
| 22 | 22 | supports_bitwise_or = False |
| | 23 | supports_bitwise_leftshift = False |
| | 24 | supports_bitwise_rightshift = False |
| 23 | 25 | has_native_duration_field = True |
| 24 | 26 | can_defer_constraint_checks = True |
| 25 | 27 | supports_partially_nullable_unique_constraints = False |
diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py
index 0651105..19e02ce 100644
|
a
|
b
|
WHEN (new.%(col_name)s IS NULL)
|
| 430 | 430 | return 'BITAND(%s)' % ','.join(sub_expressions) |
| 431 | 431 | elif connector == '|': |
| 432 | 432 | raise NotImplementedError("Bit-wise or is not supported in Oracle.") |
| | 433 | elif connector == '<<': |
| | 434 | raise NotImplementedError("Bit-wise left shift is not supported in Oracle.") |
| | 435 | elif connector == '>>': |
| | 436 | raise NotImplementedError("Bit-wise right shift is not supported in Oracle.") |
| 433 | 437 | elif connector == '^': |
| 434 | 438 | return 'POWER(%s)' % ','.join(sub_expressions) |
| 435 | 439 | return super(DatabaseOperations, self).combine_expression(connector, sub_expressions) |
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index 9a1d930..334ffa2 100644
|
a
|
b
|
class ExpressionOperatorTests(TestCase):
|
| 604 | 604 | self.assertEqual(Number.objects.get(pk=self.n.pk).integer, 40) |
| 605 | 605 | self.assertEqual(Number.objects.get(pk=self.n.pk).float, Approximate(15.500, places=3)) |
| 606 | 606 | |
| | 607 | @skipUnlessDBFeature('supports_bitwise_leftshift') |
| 607 | 608 | def test_lefthand_bitwise_binary_left_shift_operator(self): |
| 608 | 609 | Number.objects.filter(pk=self.n.pk).update(integer=F('integer').bitleftshift(2)) |
| 609 | 610 | self.assertEqual(Number.objects.get(pk=self.n.pk).integer, 168) |
| 610 | 611 | |
| | 612 | @skipUnlessDBFeature('supports_bitwise_rightshift') |
| 611 | 613 | def test_lefthand_bitwise_binary_right_shift_operator(self): |
| 612 | 614 | Number.objects.filter(pk=self.n.pk).update(integer=F('integer').bitrightshift(2)) |
| 613 | 615 | self.assertEqual(Number.objects.get(pk=self.n.pk).integer, 10) |