Re: [Django] #25772: ArrayField: incorrent len lookup on empty arrays

2015-11-25 Thread Django
#25772: ArrayField: incorrent len lookup on empty arrays
-+-
 Reporter:  mrAdm|Owner:  Tim
 |  Graham 
 Type:  Bug  |   Status:  closed
Component:  contrib.postgres |  Version:  1.8
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"3ec4e739dd4ac3f1dea92cdec858bf491f63d5e8" 3ec4e73]:
 {{{
 #!CommitTicketReference repository=""
 revision="3ec4e739dd4ac3f1dea92cdec858bf491f63d5e8"
 [1.8.x] Fixed #25772 -- Corrected __len lookup on ArrayField for empty
 arrays.

 Backport of 88fc9e2826044110b7b22577a227f122fe9c1fb5 from master
 }}}

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.2e7f94d899648e7fda0293a0608cfc83%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25772: ArrayField: incorrent len lookup on empty arrays

2015-11-25 Thread Django
#25772: ArrayField: incorrent len lookup on empty arrays
-+-
 Reporter:  mrAdm|Owner:  Tim
 |  Graham 
 Type:  Bug  |   Status:  closed
Component:  contrib.postgres |  Version:  1.8
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"e4bd6923bdc3216fe958f1b1c50e95f4f77e2ada" e4bd6923]:
 {{{
 #!CommitTicketReference repository=""
 revision="e4bd6923bdc3216fe958f1b1c50e95f4f77e2ada"
 [1.9.x] Fixed #25772 -- Corrected __len lookup on ArrayField for empty
 arrays.

 Backport of 88fc9e2826044110b7b22577a227f122fe9c1fb5 from master
 }}}

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.a40187f98885f996beec22a5de03a0f3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25772: ArrayField: incorrent len lookup on empty arrays

2015-11-25 Thread Django
#25772: ArrayField: incorrent len lookup on empty arrays
-+-
 Reporter:  mrAdm|Owner:  Tim
 |  Graham 
 Type:  Bug  |   Status:  closed
Component:  contrib.postgres |  Version:  1.8
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * owner:   => Tim Graham 
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"88fc9e2826044110b7b22577a227f122fe9c1fb5" 88fc9e28]:
 {{{
 #!CommitTicketReference repository=""
 revision="88fc9e2826044110b7b22577a227f122fe9c1fb5"
 Fixed #25772 -- Corrected __len lookup on ArrayField for empty arrays.
 }}}

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.ff5c56cab92a3ee595fc44f72af6edd3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25772: ArrayField: incorrent len lookup on empty arrays

2015-11-21 Thread Django
#25772: ArrayField: incorrent len lookup on empty arrays
--+
 Reporter:  mrAdm |Owner:
 Type:  Bug   |   Status:  new
Component:  contrib.postgres  |  Version:  1.8
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Uran198):

 * has_patch:  0 => 1


Comment:

 In case field is None coalesce will return 0. So,
 {{{
 SELECT * FROM ... WHERE COALESCE(array_length("field", 1), 0)=0
 }}}
 will also return entries with field==None.
 The solution is probably to change line in
 
https://github.com/django/django/blob/master/django/contrib/postgres/fields/array.py#L205
 to
 {{{#!python
 return '%s IS NOT NULL AND \
 coalesce(array_length(%s, 1), 0)' % (lhs, lhs), params
 }}}
 or
 {{{#!python
 return 'CASE WHEN %s IS NULL THEN NULL \
 ELSE coalesce(array_length(%s, 1), 0) \
 END' % (lhs, lhs), params
 }}}
 [https://github.com/django/django/pull/5705 PR]

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.3041ea92267b81c8fd70a4ebbdb1b38a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25772: ArrayField: incorrent len lookup on empty arrays (was: ArrayField: incorrent len lookup)

2015-11-19 Thread Django
#25772: ArrayField: incorrent len lookup on empty arrays
--+
 Reporter:  mrAdm |Owner:
 Type:  Bug   |   Status:  new
Component:  contrib.postgres  |  Version:  1.8
 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
--+
Changes (by timgraham):

 * stage:  Unreviewed => Accepted


Comment:

 Regression test attached.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.a69bf2bf201957b0835956c6b6a2649d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25772: ArrayField: incorrent len lookup on empty arrays

2015-11-19 Thread Django
#25772: ArrayField: incorrent len lookup on empty arrays
--+
 Reporter:  mrAdm |Owner:
 Type:  Bug   |   Status:  new
Component:  contrib.postgres  |  Version:  1.8
 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
--+
Changes (by timgraham):

 * Attachment "25772-test.diff" added.


--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.6e9ac49cb803d0b77c5a3ec502bb7f2b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.