[ovs-discuss] OVSDB - match empty set?

Ben Pfaff blp at ovn.org
Fri Sep 7 02:31:01 UTC 2018


On Thu, Sep 06, 2018 at 09:49:14AM +0200, Hans Ole Rafaelsen wrote:
> How do I match an empty set (null reference) in a select?
> 
> I have a weak reference from one table to another as defined with:
> "network_status": {
>           "type": {
>             "key": {
>               "refTable": "NetworkStatus",
>               "refType": "weak",
>               "type": "uuid"},
>             "min": 0}},
> 
> When a row is deleted in NetworkStatus, ovsdb sets the reference value:
> "network_status": [
>           "set",
>           []]
> I would like to be able to find all rows which as no valid references. I
> have tried this:
> ovsdb-client transact tcp:127.0.0.1:6640 '
> ["Open_vSwitch",
>  {"op":"select",
>   "table": "Xinterface",
>   "columns" : ["name", "network_status"],
>   "where": [[ "network_status" , "==", ["set",[]] ]]
>  }]
> ' --prety
> which gives no match.
> The reverse gives all rows, also the one with the empty set.
> ovsdb-client transact tcp:127.0.0.1:6640 '
> ["Open_vSwitch",
>  {"op":"select",
>   "table": "Xinterface",
>   "columns" : ["name", "network_status"],
>   "where": [[ "network_status" , "!=", ["set",[]] ]]
>  }]
> ' --pretty

Well, this is certainly embarrassing.  Thank you for the report.

I sent out a patch series that fixes the bug, starting here:
        https://patchwork.ozlabs.org/patch/967183/



More information about the discuss mailing list