El jueves, 22 de mayo de 2014 03:24:12 UTC-3, Shai Berger escribió:
>
> Hi Maximiliano, 
>
> The issue of case in quoted and un-quoted names in SQL is indeed a sad 
> mess, 
> bad decisions made in the 1960s that we still need to live with today. 
>
> On Wednesday 21 May 2014 15:38:57 Maximiliano Robaina wrote: 
> > 
> > self.assertEqual(Author.objects.extra(where=["thing = 1"]).count(), 2) 
> > 
> > The problem here is what in this where clause, the "thing" field must be 
> > quoted. 
> > 
> > In firebird : 
> > 
> >     SELECT * FROM AUTHOR WHERE thing = 1   <-- Here thing (in lowercase) 
> > and THING (in uppercase) are equivalent, are the same object 
> > 
> > is different of: 
> > 
> >     SELECT * FROM AUTHOR WHERE "thing" = 1   <--  field is quoted 
> > 
>
> Quoting it uncoditionally would break the test on Oracle (which, by 
> default, 
> turns all the names to uppercase). There is a feature-flag for it... 
>

How this feature flag should works?
I see that Oracle backend is always making an upper in 
DatabaseOperations.quote_name, therefore, how does Oracle pass test like 
[1] where it is using field name in lowecase [2] ?

[1] https://github.com/django/django/blob/1.7b4/tests/schema/tests.py#L152
[2] https://github.com/django/django/blob/1.7b4/tests/schema/tests.py#L172


 

>
> > For a more generic test I think we need to avoid use .extra method or 
> > another raw sql statement. 
>
> ...but I agree -- an "extra" should not be needed at all in this specific 
> test. 
> The Author model has the added column as a field. 
>
> Shai. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/adadfd6d-143c-42dc-85e3-af38fcbd21b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to