Opened 13 years ago
Closed 13 years ago
#16694 closed Bug (fixed)
The test suite no longer runs under Oracle since r16678
Reported by: | Aymeric Augustin | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.3 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
http://ci.django-cms.org/job/Django/database=oracle,python=python2.7/190/console
I don't know why the problem happens only with Oracle, but I reproduce it on my own machines.
Attachments (1)
Change History (7)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|
*sigh* Anytime anybody claims Oracle supports SQL, people should feel free to laugh at them. Their NULL handling has been broken forever, in multiple places, and continues to hurt people (like us) trying to write portable SQL. This particular issue is because incorrectly Oracle compares NULL and "" to be equal and the Django backend tries to make things behave uniformly with respect to that.
It would be nice to avoid having to omit that test entirely (since null=True is entirely incorrect when written on a model pk field), but that means checking for explicit null=True versus when Oracle backend adds it implicitly. Alternative is to skip the test for the Oracle backend (which hurts in the multi-db case, I suspect).
comment:3 by , 13 years ago
On the grounds that it can't make things worse, I'm about to commit a one-liner that should fix this by not doing that validation in the "empty string is the same as NULL" case. I'll check the CI server in a day or two when it's had a chance to run the Oracle tests (:-D) and see if that helped.
comment:5 by , 13 years ago
Has patch: | set |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
The test suite now runs :) -- the CI server isn't *that* slow; since I've put Oracle's tablespaces in a ramfs it's purely CPU-bound.
However, the test added in r16678 fails under Oracle, because the validation doesn't happen :(
Patch attached, tested with Oracle 10g.
NB: I'm reopening this ticket instead of creating a new one because it's a follow-up on the same issue and all the history is on this page.
by , 13 years ago
Attachment: | 16694.patch added |
---|
In fact, it's certainly a consequence of this:
https://docs.djangoproject.com/en/dev/ref/databases/#null-and-empty-strings