Do not coerce a subquery into a select, create a proper select condition

Bug #1936675 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Rodolfo Alonso

Bug Description

When executing the UTs, we can see the following error:

    /opt/stack/neutron/neutron/db/db_base_plugin_v2.py:114: SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
  conditions |= (models_v2.Port.network_id.in_(

This is happening in method [1].

[1]https://github.com/openstack/neutron/blob/d20b8708bc03fa0dfe45656b48408b3f74a67709/neutron/db/db_base_plugin_v2.py#L111-L118

Changed in neutron:
importance: Undecided → Low
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/801076

Changed in neutron:
status: New → In Progress
summary: - Do no coerce a subquery into a select, create a proper select condition
+ Do not coerce a subquery into a select, create a proper select condition
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/801076
Committed: https://opendev.org/openstack/neutron/commit/923284fc3791949d93d7ded9820a44f98fc734b8
Submitter: "Zuul (22348)"
Branch: master

commit 923284fc3791949d93d7ded9820a44f98fc734b8
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Jul 16 14:55:55 2021 +0000

    Use explicit select condition in SQL query in "_port_filter_hook"

    Instead of executing a subquery inside a select, use a proper filter
    condition instead.

    Closes-Bug: #1936675
    Change-Id: I97e9ca244c0716510fcd4ec81d54046be9c5f8f8

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.0.0.0rc1

This issue was fixed in the openstack/neutron 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/844788

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/844788
Committed: https://opendev.org/openstack/neutron/commit/4e587d079e4aa31ad5e87566d3c06089914e39f7
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 4e587d079e4aa31ad5e87566d3c06089914e39f7
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Jul 16 14:55:55 2021 +0000

    Use explicit select condition in SQL query in "_port_filter_hook"

    Instead of executing a subquery inside a select, use a proper filter
    condition instead.

    Closes-Bug: #1936675
    Change-Id: I97e9ca244c0716510fcd4ec81d54046be9c5f8f8
    (cherry picked from commit 923284fc3791949d93d7ded9820a44f98fc734b8)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.5.0

This issue was fixed in the openstack/neutron 18.5.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.