summaryrefslogtreecommitdiff
path: root/tests/ovsdb-execution.at
blob: e72bf0606978ed683521e5807ea424efa9d5d83c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
AT_BANNER([OVSDB -- execution])

m4_divert_push([PREPARE_TESTS])
[

ordinal_schema () {
    cat <<'EOF'
    {"name": "ordinals",
     "tables": {
       "ordinals": {
         "columns": {
           "number": {"type": "integer"},
           "name": {"type": "string"}},
         "indexes": [["number"]]}},
     "version": "5.1.3",
     "cksum": "12345678 9"}
EOF
}

constraint_schema () {
    cat << 'EOF'
    {"name": "constraints",
     "tables": {
       "a": {
         "columns": {
           "a": {"type": "integer"},
           "a2a": {"type": {"key": {"type": "uuid", "refTable": "a"},
                            "min": 0, "max": "unlimited"}},
           "a2b": {"type": {"key": {"type": "uuid", "refTable": "b"},
                            "min": 0, "max": "unlimited"}}}},
       "b": {
         "columns": {
           "b": {"type": "integer"},
           "b2a": {"type": {"key": {"type": "uuid", "refTable": "a"},
                            "min": 0, "max": "unlimited"}},
           "b2b": {"type": {"key": {"type": "uuid", "refTable": "b"},
                            "min": 0, "max": "unlimited"}},
           "x": {"type": {"key": "integer", "min": 1, "max": 2}}}},
       "constrained": {
         "columns": {
           "positive": {"type": {"key": {"type": "integer",
                                         "minInteger": 1}}}},
         "maxRows": 1}}}
EOF
}

weak_schema () {
    cat <<'EOF'
    {"name": "weak",
     "tables": {
       "a": {
         "columns": {
           "a": {"type": "integer"},
           "a2a": {"type": {"key": {"type": "uuid",
                                    "refTable": "a",
                                    "refType": "weak"},
                            "min": 0, "max": "unlimited"}},
           "a2a1": {"type": {"key": {"type": "uuid",
                                     "refTable": "a",
                                     "refType": "weak"}}},
           "a2b": {"type": {"key": {"type": "uuid",
                                    "refTable": "b",
                                    "refType": "weak"}}}}},
       "b": {
         "columns": {
           "b": {"type": "integer"},
           "b2a": {"type": {"key": {"type": "uuid",
                                    "refTable": "a",
                                    "refType": "weak"},
                            "min": 0, "max": "unlimited"}}}}}}
EOF
}

gc_schema () {
    cat <<'EOF'
    {"name": "gc",
     "tables": {
       "root": {
         "columns": {
           "a": {"type": {"key": {"type": "uuid",
                                  "refTable": "a"},
                            "min": 0, "max": "unlimited"}}},
         "isRoot": true},
       "a": {
         "columns": {
           "a": {"type": "integer"},
           "a2a": {"type": {"key": {"type": "uuid",
                                    "refTable": "a"},
                            "min": 0, "max": "unlimited"}},
           "a2b": {"type": {"key": {"type": "uuid",
                                    "refTable": "b"},
                            "min": 0, "max": "unlimited"}},
           "wa2a": {"type": {"key": {"type": "uuid",
                                     "refTable": "a",
                                     "refType": "weak"},
                             "min": 0, "max": "unlimited"}},
           "wa2b": {"type": {"key": {"type": "uuid",
                                    "refTable": "b",
                                    "refType": "weak"},
                             "min": 0, "max": "unlimited"}}}},
       "b": {
         "columns": {
           "b": {"type": "integer"},
           "b2a": {"type": {"key": {"type": "uuid",
                                    "refTable": "a"},
                            "min": 0, "max": "unlimited"}},
           "wb2a": {"type": {"key": {"type": "uuid",
                                     "refTable": "a",
                                     "refType": "weak"},
                             "min": 0, "max": "unlimited"}}},
         "isRoot": false}}}
EOF
}

immutable_schema () {
    cat <<'EOF'
{"name": "immutable",
 "tables": {
    "a": {
        "columns": {"i": {"type": "integer", "mutable": false}}}}}
EOF
}
]
m4_divert_pop([PREPARE_TESTS])

#
# OVSDB_CHECK_EXECUTION_RO(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
#
# Runs "test-ovsdb execute-readonly" with the given SCHEMA and each of the
# TRANSACTIONS (which should be a quoted list of quoted strings).
#
# Checks that the overall output is OUTPUT, but UUIDs in the output
# are replaced by markers of the form <N> where N is a number.  The
# first unique UUID is replaced by <0>, the next by <1>, and so on.
# If a given UUID appears more than once it is always replaced by the
# same marker.
#
# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
m4_define([OVSDB_CHECK_EXECUTION_RO],
  [AT_SETUP([$1])
   AT_KEYWORDS([ovsdb execute execution positive $5])
   AT_CHECK([test-ovsdb execute-readonly "`$2`" m4_foreach([txn], [$3],
                                         [ 'txn'])], [0], [stdout], [])
   AT_CHECK([uuidfilt stdout], [0], [$4])
   AT_CLEANUP])

OVSDB_CHECK_EXECUTION_RO([block insert on read only DB],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {}}]]]],
  [[[{"details":"insert operation not allowed when database server is in read only mode","error":"not allowed"}]
]])

OVSDB_CHECK_EXECUTION_RO([allow select on read only DB],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": []}]]]],
  [[[{"rows":[]}]
]])

# OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
#
# Runs "test-ovsdb execute" with the given SCHEMA and each of the
# TRANSACTIONS (which should be a quoted list of quoted strings).
#
# Checks that the overall output is OUTPUT, but UUIDs in the output
# are replaced by markers of the form <N> where N is a number.  The
# first unique UUID is replaced by <0>, the next by <1>, and so on.
# If a given UUID appears more than once it is always replaced by the
# same marker.
#
# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
m4_define([OVSDB_CHECK_EXECUTION],
  [AT_SETUP([$1])
   AT_KEYWORDS([ovsdb execute execution positive $5])
   AT_CHECK([test-ovsdb execute "`$2`" m4_foreach([txn], [$3], [ 'txn'])],
     [0], [stdout], [])
   AT_CHECK([uuidfilt stdout], [0], [$4])
   AT_CLEANUP])

OVSDB_CHECK_EXECUTION([uuid-name must be <id>],
  [constraint_schema],
  [[[["constraints",
      {"op": "insert",
       "table": "a",
       "row": {},
       "uuid-name": "0"}]]]],
  [[[{"details":"Parsing ovsdb operation 1 of 1 failed: Type mismatch for member 'uuid-name'.","error":"syntax error","syntax":"{\"op\":\"insert\",\"row\":{},\"table\":\"a\",\"uuid-name\":\"0\"}"}]
]])

OVSDB_CHECK_EXECUTION([named-uuid must be <id>],
  [constraint_schema],
  [[[["constraints",
      {"op": "insert",
       "table": "a",
       "row": {"a2a": ["named-uuid", "0"]}}]]]],
  [[[{"details":"named-uuid string is not a valid <id>","error":"syntax error","syntax":"[\"named-uuid\",\"0\"]"}]
]])

OVSDB_CHECK_EXECUTION([duplicate uuid-name not allowed],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {},
       "uuid-name": "x"},
      {"op": "insert",
       "table": "ordinals",
       "row": {},
       "uuid-name": "x"}]]]],
  [[[{"uuid":["uuid","<0>"]},{"details":"This \"uuid-name\" appeared on an earlier \"insert\" operation.","error":"duplicate uuid-name","syntax":"\"x\""}]
]])

m4_define([ONE_EXECUTION_EXAMPLE], [dnl
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}]}]
]])
])

m4_define([EXECUTION_EXAMPLES], [
ONE_EXECUTION_EXAMPLE
OVSDB_CHECK_EXECUTION([insert row, query table],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}}]]],
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": []}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<1>"],"name":"zero","number":0}]}]
]])

OVSDB_CHECK_EXECUTION([insert row with uuid, query table],
  [ordinal_schema],
dnl Insert initial row.
  [[[["ordinals",
      {"op": "insert",
       "uuid": "ffffffff-971b-4cba-bf42-520515973b7e",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}}]]],
dnl Query row back.
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": []}]]],
dnl Attempt to insert second row with same UUID (fails).
   [[["ordinals",
      {"op": "insert",
       "uuid": "ffffffff-971b-4cba-bf42-520515973b7e",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}}]]]],
  [[[{"uuid":["uuid","ffffffff-971b-4cba-bf42-520515973b7e"]}]
[{"rows":[{"_uuid":["uuid","ffffffff-971b-4cba-bf42-520515973b7e"],"_version":["uuid","<0>"],"name":"zero","number":0}]}]
[{"details":"This UUID would duplicate a UUID already present within the table or deleted within the same transaction.","error":"duplicate uuid","syntax":"\"ffffffff-971b-4cba-bf42-520515973b7e\""}]
]])

OVSDB_CHECK_EXECUTION([insert rows, query by value],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}}]]],
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}}]]],
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": [["name", "==", "zero"]]}]]],
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": [["name", "==", "one"]]}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"uuid":["uuid","<1>"]}]
[{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<2>"],"name":"zero","number":0}]}]
[{"rows":[{"_uuid":["uuid","<1>"],"_version":["uuid","<3>"],"name":"one","number":1}]}]
]])

OVSDB_CHECK_EXECUTION([insert rows, query by named-uuid],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"},
       "uuid-name": "first"},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"},
       "uuid-name": "second"},
      {"op": "select",
       "table": "ordinals",
       "where": [["_uuid", "==", ["named-uuid", "first"]]]},
      {"op": "select",
       "table": "ordinals",
       "where": [["_uuid", "==", ["named-uuid", "second"]]]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<2>"],"name":"zero","number":0}]},{"rows":[{"_uuid":["uuid","<1>"],"_version":["uuid","<3>"],"name":"one","number":1}]}]
]])

OVSDB_CHECK_EXECUTION([insert rows, update rows by value],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "update",
       "table": "ordinals",
       "where": [["name", "==", "zero"]],
       "row": {"name": "nought"}}]]],
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": [],
       "sort": ["number"]}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"uuid":["uuid","<1>"]}]
[{"count":1}]
[{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<2>"],"name":"nought","number":0},{"_uuid":["uuid","<1>"],"_version":["uuid","<3>"],"name":"one","number":1}]}]
]])

OVSDB_CHECK_EXECUTION([insert rows, mutate rows],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "mutate",
       "table": "ordinals",
       "where": [["name", "==", "zero"]],
       "mutations": [["number", "+=", 2]]}]]],
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": [],
       "sort": ["number"]}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"uuid":["uuid","<1>"]}]
[{"count":1}]
[{"rows":[{"_uuid":["uuid","<1>"],"_version":["uuid","<2>"],"name":"one","number":1},{"_uuid":["uuid","<0>"],"_version":["uuid","<3>"],"name":"zero","number":2}]}]
]])

OVSDB_CHECK_EXECUTION([insert rows, delete by named-uuid],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"},
       "uuid-name": "first"},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"},
       "uuid-name": "second"},
      {"op": "delete",
       "table": "ordinals",
       "where": [["_uuid", "==", ["named-uuid", "first"]]]},
      {"op": "select",
       "table": "ordinals",
       "where": [],
       "columns": ["name","number"]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"count":1},{"rows":[{"name":"one","number":1}]}]
]])

OVSDB_CHECK_EXECUTION([insert rows, delete rows by value],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "delete",
       "table": "ordinals",
       "where": [["name", "==", "zero"]]}]]],
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": []}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"uuid":["uuid","<1>"]}]
[{"count":1}]
[{"rows":[{"_uuid":["uuid","<1>"],"_version":["uuid","<2>"],"name":"one","number":1}]}]
]])

OVSDB_CHECK_EXECUTION([insert rows, delete by (non-matching) value],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"},
       "uuid-name": "first"}]]],
   [[["ordinals",
      {"op": "delete",
       "table": "ordinals",
       "where": [["name", "==", "nought"]]}]]],
   [[["ordinals",
      {"op": "select",
       "table": "ordinals",
       "where": [],
       "sort": ["number"]}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"uuid":["uuid","<1>"]}]
[{"count":0}]
[{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<2>"],"name":"zero","number":0},{"_uuid":["uuid","<1>"],"_version":["uuid","<3>"],"name":"one","number":1}]}]
]])

OVSDB_CHECK_EXECUTION([insert rows, delete all],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"},
       "uuid-name": "first"},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"},
       "uuid-name": "second"},
      {"op": "delete",
       "table": "ordinals",
       "where": []},
      {"op": "select",
       "table": "ordinals",
       "where": [],
       "columns": ["name","number"]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"count":2},{"rows":[]}]
]])

OVSDB_CHECK_EXECUTION([insert row, query table, commit],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "select",
       "table": "ordinals",
       "where": []},
      {"op": "commit",
       "durable": false}]]]],
  [[[{"uuid":["uuid","<0>"]},{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<1>"],"name":"zero","number":0}]},{}]
]])

OVSDB_CHECK_EXECUTION([insert row, query table, commit durably],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "select",
       "table": "ordinals",
       "where": []},
      {"op": "commit",
       "durable": true}]]]],
  [[[{"uuid":["uuid","<0>"]},{"rows":[{"_uuid":["uuid","<0>"],"_version":["uuid","<1>"],"name":"zero","number":0}]},{}]
]])

OVSDB_CHECK_EXECUTION([equality wait with correct rows],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}},
      {"op": "wait",
       "timeout": 0,
       "table": "ordinals",
       "where": [],
       "columns": ["name", "number"],
       "until": "==",
       "rows": [{"name": "zero", "number": 0},
                {"name": "one", "number": 1}]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{}]
]])

OVSDB_CHECK_EXECUTION([equality wait with extra row],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}},
      {"op": "wait",
       "timeout": 0,
       "table": "ordinals",
       "where": [],
       "columns": ["name", "number"],
       "until": "==",
       "rows": [{"name": "zero", "number": 0},
                {"name": "one", "number": 1},
                {"name": "two", "number": 2}]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"where\" clause test failed","error":"timed out"}]
]])

OVSDB_CHECK_EXECUTION([equality wait with missing row],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}},
      {"op": "wait",
       "timeout": 0,
       "table": "ordinals",
       "where": [],
       "columns": ["name", "number"],
       "until": "==",
       "rows": [{"name": "one", "number": 1}]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"where\" clause test failed","error":"timed out"}]
]])

OVSDB_CHECK_EXECUTION([inequality wait with correct rows],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}},
      {"op": "wait",
       "timeout": 0,
       "table": "ordinals",
       "where": [],
       "columns": ["name", "number"],
       "until": "!=",
       "rows": [{"name": "zero", "number": 0},
                {"name": "one", "number": 1}]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"where\" clause test failed","error":"timed out"}]
]])

OVSDB_CHECK_EXECUTION([inequality wait with extra row],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}},
      {"op": "wait",
       "timeout": 0,
       "table": "ordinals",
       "where": [],
       "columns": ["name", "number"],
       "until": "!=",
       "rows": [{"name": "zero", "number": 0},
                {"name": "one", "number": 1},
                {"name": "two", "number": 2}]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{}]
]])

OVSDB_CHECK_EXECUTION([inequality wait with missing row],
  [ordinal_schema],
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 0, "name": "zero"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}},
      {"op": "wait",
       "timeout": 0,
       "table": "ordinals",
       "where": [],
       "columns": ["name", "number"],
       "until": "!=",
       "rows": [{"name": "one", "number": 1}]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{}]
]])

OVSDB_CHECK_EXECUTION([insert and update constraints],
  [constraint_schema],
  [[[["constraints",
      {"op": "insert",
       "table": "constrained",
       "row": {}}]]],
   [[["constraints",
      {"op": "insert",
       "table": "constrained",
       "row": {"positive": -1}}]]],
   [[["constraints",
      {"op": "update",
       "table": "constrained",
       "where": [],
       "row": {"positive": -2}}]]],
   [[["constraints",
      {"op": "insert",
       "table": "constrained",
       "row": {"positive": 1}}]]],
   [[["constraints",
      {"op": "insert",
       "table": "constrained",
       "row": {"positive": 2}}]]]],
  [[[{"details":"0 is less than minimum allowed value 1","error":"constraint violation"}]
[{"details":"-1 is less than minimum allowed value 1","error":"constraint violation"}]
[{"details":"-2 is less than minimum allowed value 1","error":"constraint violation"}]
[{"uuid":["uuid","<0>"]}]
[{"uuid":["uuid","<1>"]},{"details":"transaction causes \"constrained\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)","error":"constraint violation"}]
]])

OVSDB_CHECK_EXECUTION([index uniqueness checking],
  [ordinal_schema],
dnl Insert initial row.
  [[[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}}]]],
dnl Try to insert row with identical value (fails).
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "another one"}}]]],
dnl Remove initial row and insert new row with identical value in a single
dnl transaction (succeeds).
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "another one"}},
      {"op": "delete",
       "table": "ordinals",
       "where": [["name", "==", "one"]]}]]],
dnl Remove row and insert two new rows with identical value in a single
dnl transaction (fails).
   [[["ordinals",
      {"op": "delete",
       "table": "ordinals",
       "where": []},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "one"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "still another one"}}]]],
dnl Add new row with different value (succeeds).
   [[["ordinals",
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 2, "name": "two"}}]]],
dnl Change rows so values collide (fails).
   [[["ordinals",
      {"op": "update",
       "table": "ordinals",
       "where": [],
       "row": {"number": 3}}]]],
dnl Swap rows' values (succeeds).
   [[["ordinals",
      {"op": "update",
       "table": "ordinals",
       "where": [["number", "==", 1]],
       "row": {"number": 2, "name": "old two"}},
      {"op": "update",
       "table": "ordinals",
       "where": [["name", "==", "two"]],
       "row": {"number": 1, "name": "old one"}}]]],
dnl Change all rows' values to values not used before and insert values that
dnl collide (only) with their previous values (succeeds).
   [[["ordinals",
      {"op": "mutate",
       "table": "ordinals",
       "where": [],
       "mutations": [["number", "*=", 10]]},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 1, "name": "new one"}},
      {"op": "insert",
       "table": "ordinals",
       "row": {"number": 2, "name": "new two"}},
      {"op": "select",
       "table": "ordinals",
       "where": [],
       "columns": ["number", "name"],
       "sort": ["number"]}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"uuid":["uuid","<1>"]},{"details":"Transaction causes multiple rows in \"ordinals\" table to have identical values (1) for index on column \"number\".  First row, with UUID <0>, existed in the database before this transaction and was not modified by the transaction.  Second row, with UUID <1>, was inserted by this transaction.","error":"constraint violation"}]
[{"uuid":["uuid","<2>"]},{"count":1}]
[{"count":1},{"uuid":["uuid","<3>"]},{"uuid":["uuid","<4>"]},{"details":"Transaction causes multiple rows in \"ordinals\" table to have identical values (1) for index on column \"number\".  First row, with UUID <4>, was inserted by this transaction.  Second row, with UUID <3>, was inserted by this transaction.","error":"constraint violation"}]
[{"uuid":["uuid","<5>"]}]
[{"count":2},{"details":"Transaction causes multiple rows in \"ordinals\" table to have identical values (3) for index on column \"number\".  First row, with UUID <5>, had the following index values before the transaction: 2.  Second row, with UUID <2>, had the following index values before the transaction: 1.","error":"constraint violation"}]
[{"count":1},{"count":1}]
[{"count":2},{"uuid":["uuid","<6>"]},{"uuid":["uuid","<7>"]},{"rows":[{"name":"new one","number":1},{"name":"new two","number":2},{"name":"old one","number":10},{"name":"old two","number":20}]}]
]])

OVSDB_CHECK_EXECUTION([referential integrity -- simple],
  [constraint_schema],
  [[[["constraints",
      {"op": "insert",
       "table": "b",
       "row": {"b": 1},
       "uuid-name": "brow"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 0,
               "a2b": ["set", [["named-uuid", "brow"]]]}},
      {"op": "insert",
       "table": "a",
       "row": {"a": 1,
               "a2b": ["set", [["named-uuid", "brow"]]]}},
      {"op": "insert",
       "table": "a",
       "row": {"a": 2,
               "a2b": ["set", [["named-uuid", "brow"]]]}}]]],
   [[["constraints",
      {"op": "delete",
       "table": "b",
       "where": []}]]],
dnl Check that "mutate" honors number-of-elements constraints on sets and maps.
   [[["constraints",
      {"op": "mutate",
       "table": "b",
       "where": [],
       "mutations": [["x", "delete", 0]]}]]],
   [[["constraints",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 0]]}]]],
   [[["constraints",
      {"op": "delete",
       "table": "b",
       "where": []}]]],
   [[["constraints",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 1]]}]]],
   [[["constraints",
      {"op": "delete",
       "table": "b",
       "where": []}]]],
   [[["constraints",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 2]]}]]],
   [[["constraints",
      {"op": "delete",
       "table": "b",
       "where": []}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]
[{"count":1},{"details":"cannot delete b row <0> because of 3 remaining reference(s)","error":"referential integrity violation"}]
[{"details":"Attempted to store 0 elements in set of 1 to 2 integers.","error":"constraint violation"}]
[{"count":1}]
[{"count":1},{"details":"cannot delete b row <0> because of 2 remaining reference(s)","error":"referential integrity violation"}]
[{"count":1}]
[{"count":1},{"details":"cannot delete b row <0> because of 1 remaining reference(s)","error":"referential integrity violation"}]
[{"count":1}]
[{"count":1}]
]])

OVSDB_CHECK_EXECUTION([referential integrity -- mutual references],
  [constraint_schema],
  [[[["constraints",
      {"op": "insert",
       "table": "a",
       "row": {"a": 0,
               "a2b": ["set", [["named-uuid", "row2"]]],
               "a2a": ["set", [["named-uuid", "row1"]]]},
       "uuid-name": "row1"},
      {"op": "insert",
       "table": "b",
       "row": {"b": 1,
               "b2b": ["set", [["named-uuid", "row2"]]],
               "b2a": ["set", [["named-uuid", "row1"]]]},
       "uuid-name": "row2"}]]],
   [[["constraints",
      {"op": "insert",
       "table": "a",
       "row": {"a2b": ["set", [["uuid", "b516b960-5b19-4fc2-bb82-fe1cbd6d0241"]]]}}]]],
   [[["constraints",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 0]]}]]],
   [[["constraints",
      {"op": "delete",
       "table": "b",
       "where": [["b", "==", 1]]}]]],
   dnl Try the deletions again to make sure that the refcounts got rolled back.
   [[["constraints",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 0]]}]]],
   [[["constraints",
      {"op": "delete",
       "table": "b",
       "where": [["b", "==", 1]]}]]],
   [[["constraints",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 0]]},
      {"op": "delete",
       "table": "b",
       "where": [["b", "==", 1]]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]
[{"uuid":["uuid","<2>"]},{"details":"Table a column a2b row <2> references nonexistent row <3> in table b.","error":"referential integrity violation"}]
[{"count":1},{"details":"cannot delete a row <0> because of 1 remaining reference(s)","error":"referential integrity violation"}]
[{"count":1},{"details":"cannot delete b row <1> because of 1 remaining reference(s)","error":"referential integrity violation"}]
[{"count":1},{"details":"cannot delete a row <0> because of 1 remaining reference(s)","error":"referential integrity violation"}]
[{"count":1},{"details":"cannot delete b row <1> because of 1 remaining reference(s)","error":"referential integrity violation"}]
[{"count":1},{"count":1}]
]])

OVSDB_CHECK_EXECUTION([weak references],
  [weak_schema],
  [[[["weak",
      {"op": "insert",
       "table": "a",
       "row": {"a": 0,
               "a2a": ["set", [["named-uuid", "row1"],
                               ["named-uuid", "row2"],
                               ["uuid", "0e767b36-6822-4044-8307-d58467e04669"]]],
               "a2a1": ["named-uuid", "row1"],
               "a2b": ["named-uuid", "row3"]},
       "uuid-name": "row1"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 1,
               "a2a": ["set", [["named-uuid", "row1"],
                               ["named-uuid", "row2"]]],
               "a2a1": ["named-uuid", "row2"],
               "a2b": ["named-uuid", "row3"]},
       "uuid-name": "row2"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 2,
               "a2a": ["set", [["named-uuid", "row1"],
                               ["named-uuid", "row2"]]],
               "a2a1": ["named-uuid", "row2"],
               "a2b": ["named-uuid", "row4"]}},
      {"op": "insert",
       "table": "b",
       "row": {"b": 2,
               "b2a": ["named-uuid", "row1"]},
       "uuid-name": "row3"},
      {"op": "insert",
       "table": "b",
       "row": {"b": 3,
               "b2a": ["named-uuid", "row2"]},
       "uuid-name": "row4"}]]],
   dnl Check that the nonexistent row UUID we added to row a0 was deleted,
   dnl and that other rows were inserted as requested.
   [[["weak",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["_uuid", "a2a", "a2a1", "a2b"],
       "sort": ["a"]}]]],
   [[["weak",
      {"op": "select",
       "table": "b",
       "where": [],
       "columns": ["_uuid", "b", "b2a"],
       "sort": ["b"]}]]],
   dnl Try to insert invalid all-zeros weak reference (the default) into
   dnl "a2b", which requires exactly one value.
   [[["weak",
      {"op": "insert",
       "table": "a",
       "row": {"a2a1": ["named-uuid", "me"]},
       "uuid-name": "me"}]]],
   dnl Try to delete row from "b" that is referred to by weak references
   dnl from "a" table "a2b" column that requires exactly one value.
   [[["weak",
      {"op": "delete",
       "table": "b",
       "where": [["b", "==", 3]]}]]],
   dnl Try to delete row from "a" that is referred to by weak references
   dnl from "a" table "a2a1" column that requires exactly one value.
   [[["weak",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 1]]}]]],
   dnl Delete the row that had the reference that caused the previous
   dnl deletion to fail, then check that other rows are unchanged.
   [[["weak",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 2]]}]]],
   [[["weak",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["_uuid", "a2a", "a2a1", "a2b"],
       "sort": ["a"]}]]],
   [[["weak",
      {"op": "select",
       "table": "b",
       "where": [],
       "columns": ["_uuid", "b", "b2a"],
       "sort": ["b"]}]]],
   dnl Delete row a0 then check that references to it were removed.
   [[["weak",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 0]]}]]],
   [[["weak",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["_uuid", "a2a", "a2a1", "a2b"],
       "sort": ["a"]}]]],
   [[["weak",
      {"op": "select",
       "table": "b",
       "where": [],
       "columns": ["_uuid", "b", "b2a"],
       "sort": ["b"]}]]],
   dnl Delete row a1 then check that references to it were removed.
   [[["weak",
      {"op": "delete",
       "table": "a",
       "where": [["a", "==", 1]]}]]],
   [[["weak",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["_uuid", "a2a", "a2a1", "a2b"],
       "sort": ["a"]}]]],
   [[["weak",
      {"op": "select",
       "table": "b",
       "where": [],
       "columns": ["_uuid", "b", "b2a"],
       "sort": ["b"]}]]]],
  [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]},{"uuid":["uuid","<4>"]}]
[{"rows":[{"_uuid":["uuid","<0>"],"a2a":["set",[["uuid","<0>"],["uuid","<1>"]]],"a2a1":["uuid","<0>"],"a2b":["uuid","<3>"]},{"_uuid":["uuid","<1>"],"a2a":["set",[["uuid","<0>"],["uuid","<1>"]]],"a2a1":["uuid","<1>"],"a2b":["uuid","<3>"]},{"_uuid":["uuid","<2>"],"a2a":["set",[["uuid","<0>"],["uuid","<1>"]]],"a2a1":["uuid","<1>"],"a2b":["uuid","<4>"]}]}]
[{"rows":[{"_uuid":["uuid","<3>"],"b":2,"b2a":["uuid","<0>"]},{"_uuid":["uuid","<4>"],"b":3,"b2a":["uuid","<1>"]}]}]
[{"uuid":["uuid","<5>"]},{"details":"Weak reference column \"a2b\" in \"a\" row <5> (inserted within this transaction) contained all-zeros UUID (probably as the default value for this column) but deleting this value caused a constraint volation because this column is not allowed to be empty.","error":"constraint violation"}]
[{"count":1},{"details":"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \"a2b\" in \"a\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.","error":"constraint violation"}]
[{"count":1},{"details":"Deletion of 1 weak reference(s) to deleted (or never-existing) rows from column \"a2a1\" in \"a\" row <2> caused this column to become empty, but constraints on this column disallow an empty column.","error":"constraint violation"}]
[{"count":1}]
[{"rows":[{"_uuid":["uuid","<0>"],"a2a":["set",[["uuid","<0>"],["uuid","<1>"]]],"a2a1":["uuid","<0>"],"a2b":["uuid","<3>"]},{"_uuid":["uuid","<1>"],"a2a":["set",[["uuid","<0>"],["uuid","<1>"]]],"a2a1":["uuid","<1>"],"a2b":["uuid","<3>"]}]}]
[{"rows":[{"_uuid":["uuid","<3>"],"b":2,"b2a":["uuid","<0>"]},{"_uuid":["uuid","<4>"],"b":3,"b2a":["uuid","<1>"]}]}]
[{"count":1}]
[{"rows":[{"_uuid":["uuid","<1>"],"a2a":["uuid","<1>"],"a2a1":["uuid","<1>"],"a2b":["uuid","<3>"]}]}]
[{"rows":[{"_uuid":["uuid","<3>"],"b":2,"b2a":["set",[]]},{"_uuid":["uuid","<4>"],"b":3,"b2a":["uuid","<1>"]}]}]
[{"count":1}]
[{"rows":[]}]
[{"rows":[{"_uuid":["uuid","<3>"],"b":2,"b2a":["set",[]]},{"_uuid":["uuid","<4>"],"b":3,"b2a":["set",[]]}]}]
]])

OVSDB_CHECK_EXECUTION([immutable columns],
  [immutable_schema],
  [[[["immutable",
      {"op": "insert",
       "table": "a",
       "row": {"i": 5},
       "uuid-name": "row1"}]]],
   [[["immutable",
      {"op": "update",
       "table": "a",
       "row": {"i": 10},
       "where": []}]]],
   [[["immutable",
      {"op": "update",
       "table": "a",
       "row": {"i": 5},
       "where": []}]]],
   [[["immutable",
      {"op": "mutate",
       "table": "a",
       "where": [],
       "mutations": [["i", "-=", 5]]}]]],
   [[["immutable",
      {"op": "mutate",
       "table": "a",
       "where": [],
       "mutations": [["i", "*=", 1]]}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"details":"Cannot update immutable column i in table a.","error":"constraint violation","syntax":"{\"op\":\"update\",\"row\":{\"i\":10},\"table\":\"a\",\"where\":[]}"}]
[{"details":"Cannot update immutable column i in table a.","error":"constraint violation","syntax":"{\"op\":\"update\",\"row\":{\"i\":5},\"table\":\"a\",\"where\":[]}"}]
[{"details":"Cannot mutate immutable column i in table a.","error":"constraint violation","syntax":"[\"i\",\"-=\",5]"}]
[{"details":"Cannot mutate immutable column i in table a.","error":"constraint violation","syntax":"[\"i\",\"*=\",1]"}]
]])

OVSDB_CHECK_EXECUTION([garbage collection],
  [gc_schema],
  [dnl Check that inserting a row without any references is a no-op.
   [[["gc",
      {"op": "insert",
       "table": "a",
       "row": {"a": 0}}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"]}]]],
   dnl Check that inserting a chain of rows that reference each other
   dnl in turn is also a no-op.
   [[["gc",
      {"op": "insert",
       "table": "a",
       "row": {"a": 0, "a2a": ["named-uuid", "row1"]},
       "uuid-name": "row0"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 1, "a2a": ["named-uuid", "row2"]},
       "uuid-name": "row1"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 2, "a2a": ["named-uuid", "row3"]},
       "uuid-name": "row2"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 3},
       "uuid-name": "row3"}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"]}]]],
   dnl Check that inserting a pair of rows that mutually reference each
   dnl other causes the rows to be retained.
   [[["gc",
      {"op": "insert",
       "table": "a",
       "row": {"a": 4, "a2a": ["named-uuid", "row5"]},
       "uuid-name": "row4"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 5, "a2a": ["named-uuid", "row4"]},
       "uuid-name": "row5"}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"],
       "sort": ["a"]}]]],
   dnl Check that unreferencing one of the rows causes the other to be deleted.
   [[["gc",
      {"op": "update",
       "table": "a",
       "where": [["a", "==", 4]],
       "row": {"a2a": ["set", []]}}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"]}]]],
   dnl Check that inserting a pair of rows that mutually weak reference each
   dnl other is a no-op.
   [[["gc",
      {"op": "insert",
       "table": "a",
       "row": {"a": 6, "wa2a": ["named-uuid", "row7"]},
       "uuid-name": "row6"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 7, "wa2a": ["named-uuid", "row6"]},
       "uuid-name": "row7"}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"]}]]],
   dnl Check that a circular chain of rows is retained.
   [[["gc",
      {"op": "insert",
       "table": "a",
       "row": {"a": 8, "a2a": ["named-uuid", "row9"]},
       "uuid-name": "row8"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 9, "a2a": ["named-uuid", "row10"]},
       "uuid-name": "row9"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 10, "a2a": ["named-uuid", "row11"]},
       "uuid-name": "row10"},
      {"op": "insert",
       "table": "a",
       "row": {"a": 11, "a2a": ["named-uuid", "row8"]},
       "uuid-name": "row11"}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"],
       "sort": ["a"]}]]],
   dnl Check that breaking the chain causes all of the rows to be deleted.
   [[["gc",
      {"op": "update",
       "table": "a",
       "where": [["a", "==", 9]],
       "row": {"a2a": ["set", []]}}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"]}]]],
   dnl Check that inserting a row only referenced by itself is a no-op.
   [[["gc",
      {"op": "insert",
       "table": "a",
       "row": {"a": 12, "a2a": ["named-uuid", "self"]},
       "uuid-name": "self"}]]],
   [[["gc",
      {"op": "select",
       "table": "a",
       "where": [],
       "columns": ["a"]}]]]],
  [[[{"uuid":["uuid","<0>"]}]
[{"rows":[]}]
[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]},{"uuid":["uuid","<4>"]}]
[{"rows":[]}]
[{"uuid":["uuid","<5>"]},{"uuid":["uuid","<6>"]}]
[{"rows":[{"a":4},{"a":5}]}]
[{"count":1}]
[{"rows":[]}]
[{"uuid":["uuid","<7>"]},{"uuid":["uuid","<8>"]}]
[{"rows":[]}]
[{"uuid":["uuid","<9>"]},{"uuid":["uuid","<10>"]},{"uuid":["uuid","<11>"]},{"uuid":["uuid","<12>"]}]
[{"rows":[{"a":8},{"a":9},{"a":10},{"a":11}]}]
[{"count":1}]
[{"rows":[]}]
[{"uuid":["uuid","<13>"]}]
[{"rows":[]}]
]])])

EXECUTION_EXAMPLES