datapath: An expanded table should be larger than its predecessor
[openvswitch] / ovsdb / execution.c
index 176858240c87f1f294d03a3226155ceaf9d6bd9e..416016fd9ef3ff89758d6c87bd51653f6e54f51a 100644 (file)
@@ -364,10 +364,11 @@ ovsdb_execute_select(struct ovsdb_execution *x, struct ovsdb_parser *parser,
                                           &condition);
     }
     if (!error) {
-        error = ovsdb_column_set_from_json(columns_json, table, &columns);
+        error = ovsdb_column_set_from_json(columns_json, table->schema,
+                                           &columns);
     }
     if (!error) {
-        error = ovsdb_column_set_from_json(sort_json, table, &sort);
+        error = ovsdb_column_set_from_json(sort_json, table->schema, &sort);
     }
     if (!error) {
         struct ovsdb_row_set rows = OVSDB_ROW_SET_INITIALIZER;
@@ -451,6 +452,7 @@ struct mutate_row_cbdata {
     size_t n_matches;
     struct ovsdb_txn *txn;
     const struct ovsdb_mutation_set *mutations;
+    struct ovsdb_error **error;
 };
 
 static bool
@@ -459,10 +461,9 @@ mutate_row_cb(const struct ovsdb_row *row, void *mr_)
     struct mutate_row_cbdata *mr = mr_;
 
     mr->n_matches++;
-    ovsdb_mutation_set_execute(ovsdb_txn_row_modify(mr->txn, row),
-                               mr->mutations);
-
-    return true;
+    *mr->error = ovsdb_mutation_set_execute(ovsdb_txn_row_modify(mr->txn, row),
+                                            mr->mutations);
+    return *mr->error == NULL;
 }
 
 static struct ovsdb_error *
@@ -494,6 +495,7 @@ ovsdb_execute_mutate(struct ovsdb_execution *x, struct ovsdb_parser *parser,
         mr.n_matches = 0;
         mr.txn = x->txn;
         mr.mutations = &mutations;
+        mr.error = &error;
         ovsdb_query(table, &condition, mutate_row_cb, &mr);
         json_object_put(result, "count", json_integer_create(mr.n_matches));
     }
@@ -605,7 +607,8 @@ ovsdb_execute_wait(struct ovsdb_execution *x, struct ovsdb_parser *parser,
                                           &condition);
     }
     if (!error) {
-        error = ovsdb_column_set_from_json(columns_json, table, &columns);
+        error = ovsdb_column_set_from_json(columns_json, table->schema,
+                                           &columns);
     }
     if (!error) {
         if (timeout) {