Skip to content

Commit

Permalink
python.ovs.db.idl: Fix Row.delete() of a row already committed to the…
Browse files Browse the repository at this point in the history
… db.

Row.delete() handled the case of deleting a row that was added within the
current transaction, but not yet committed, but it did not correctly handle
the case of deleting a row that belonged to the database before the
transaction started.  This fixes the problem.

Reported-by: Yeming Zhao <[email protected]>
Tested-by: Yeming Zhao <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
blp committed Apr 8, 2013
1 parent ed87900 commit 8d3efc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Vishal Swarankar [email protected]
Vjekoslav Brajkovic [email protected]
Voravit T. [email protected]
YAMAMOTO Takashi [email protected]
Yeming Zhao [email protected]
Yongqiang Liu [email protected]
kk yap [email protected]
likunyun [email protected]
Expand Down
4 changes: 3 additions & 1 deletion python/ovs/db/idl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
# Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -610,6 +610,8 @@ def delete(self):
assert self._changes is not None
if self._data is None:
del self._idl.txn._txn_rows[self.uuid]
else:
self._idl.txn._txn_rows[self.uuid] = self
self.__dict__["_changes"] = None
del self._table.rows[self.uuid]

Expand Down

0 comments on commit 8d3efc1

Please sign in to comment.