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
//! Centralized TTC field-version gates (the "version surface").
//!
//! Every place the wire format of a message depends on the negotiated TTC field
//! version (`Capabilities.ttc_field_version` in the reference thin driver) is a
//! *gate*: a conditional field that a server below the boundary does not read or
//! send, so emitting it unconditionally shifts every following byte and corrupts
//! the call. Historically these gates were scattered as raw
//! `if ttc_field_version >= TNS_CCAP_FIELD_VERSION_X { .. }` literals next to the
//! bytes they guard, which made a gate easy to forget on the write side (the DPL
//! / TPC / EXECUTE oaccolid bugs were exactly this) and impossible to enumerate.
//!
//! Each predicate here is the **single** definition of one version decision. A
//! call site reaches for the named predicate instead of re-spelling the literal,
//! so the whole surface is greppable (`grep version_gates::`) and every decision
//! is documented against the reference `_caps.ttc_field_version >= ...` check it
//! mirrors, byte-for-byte (same constant, same `>=` direction). Adding a new
//! version-dependent field means adding a named predicate here, which the
//! reference-gate coverage audit (`scripts/extract_reference_gates.sh`) and the
//! offline boundary tests pin to their exact flip point.
//!
//! These are `const fn` and take the raw `ttc_field_version: u8` (the value
//! already threaded through the sans-io codecs) rather than a `&Capabilities`,
//! so they impose no new public surface and no signature churn on the wire
//! builders.
use ;
/// The `ub8` pipeline-token field on every function / piggyback message header.
///
/// Reference `messages/base.pyx` `_write_function_code` (lines 700 / 714) writes
/// `ub8 token_num` only when `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_23_1_EXT_1`;
/// a pre-23ai server parses a stray token byte as message content and fails the
/// call (observed live: ORA-03120 on Oracle XE 21c). Pipelining (nonzero tokens)
/// only occurs on a 23ai-negotiated connection, so no token is ever dropped.
pub const
/// The `ub4` `oaccolid` field in a column-metadata record (both the describe
/// read side and the bind-metadata write side carry the same field).
///
/// Reference `messages/base.pyx:346` (read/skip in `_process_column_info`) and
/// `messages/base.pyx:1429` (write in `_write_column_metadata`) gate it on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_12_2`.
pub const
/// The `al8sqlsig` block (SQL-signature + SQL-ID pointers) in an EXECUTE.
///
/// Reference `messages/execute.pyx:172` gates the block on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_12_2`. Same constant as
/// [`carries_oaccolid`] but a distinct wire field, so it is a distinct decision.
pub const
/// The chunk-ids block (chunk-ids pointer + count) in an EXECUTE, written only
/// inside the `al8sqlsig` block.
///
/// Reference `messages/execute.pyx:178` gates it on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_12_2_EXT1`.
pub const
/// The `ub4 sql-type` + `ub4 server-checksum` pair in a server error/return
/// info block.
///
/// Reference `messages/base.pyx:238` skips both when
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_20_1`. (Our reader keeps an
/// extra defensive peek for the pre-20.1 layout; only the version half of that
/// condition lives here.)
pub const
/// The JSON-payload flag/pointer byte in an AQ enqueue / dequeue payload.
///
/// Reference `messages/aq_enq.pyx:115` (enqueue pointer) and
/// `messages/aq_deq.pyx:130` (dequeue flag) gate it on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_20_1`.
pub const
/// The `ub4` shard-id field in AQ message properties / array enqueue+dequeue /
/// single dequeue (write side) and in the dequeue message-properties (read
/// side) — the same field on both directions.
///
/// Reference `messages/aq_base.pyx:129,197`, `messages/aq_array.pyx:196` and
/// `messages/aq_deq.pyx:132` gate it on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_21_1`.
pub const
/// The domain-schema + domain-name strings in a column-metadata describe.
///
/// Reference `messages/base.pyx:358` gates them on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_23_1`.
pub const
/// The column annotations block in a column-metadata describe.
///
/// Reference `messages/base.pyx:361` gates it on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_23_1_EXT_3`.
pub const
/// The VECTOR column metadata (dimensions / format / flags) in a describe.
///
/// Reference `messages/base.pyx:376` gates it on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_23_4`.
pub const
/// The `kpninst`/client-id pointer block written into a SUBSCRIBE (register)
/// request.
///
/// Reference `messages/subscribe.pyx:127` gates it on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_12_1`.
pub const
/// The subscriber name and the db-instances / listener-addresses blocks read
/// from a SUBSCRIBE response.
///
/// Reference `messages/subscribe.pyx:61` (subscriber name) and
/// `messages/subscribe.pyx:63` (db instances + listeners) gate them on
/// `_caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_12_1`.
pub const