#34080: __exact lookup on nested arrays with None values fails on PostgreSQL.
----------------------------------+------------------------------------
     Reporter:  Ion Alberdi       |                    Owner:  nobody
         Type:  Bug               |                   Status:  new
    Component:  contrib.postgres  |                  Version:  4.1
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by Ion Alberdi):

 I reproduce the bug in psycopg2

 Given the values above, django generates queries as
 {{{
 '(ARRAY[%s, %s])::integer[][]', [[None, 1], [None, None]]'
 }}}

 with
 {{{
 def test_psycopg2_all_none(self):
         with connection.cursor() as cursor:
             cursor.execute("SELECT ARRAY[%s]::integer[][]", ([None,
 None],))

 }}}

 I reproduce the bug in psycopg2 (2.9.3) as it fails with

 {{{
 invalid input syntax for type integer: "{NULL,NULL}"
                LINE 1: SELECT ARRAY['{NULL,NULL}']::integer[][]

 }}}


 By removing the ArrayRHSMixin, the test added in the PR above passes.
 However, by running the test_array suite with a PR that removes the
 ArrayRHSMixin I get the following result

 {{{
 FAILED (failures=6, errors=12, expected failures=3)
 }}}
 vs


 I'll open an issue in psycopg2 to get their point of view on

 {{{
 def test_psycopg2_all_none(self):
         with connection.cursor() as cursor:
             cursor.execute("SELECT ARRAY[%s]::integer[][]", ([None,
 None],))
 }}}

 Thanks again Mariusz!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34080#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070183c1ca3d70-adddfb48-f06e-4842-a1ba-4e089fc52f29-000000%40eu-central-1.amazonses.com.

Reply via email to