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
//! The `CALL { … } IN TRANSACTIONS` body's row-production strategy
//! (ADR-0669): the statement-level admission [`batch_pass_admission`] and
//! the two producers it chooses between — the batch pass
//! ([`pass_batch_rows`], one clause-engine crossing over the whole batch)
//! and the per-row path ([`per_row_batch_rows`]). Split out of
//! `in_transactions.rs`, which keeps the arm's streaming loop, its
//! charging invariant, the option resolution and the error/status
//! rendering.
use BTreeMap;
use ;
use ;
use ;
use crateQueryCtx;
use crateChargedRows;
use cratebody_projects_rows;
use crateExecGraph;
use crateRow;
/// Whether an `IN TRANSACTIONS` body takes the batch pass (ADR-0669): a
/// single flat part, no `NEXT` stage, non-projecting, with no `WITH` and
/// no schema/admin DDL among its own clauses. Everything else about the
/// body runs in the pass exactly as its clause list would in a plain
/// statement over the batch's seed rows — `MATCH`, procedure `CALL`,
/// nested `CALL { … }`, conditionals, graph-reading expressions
/// included: pipeline order, one clause-engine invocation and one
/// nested-budget tick per batch, the per-row statement-engine loop
/// never entered. The batch commits per batch either way (ADR-0210);
/// what the pass removes is the per-row invocation, which is pure
/// overhead — the caller already named the batch.
///
/// The exclusions are structural, not semantic preferences:
/// - a `WITH`-carrying body needs the importing-scope re-attach
/// (`run_nested_clauses_scoped`), which re-attaches one scope row per
/// nested invocation — per-row by construction. The legacy
/// importing-`WITH` form keeps the per-row path with it;
/// - a projecting body (a trailing clause the canonical table says
/// spills rows — [`body_projects_rows`], the same classification the
/// per-row merge consults, never inferred from the clause set) merges
/// each body row back onto its originating outer row, a lineage the
/// pass does not track. A terminal `LOAD CSV` projects and stays
/// per-row with it.
/// - schema/admin DDL has no per-row work to batch and stays per-row.
///
/// The pass gives up Neo4j's per-row read-after-write interleaving — the
/// body evaluates the batch as a unit. That decision, its within-clause
/// coincidence and the smaller-batch remedy are recorded once in ADR-0669.
/// The batch pass (ADR-0669): the whole batch's scope seeds — the same
/// per-row [`scope_seed`] policy — in one [`execute_query_seeded`]
/// crossing, the batch's one nested-budget tick. A non-projecting
/// body's pass-through is the outer rows (the batch twin of the
/// per-row path's `outer.clone()`), so the crossing's own output is
/// discarded. Rollback stays with the caller's per-batch snapshot.
pub
/// The per-row path, for the bodies the pass cannot take (a
/// `WITH`-carrying body, a projecting body, schema/admin DDL): one
/// nested statement-engine invocation per row through
/// [`row_product`], the `OPTIONAL CALL` empty-body pad included.
pub