]> git.proxmox.com Git - ovs.git/blobdiff - ovsdb/query.c
ovn: l3ha fix bundle action generation
[ovs.git] / ovsdb / query.c
index 878ac5b2d5731d64d85ff79000c11d57fe998f7d..de74519989c8014d264776bd88c5bff962e8c40d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009 Nicira Networks
+/* Copyright (c) 2009, 2010 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,16 +34,17 @@ ovsdb_query(struct ovsdb_table *table, const struct ovsdb_condition *cnd,
         const struct ovsdb_row *row;
 
         row = ovsdb_table_get_row(table, &cnd->clauses[0].arg.keys[0].uuid);
-        if (row && row->table == table && ovsdb_condition_evaluate(row, cnd)) {
+        if (row && row->table == table &&
+            ovsdb_condition_match_every_clause(row, cnd)) {
             output_row(row, aux);
         }
     } else {
         /* Linear scan. */
         const struct ovsdb_row *row, *next;
 
-        HMAP_FOR_EACH_SAFE (row, next, struct ovsdb_row, hmap_node,
-                            &table->rows) {
-            if (ovsdb_condition_evaluate(row, cnd) && !output_row(row, aux)) {
+        HMAP_FOR_EACH_SAFE (row, next, hmap_node, &table->rows) {
+            if (ovsdb_condition_match_every_clause(row, cnd) &&
+                !output_row(row, aux)) {
                 break;
             }
         }
@@ -82,7 +83,8 @@ ovsdb_query_distinct(struct ovsdb_table *table,
 {
     if (!columns || ovsdb_column_set_contains(columns, OVSDB_COL_UUID)) {
         /* All the result rows are guaranteed to be distinct anyway. */
-        return ovsdb_query_row_set(table, condition, results);
+        ovsdb_query_row_set(table, condition, results);
+        return;
     } else {
         /* Use hash table to drop duplicates. */
         struct ovsdb_row_hash_node *node;
@@ -90,8 +92,7 @@ ovsdb_query_distinct(struct ovsdb_table *table,
 
         ovsdb_row_hash_init(&hash, columns);
         ovsdb_query(table, condition, query_distinct_cb, &hash);
-        HMAP_FOR_EACH (node, struct ovsdb_row_hash_node, hmap_node,
-                       &hash.rows) {
+        HMAP_FOR_EACH (node, hmap_node, &hash.rows) {
             ovsdb_row_set_add_row(results, node->row);
         }
         ovsdb_row_hash_destroy(&hash, false);