ovsdb-idl: Fix deletion of modified row.
authorBen Pfaff <blp@nicira.com>
Fri, 11 Dec 2009 21:16:15 +0000 (13:16 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 11 Dec 2009 21:26:08 +0000 (13:26 -0800)
If the transaction modified a row and then deleted it, the IDL would
instead mistakenly leave the row entirely untouched.

This commit fixes this bug.  It needs a regression test, but this commit
does not add one.

lib/ovsdb-idl.c

index 98ec3dd55a2318afb440bfe3df3f04a25c21ae92..409ddb0d074dc9849efaee2dfeafe3c6ac8a6ccf 100644 (file)
@@ -1141,11 +1141,8 @@ ovsdb_idl_txn_delete(struct ovsdb_idl_row *row)
         hmap_insert(&row->table->idl->txn->txn_rows, &row->txn_node,
                     uuid_hash(&row->uuid));
     }
-    if (row->new == row->old) {
-        row->new = NULL;
-    } else {
-        ovsdb_idl_row_clear_new(row);
-    }
+    ovsdb_idl_row_clear_new(row);
+    row->new = NULL;
 }
 
 struct ovsdb_idl_row *