﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29315	exclude with OneToOneField produces incorrect results on sqlite	Raphael Kimmig	nobody	"When excluding instances where the related model has a certain field value
instances where no related model exists are excluded as well. This happens
with sqlite 3.16.2 on mac os. 

Using postgresql with psycopg2 I was unable to reproduce the issue.

{{{
from django.db import models


class A(models.Model):
    pass


class B(models.Model):
    a = models.OneToOneField(A)
    value = models.IntegerField()


def test():
    A.objects.all().delete()
    B.objects.all().delete()

    A.objects.create()
    assert A.objects.exclude(b__value=12345).count() == 1, ""We expect to get one A but got zero.""
}}}"	Bug	closed	Database layer (models, ORM)	2.0	Normal	invalid			Unreviewed	0	0	0	0	0	0
