﻿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
13533	queries test fails under MySQL InnoDB	Russell Keith-Magee	nobody	"As of 1.2RC1, the queries test fails under MySQL InnoDB fails at the following test:
{{{
Failed example:
    Tag.objects.exclude(children=None)
Expected:
    [<Tag: t1>, <Tag: t3>]
Got:
    [<Tag: t1>, <Tag: t3>, <Tag: t4>]
}}}

This is at line 1150 (as of r13252).

This test passes as is under SQLite, Postgres, and MySQL MyISAM. 

Even more weird - if you dig into the database at the time the test runs, the query is the same, and the contents of the table is the same. The issue appears to be entirely related to a query cache somewhere in the MySQLdb infrastructure, but only under InnoDB.

You can make the test pass by inserting:
{{{
>>> connection.close()
}}}

just before the failing test. You can also make the test pass by manually issuing the same query twice, and only checking the test result on the second execution -- i.e., if you modify the test to the following:
{{{
>>> r = list(Tag.objects.exclude(children=None))
>>> Tag.objects.exclude(children=None)
[<Tag: t1>, <Tag: t3>]
}}}

The test will pass."	Bug	closed	Database layer (models, ORM)	1.2-beta	Normal	duplicate	innodb mysql	Sasha Romijn	Accepted	0	0	0	0	0	0
