On Mar 10, 2013, at 7:11 PM, Ian Kelly <[email protected]> wrote:

> #20015 looks like an expected failure.  Oracle supports lookups of
> date fields using strings by implicitly converting the string to a
> date.  The test is doing a startswith lookup that is going to produce
> sql that looks something like "WHERE date_column LIKE '2008%'".

If you have a date type, stick to a date type.  Converting to a varchar to run 
a like query is counterproductive. If one is looking for a date, just look for 
a date, e.g. ' extract( year from date_column ) = 2008 ' or such.

Otherwise, you must explicitly convert the date to a specific varchar format, 
e.g. . to_char( date_column, 'YYYYMMDD' ) like '2008%'

If you are not explicit, the session NLS format is applied, with unpredictable 
results.

> That's not going to work because Oracle can't convert '2008%' into a
> date.  So the test here is testing that the
> 'supports_date_lookup_using_string' feature is more comprehensive than
> Oracle actually supports.

Such string to date conversion depends on the session NSL settings if not 
explicit.


-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to