- if (!row_json) {
- struct json *op = json_object_create();
- json_array_add(operations, op);
- json_object_put_string(op, "op",
- row->old ? "update" : "insert");
- json_object_put_string(op, "table", class->name);
- if (row->old) {
- json_object_put(op, "where",
- where_uuid_equals(&row->uuid));
- } else {
- json_object_put(op, "uuid-name",
- json_string_create_nocopy(
- uuid_name_from_uuid(&row->uuid)));
- }
- row_json = json_object_create();
- json_object_put(op, "row", row_json);
- any_updates = true;
- }
- json_object_put(row_json, column->name,
- substitute_uuids(
- ovsdb_datum_to_json(&row->new[idx],
- &column->type),
- txn));
+ }
+
+ if (!row->old || !shash_is_empty(json_object(row_json))) {
+ json_array_add(operations, op);
+ any_updates = true;
+ } else {
+ json_destroy(op);