mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +00:00
ovsdb: Fix commit to disk of rows added to a table with all-default values.
This commit is contained in:
parent
204bad2940
commit
8894256573
@ -254,7 +254,7 @@ ovsdb_file_replica_change_cb(const struct ovsdb_row *old,
|
||||
} 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;
|
||||
|
@ -51,6 +51,22 @@ m4_define([OVSDB_CHECK_EXECUTION],
|
||||
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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user