X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fexecution.c;h=416016fd9ef3ff89758d6c87bd51653f6e54f51a;hb=1b3a91b5a35e6ffdc85ec373896532d266a6b795;hp=176858240c87f1f294d03a3226155ceaf9d6bd9e;hpb=d3d8f1f7e51c1808471e081c46ec631af7375272;p=openvswitch diff --git a/ovsdb/execution.c b/ovsdb/execution.c index 17685824..416016fd 100644 --- a/ovsdb/execution.c +++ b/ovsdb/execution.c @@ -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) {