mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[1.5.x] Fixed #20091 -- Oracle null promotion for empty strings
Backpatch of e17fa9e877
This commit is contained in:
@@ -1533,7 +1533,6 @@ class Queries6Tests(TestCase):
|
||||
|
||||
# Nested queries are possible (although should be used with care, since
|
||||
# they have performance problems on backends like MySQL.
|
||||
|
||||
self.assertQuerysetEqual(
|
||||
Annotation.objects.filter(notes__in=Note.objects.filter(note="n1")),
|
||||
['<Annotation: a1>']
|
||||
@@ -2142,3 +2141,11 @@ class NullJoinPromotionOrTest(TestCase):
|
||||
# so we can use INNER JOIN for it. However, we can NOT use INNER JOIN
|
||||
# for the b->c join, as a->b is nullable.
|
||||
self.assertEqual(str(qset.query).count('INNER JOIN'), 1)
|
||||
|
||||
class EmptyStringPromotionTests(TestCase):
|
||||
def test_empty_string_promotion(self):
|
||||
qs = RelatedObject.objects.filter(single__name='')
|
||||
if connection.features.interprets_empty_strings_as_nulls:
|
||||
self.assertIn('LEFT OUTER JOIN', str(qs.query))
|
||||
else:
|
||||
self.assertNotIn('LEFT OUTER JOIN', str(qs.query))
|
||||
|
||||
Reference in New Issue
Block a user