← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1724177] Re: Sqlalchemy column in_() operator does not allow NULL element

 

Reviewed:  https://review.openstack.org/512908
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=d104ec67c90a9b0a1eae6f40644424b9df4b4156
Submitter: Zuul
Branch:    master

commit d104ec67c90a9b0a1eae6f40644424b9df4b4156
Author: Lujin <luo.lujin@xxxxxxxxxxxxxx>
Date:   Wed Oct 18 09:56:31 2017 +0900

    Add NULL check before passing to in_() column operator
    
    In some cases we may need to pass key=None filters to get_object()
    and get_objects() methods, however we lack of NULL check before these
    filters reach in_(), which will not return any matching queries in db
    layer.
    
    We need to do manual equals matches if NULL element exists in filters,
    instead of pass them to in_() operator.
    
    Change-Id: I7980b82e2627b7b097cae0a714d22e680cddd340
    Closes-Bug: #1724177


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1724177

Title:
  Sqlalchemy column in_() operator does not allow NULL  element

Status in neutron:
  Fix Released

Bug description:
  I met this issue when I was integrating Floating IP OVO objects. There
  would be a case that we want to pass router_id=None and
  fixed_port_id=None into get_objects() method [1], which eventually
  leads to this method [2].

  In my case, since when key is "router_id" and value is "[None]", the
  in_() clause in Line 205 will not return any matching queries, cause
  in_() does not support None element.

  We need to add a check if [2] when None is contained in value.

  [1] https://review.openstack.org/#/c/396351/34..35/neutron/db/l3_db.py@1429
  [2] https://github.com/openstack/neutron/blob/master/neutron/db/_model_query.py#L176

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1724177/+subscriptions


References