AT_BANNER([OVSDB -- execution])
m4_define([ORDINAL_SCHEMA],
- [[{"name": "mydb",
+ [[{"name": "ordinals",
"tables": {
"ordinals": {
"columns": {
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],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}}]]],
- [[[{"op": "select",
+ [[["ordinals",
+ {"op": "select",
"table": "ordinals",
"where": []}]]]],
[[[{"uuid":["uuid","<0>"]}]
OVSDB_CHECK_EXECUTION([insert rows, query by value],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}}]]],
- [[[{"op": "insert",
+ [[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 1, "name": "one"}}]]],
- [[[{"op": "select",
+ [[["ordinals",
+ {"op": "select",
"table": "ordinals",
"where": [["name", "==", "zero"]]}]]],
- [[[{"op": "select",
+ [[["ordinals",
+ {"op": "select",
"table": "ordinals",
"where": [["name", "==", "one"]]}]]]],
[[[{"uuid":["uuid","<0>"]}]
OVSDB_CHECK_EXECUTION([insert rows, query by named-uuid],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"},
"uuid-name": "first"},
OVSDB_CHECK_EXECUTION([insert rows, update rows by value],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"},
"uuid-name": "first"}]]],
- [[[{"op": "insert",
+ [[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 1, "name": "one"},
"uuid-name": "first"}]]],
- [[[{"op": "update",
+ [[["ordinals",
+ {"op": "update",
"table": "ordinals",
"where": [["name", "==", "zero"]],
"row": {"name": "nought"}}]]],
- [[[{"op": "select",
+ [[["ordinals",
+ {"op": "select",
"table": "ordinals",
"where": [],
"sort": ["number"]}]]]],
OVSDB_CHECK_EXECUTION([insert rows, mutate rows],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"},
"uuid-name": "first"}]]],
- [[[{"op": "insert",
+ [[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 1, "name": "one"},
"uuid-name": "first"}]]],
- [[[{"op": "mutate",
+ [[["ordinals",
+ {"op": "mutate",
"table": "ordinals",
"where": [["name", "==", "zero"]],
"mutations": [["number", "+=", 2]]}]]],
- [[[{"op": "select",
+ [[["ordinals",
+ {"op": "select",
"table": "ordinals",
"where": [],
"sort": ["number"]}]]]],
OVSDB_CHECK_EXECUTION([insert rows, delete by named-uuid],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"},
"uuid-name": "first"},
OVSDB_CHECK_EXECUTION([insert rows, delete rows by value],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"},
"uuid-name": "first"}]]],
- [[[{"op": "insert",
+ [[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 1, "name": "one"},
"uuid-name": "first"}]]],
- [[[{"op": "delete",
+ [[["ordinals",
+ {"op": "delete",
"table": "ordinals",
"where": [["name", "==", "zero"]]}]]],
- [[[{"op": "select",
+ [[["ordinals",
+ {"op": "select",
"table": "ordinals",
"where": []}]]]],
[[[{"uuid":["uuid","<0>"]}]
OVSDB_CHECK_EXECUTION([insert rows, delete by (non-matching) value],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"},
"uuid-name": "first"}]]],
- [[[{"op": "insert",
+ [[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 1, "name": "one"},
"uuid-name": "first"}]]],
- [[[{"op": "delete",
+ [[["ordinals",
+ {"op": "delete",
"table": "ordinals",
"where": [["name", "==", "nought"]]}]]],
- [[[{"op": "select",
+ [[["ordinals",
+ {"op": "select",
"table": "ordinals",
"where": [],
"sort": ["number"]}]]]],
OVSDB_CHECK_EXECUTION([insert rows, delete all],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"},
"uuid-name": "first"},
OVSDB_CHECK_EXECUTION([insert row, query table, commit],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "select",
OVSDB_CHECK_EXECUTION([insert row, query table, commit durably],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "select",
OVSDB_CHECK_EXECUTION([equality wait with correct rows],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "insert",
OVSDB_CHECK_EXECUTION([equality wait with extra row],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "insert",
OVSDB_CHECK_EXECUTION([equality wait with missing row],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "insert",
OVSDB_CHECK_EXECUTION([inequality wait with correct rows],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "insert",
OVSDB_CHECK_EXECUTION([inequality wait with extra row],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "insert",
OVSDB_CHECK_EXECUTION([inequality wait with missing row],
[ORDINAL_SCHEMA],
- [[[[{"op": "insert",
+ [[[["ordinals",
+ {"op": "insert",
"table": "ordinals",
"row": {"number": 0, "name": "zero"}},
{"op": "insert",
OVSDB_CHECK_EXECUTION([insert and update constraints],
[CONSTRAINT_SCHEMA],
- [[[[{"op": "insert",
+ [[[["constraints",
+ {"op": "insert",
"table": "constrained",
"row": {}}]]],
- [[[{"op": "insert",
+ [[["constraints",
+ {"op": "insert",
"table": "constrained",
"row": {"positive": -1}}]]],
- [[[{"op": "update",
+ [[["constraints",
+ {"op": "update",
"table": "constrained",
"where": [],
"row": {"positive": -2}}]]]],
OVSDB_CHECK_EXECUTION([referential integrity -- simple],
[CONSTRAINT_SCHEMA],
- [[[[{"op": "insert",
+ [[[["constraints",
+ {"op": "insert",
"table": "b",
"row": {"b": 1},
"uuid-name": "brow"},
"table": "a",
"row": {"a": 2,
"a2b": ["set", [["named-uuid", "brow"]]]}}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "b",
"where": []}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "a",
"where": [["a", "==", 0]]}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "b",
"where": []}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "a",
"where": [["a", "==", 1]]}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "b",
"where": []}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "a",
"where": [["a", "==", 2]]}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "b",
"where": []}]]]],
[[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]
OVSDB_CHECK_EXECUTION([referential integrity -- mutual references],
[CONSTRAINT_SCHEMA],
- [[[[{"op": "insert",
+ [[[["constraints",
+ {"op": "insert",
"table": "a",
"row": {"a": 0,
"a2b": ["set", [["named-uuid", "row2"]]],
"b2b": ["set", [["named-uuid", "row2"]]],
"b2a": ["set", [["named-uuid", "row1"]]]},
"uuid-name": "row2"}]]],
- [[[{"op": "insert",
+ [[["constraints",
+ {"op": "insert",
"table": "a",
"row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "a",
"where": [["a", "==", 0]]}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "b",
"where": [["b", "==", 1]]}]]],
dnl Try the deletions again to make sure that the refcounts got rolled back.
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "a",
"where": [["a", "==", 0]]}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "b",
"where": [["b", "==", 1]]}]]],
- [[[{"op": "delete",
+ [[["constraints",
+ {"op": "delete",
"table": "a",
"where": [["a", "==", 0]]},
{"op": "delete",