git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
204bad2
)
ovsdb: Fix commit to disk of rows added to a table with all-default values.
author
Ben Pfaff
<blp@nicira.com>
Fri, 12 Feb 2010 19:13:24 +0000
(11:13 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Mon, 15 Feb 2010 19:28:39 +0000
(11:28 -0800)
ovsdb/file.c
patch
|
blob
|
history
tests/ovsdb-execution.at
patch
|
blob
|
history
diff --git
a/ovsdb/file.c
b/ovsdb/file.c
index
716ea89
..
31086af
100644
(file)
--- a/
ovsdb/file.c
+++ b/
ovsdb/file.c
@@
-254,7
+254,7
@@
ovsdb_file_replica_change_cb(const struct ovsdb_row *old,
} else {
struct shash_node *node;
} else {
struct shash_node *node;
- row =
NULL
;
+ row =
old ? NULL : json_object_create()
;
SHASH_FOR_EACH (node, &new->table->schema->columns) {
const struct ovsdb_column *column = node->data;
const struct ovsdb_type *type = &column->type;
SHASH_FOR_EACH (node, &new->table->schema->columns) {
const struct ovsdb_column *column = node->data;
const struct ovsdb_type *type = &column->type;
diff --git
a/tests/ovsdb-execution.at
b/tests/ovsdb-execution.at
index
ca155a1
..
ed28b2a
100644
(file)
--- a/
tests/ovsdb-execution.at
+++ b/
tests/ovsdb-execution.at
@@
-51,6
+51,22
@@
m4_define([OVSDB_CHECK_EXECUTION],
AT_CLEANUP])
m4_define([EXECUTION_EXAMPLES], [
AT_CLEANUP])
m4_define([EXECUTION_EXAMPLES], [
+dnl At one point the "commit" code ignored new rows with all-default values,
+dnl so this checks for that problem.
+OVSDB_CHECK_EXECUTION([insert default row, query table],
+ [ORDINAL_SCHEMA],
+ [[[["ordinals",
+ {"op": "insert",
+ "table": "ordinals",
+ "row": {}}]]],
+ [[["ordinals",
+ {"op": "select",
+ "table": "ordinals",
+ "where": []}]]]],
+ [[[{"uuid":["uuid","<0>"]}]
+[{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<1>"],"name":"","number":0}]}]
+]])
+
OVSDB_CHECK_EXECUTION([insert row, query table],
[ORDINAL_SCHEMA],
[[[["ordinals",
OVSDB_CHECK_EXECUTION([insert row, query table],
[ORDINAL_SCHEMA],
[[[["ordinals",