oracledb-protocol 0.5.0

Sans-I/O Oracle TNS/TTC protocol core for the oracledb crate.
Documentation
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
#![forbid(unsafe_code)]

pub const TNS_PACKET_TYPE_CONNECT: u8 = 1;
pub const TNS_PACKET_TYPE_ACCEPT: u8 = 2;
pub const TNS_PACKET_TYPE_REFUSE: u8 = 4;
pub const TNS_PACKET_TYPE_REDIRECT: u8 = 5;
pub const TNS_PACKET_TYPE_DATA: u8 = 6;

pub const TNS_DATA_FLAGS_EOF: u16 = 0x0040;
pub const TNS_DATA_FLAGS_END_OF_REQUEST: u16 = 0x0800;
pub const TNS_DATA_FLAGS_BEGIN_PIPELINE: u16 = 0x1000;
pub const TNS_DATA_FLAGS_END_OF_RESPONSE: u16 = 0x2000;

pub const TNS_MSG_TYPE_PROTOCOL: u8 = 1;
pub const TNS_MSG_TYPE_DATA_TYPES: u8 = 2;
pub const TNS_MSG_TYPE_FUNCTION: u8 = 3;
pub const TNS_MSG_TYPE_ERROR: u8 = 4;
pub const TNS_MSG_TYPE_ROW_HEADER: u8 = 6;
pub const TNS_MSG_TYPE_ROW_DATA: u8 = 7;
pub const TNS_MSG_TYPE_PARAMETER: u8 = 8;
pub const TNS_MSG_TYPE_STATUS: u8 = 9;
pub const TNS_MSG_TYPE_IO_VECTOR: u8 = 11;
pub const TNS_MSG_TYPE_LOB_DATA: u8 = 14;
pub const TNS_MSG_TYPE_FLUSH_OUT_BINDS: u8 = 19;
pub const TNS_MSG_TYPE_BIT_VECTOR: u8 = 21;
pub const TNS_MSG_TYPE_DESCRIBE_INFO: u8 = 16;
pub const TNS_MSG_TYPE_PIGGYBACK: u8 = 17;
pub const TNS_MSG_TYPE_SERVER_SIDE_PIGGYBACK: u8 = 23;
pub const TNS_MSG_TYPE_IMPLICIT_RESULTSET: u8 = 27;
pub const TNS_MSG_TYPE_END_OF_RESPONSE: u8 = 29;
pub const TNS_MSG_TYPE_TOKEN: u8 = 33;

pub const TNS_FUNC_AUTH_PHASE_ONE: u8 = 118;
pub const TNS_FUNC_AUTH_PHASE_TWO: u8 = 115;
pub const TNS_FUNC_COMMIT: u8 = 14;
pub const TNS_FUNC_EXECUTE: u8 = 94;
pub const TNS_FUNC_FETCH: u8 = 5;
pub const TNS_FUNC_LOGOFF: u8 = 9;
pub const TNS_FUNC_LOB_OP: u8 = 96;
pub const TNS_FUNC_PING: u8 = 147;
pub const TNS_FUNC_PIPELINE_BEGIN: u8 = 199;
pub const TNS_FUNC_PIPELINE_END: u8 = 200;
pub const TNS_FUNC_ROLLBACK: u8 = 15;
pub const TNS_FUNC_CLOSE_CURSORS: u8 = 105;
/// Two-phase-commit / sessionless transaction switch (start/attach/detach);
/// reference `TNS_FUNC_TPC_TXN_SWITCH` (impl/thin/constants.pxi:440).
pub const TNS_FUNC_TPC_TXN_SWITCH: u8 = 103;
/// Two-phase-commit transaction change-state (commit/abort/prepare/forget);
/// reference `TNS_FUNC_TPC_TXN_CHANGE_STATE` (impl/thin/constants.pxi:441).
pub const TNS_FUNC_TPC_TXN_CHANGE_STATE: u8 = 104;

// CQN / subscription wire constants (reference thin/constants.pxi).
/// Register / unregister a subscription (FUNC byte on the primary connection).
pub const TNS_FUNC_SUBSCRIBE: u8 = 125;
/// Arm the EMON notification stream (FUNC byte on the second/emon connection).
pub const TNS_FUNC_NOTIFY: u8 = 187;
pub const TNS_SUBSCR_OP_REGISTER: u8 = 1;
pub const TNS_SUBSCR_OP_UNREGISTER: u8 = 2;
pub const TNS_SUBSCR_MODE_CLIENT_INITIATED: u32 = 4;
pub const TNS_SUBSCR_CLIENT_ID_LEN: u32 = 29;
pub const TNS_INIT_KPNDRREQ: u8 = 1;
/// OAC record `message_type` value that ends the notification stream.
pub const TNS_SUBSCR_STOP_NOTIF: u32 = 0x04;
// Wire QOS flags (distinct numeric space from the public SUBSCR_QOS_* enums).
pub const TNS_SUBSCR_QOS_RELIABLE: u32 = 0x01;
pub const TNS_SUBSCR_QOS_SECURE: u32 = 0x08;
pub const TNS_SUBSCR_QOS_PURGE_ON_NTFN: u32 = 0x10;
// Wire registration flags.
pub const TNS_SUBSCR_FLAGS_INCLUDE_ROWIDS: u32 = 0x10;
pub const TNS_SUBSCR_FLAGS_QUERY: u32 = 0x20;
/// Notification namespaces (shared numeric space with the public enums).
pub const TNS_SUBSCR_NAMESPACE_AQ: u32 = 1;
pub const TNS_SUBSCR_NAMESPACE_DBCHANGE: u32 = 2;
/// OAC data message type read at the head of the notification stream.
pub const TNS_MSG_TYPE_OAC: u8 = 13;
/// `ttc_field_version` gate that drives the 12.1 SUBSCRIBE block / response
/// client-id read (reference `TNS_CCAP_FIELD_VERSION_12_1`).
pub const TNS_CCAP_FIELD_VERSION_12_1: u8 = 7;

// Public QOS bits (base_impl.pxd SUBSCR_QOS_*), consumed when deriving the
// wire qos/flags. These match `oracledb.SUBSCR_QOS_*` in the shipped python
// layer.
pub const SUBSCR_QOS_RELIABLE: u32 = 0x01;
pub const SUBSCR_QOS_DEREG_NFY: u32 = 0x02;
pub const SUBSCR_QOS_ROWIDS: u32 = 0x04;
pub const SUBSCR_QOS_QUERY: u32 = 0x08;

// CQN notification event types (base_impl.pxd EVENT_*).
pub const EVENT_DEREG: u32 = 5;
pub const EVENT_OBJCHANGE: u32 = 6;
pub const EVENT_QUERYCHANGE: u32 = 7;
pub const EVENT_AQ: u32 = 100;
/// Table operation flag: rows are summarised (no per-row records follow).
pub const OPCODE_ALLROWS: u32 = 0x01;

// Advanced Queuing function codes (reference constants.pxi).
pub const TNS_FUNC_AQ_ENQ: u8 = 121;
pub const TNS_FUNC_AQ_DEQ: u8 = 122;
pub const TNS_FUNC_AQ_ARRAY: u8 = 145;

// AQ delivery modes (reference constants.pxi).
pub const TNS_AQ_MSG_PERSISTENT: u16 = 1;
pub const TNS_AQ_MSG_BUFFERED: u16 = 2;
pub const TNS_AQ_MSG_PERSISTENT_OR_BUFFERED: u16 = 3;

// AQ array operations.
pub const TNS_AQ_ARRAY_ENQ: i32 = 1;
pub const TNS_AQ_ARRAY_DEQ: i32 = 2;
pub const TNS_AQ_ARRAY_FLAGS_RETURN_MESSAGE_ID: u32 = 0x01;

// AQ message defaults / misc.
pub const TNS_AQ_MESSAGE_ID_LENGTH: usize = 16;
pub const TNS_AQ_MESSAGE_VERSION: u16 = 1;

// AQ enqueue/dequeue flag bits (delivery-mode plumbing).
pub const TNS_KPD_AQ_BUFMSG: u32 = 0x02;
pub const TNS_KPD_AQ_EITHER: u32 = 0x10;

// AQ extension keywords (reference constants.pxi).
pub const TNS_AQ_EXT_KEYWORD_AGENT_NAME: u16 = 64;
pub const TNS_AQ_EXT_KEYWORD_AGENT_ADDRESS: u16 = 65;
pub const TNS_AQ_EXT_KEYWORD_AGENT_PROTOCOL: u16 = 66;
pub const TNS_AQ_EXT_KEYWORD_ORIGINAL_MSGID: u16 = 69;

/// ORA-25228: dequeue from an empty queue with NO_WAIT returns this; the thin
/// driver clears it and surfaces `None` instead (reference aq_base.pyx).
pub const TNS_ERR_NO_MESSAGES_FOUND: i32 = 25228;

// Sessionless / TPC transaction switch operations (reference constants.pxi:597).
pub const TNS_TPC_TXN_START: u32 = 0x01;
pub const TNS_TPC_TXN_DETACH: u32 = 0x02;
pub const TNS_TPC_TXN_POST_DETACH: u32 = 0x04;

// TPC transaction change-state operations (reference constants.pxi:601-604).
pub const TNS_TPC_TXN_COMMIT: u32 = 0x01;
pub const TNS_TPC_TXN_ABORT: u32 = 0x02;
pub const TNS_TPC_TXN_PREPARE: u32 = 0x03;
pub const TNS_TPC_TXN_FORGET: u32 = 0x04;

// TPC transaction states returned (and requested) by change-state
// (reference constants.pxi:606-611).
pub const TNS_TPC_TXN_STATE_PREPARE: u32 = 0;
pub const TNS_TPC_TXN_STATE_REQUIRES_COMMIT: u32 = 1;
pub const TNS_TPC_TXN_STATE_COMMITTED: u32 = 2;
pub const TNS_TPC_TXN_STATE_ABORTED: u32 = 3;
pub const TNS_TPC_TXN_STATE_READ_ONLY: u32 = 4;
pub const TNS_TPC_TXN_STATE_FORGOTTEN: u32 = 5;

// TPC transaction flags (reference base_impl.pxd:218).
pub const TPC_TXN_FLAGS_NEW: u32 = 0x0000_0001;
pub const TPC_TXN_FLAGS_JOIN: u32 = 0x0000_0002;
pub const TPC_TXN_FLAGS_RESUME: u32 = 0x0000_0004;
pub const TPC_TXN_FLAGS_PROMOTE: u32 = 0x0000_0008;
pub const TPC_TXN_FLAGS_SESSIONLESS: u32 = 0x0000_0010;

/// End-of-call status flag signalling a server-side transaction is in progress
/// (reference constants.pxi:586 `TNS_EOCS_FLAGS_TXN_IN_PROGRESS`). Sampled from
/// the last STATUS / ERROR message of every round trip to drive
/// `transaction_in_progress` (reference protocol.pyx `_process_call_status`).
pub const TNS_EOCS_FLAGS_TXN_IN_PROGRESS: u32 = 0x0000_0002;

/// Format id stamped into the XID of a sessionless transaction so the server
/// can distinguish it from an XA global transaction (reference
/// impl/thin/connection.pyx `_SessionlessData.create_message`).
pub const SESSIONLESS_FORMAT_ID: u32 = 0x4e_5c_3e;

/// Keyword number carrying the (binary) sessionless transaction id / state in
/// a return-parameter key/value pair (reference constants.pxi:207).
pub const TNS_KEYWORD_NUM_TRANSACTION_ID: u16 = 201;

// Sessionless server-state bits, packed in the second-to-last byte of the
// transaction-id key/value binary payload (reference constants.pxi:608).
pub const TNS_TPC_TXNID_SYNC_SET: u8 = 0x40;
pub const TNS_TPC_TXNID_SYNC_UNSET: u8 = 0x80;
// Sessionless state reason bits (reference constants.pxi:613).
pub const TNS_TPC_TXNID_SYNC_SERVER: u8 = 0x01;

/// Fetch orientations for scrollable cursors (reference constants.pxi).
pub const TNS_FETCH_ORIENTATION_CURRENT: u32 = 0x01;
pub const TNS_FETCH_ORIENTATION_NEXT: u32 = 0x02;
pub const TNS_FETCH_ORIENTATION_FIRST: u32 = 0x04;
pub const TNS_FETCH_ORIENTATION_LAST: u32 = 0x08;
pub const TNS_FETCH_ORIENTATION_PRIOR: u32 = 0x10;
pub const TNS_FETCH_ORIENTATION_ABSOLUTE: u32 = 0x20;
pub const TNS_FETCH_ORIENTATION_RELATIVE: u32 = 0x40;

pub const TNS_PIPELINE_MODE_CONTINUE_ON_ERROR: u8 = 1;
pub const TNS_PIPELINE_MODE_ABORT_ON_ERROR: u8 = 2;

pub const TNS_AUTH_MODE_LOGON: u32 = 0x0000_0001;
pub const TNS_AUTH_MODE_CHANGE_PASSWORD: u32 = 0x0000_0002;
pub const TNS_AUTH_MODE_WITH_PASSWORD: u32 = 0x0000_0100;

pub const TNS_VERIFIER_TYPE_11G_1: u32 = 0xb152;
pub const TNS_VERIFIER_TYPE_11G_2: u32 = 0x1b25;
pub const TNS_VERIFIER_TYPE_12C: u32 = 0x4815;

pub const ORA_TYPE_NUM_VARCHAR: u8 = 1;
pub const ORA_TYPE_NUM_NUMBER: u8 = 2;
pub const ORA_TYPE_NUM_BINARY_INTEGER: u8 = 3;
pub const ORA_TYPE_NUM_LONG: u8 = 8;
pub const ORA_TYPE_NUM_ROWID: u8 = 11;
pub const ORA_TYPE_NUM_DATE: u8 = 12;
pub const ORA_TYPE_NUM_RAW: u8 = 23;
pub const ORA_TYPE_NUM_BINARY_FLOAT: u8 = 100;
pub const ORA_TYPE_NUM_BINARY_DOUBLE: u8 = 101;
pub const ORA_TYPE_NUM_BOOLEAN: u8 = 252;
pub const ORA_TYPE_NUM_CURSOR: u8 = 102;
pub const ORA_TYPE_NUM_LONG_RAW: u8 = 24;
pub const ORA_TYPE_NUM_CHAR: u8 = 96;
pub const ORA_TYPE_NUM_CLOB: u8 = 112;
pub const ORA_TYPE_NUM_BLOB: u8 = 113;
pub const ORA_TYPE_NUM_BFILE: u8 = 114;
pub const ORA_TYPE_NUM_OBJECT: u8 = 109;
pub const ORA_TYPE_NUM_JSON: u8 = 119;
pub const ORA_TYPE_NUM_TIMESTAMP: u8 = 180;
pub const ORA_TYPE_NUM_TIMESTAMP_TZ: u8 = 181;
pub const ORA_TYPE_NUM_INTERVAL_DS: u8 = 183;
pub const ORA_TYPE_NUM_INTERVAL_YM: u8 = 182;
pub const ORA_TYPE_NUM_UROWID: u8 = 208;
pub const ORA_TYPE_NUM_TIMESTAMP_LTZ: u8 = 231;
pub const ORA_TYPE_NUM_VECTOR: u8 = 127;
/// Maximum VECTOR prefetch length (`TNS_VECTOR_MAX_LENGTH` = 1 MiB).
pub(crate) const TNS_VECTOR_MAX_LENGTH: u32 = 1024 * 1024;
/// Maximum JSON (OSON) prefetch length (`TNS_JSON_MAX_LENGTH` = 32 MiB).
pub(crate) const TNS_JSON_MAX_LENGTH: u32 = 32 * 1024 * 1024;
pub const TNS_OBJ_TOP_LEVEL: u32 = 0x01;
pub(crate) const TNS_LONG_LENGTH_INDICATOR: u8 = 254;
pub(crate) const TNS_NULL_LENGTH_INDICATOR: u8 = 255;
pub(crate) const TNS_OBJ_ATOMIC_NULL: u8 = 253;
pub(crate) const TNS_OBJ_IS_DEGENERATE: u8 = 0x10;
pub(crate) const TNS_OBJ_NO_PREFIX_SEG: u8 = 0x04;
// DbObject pickle image constants (reference impl/thin/constants.pxi +
// dbobject.pyx create_new_object/write_header).
pub(crate) const TNS_OBJ_IS_VERSION_81: u8 = 0x80;
pub(crate) const TNS_OBJ_IS_COLLECTION: u8 = 0x08;
pub(crate) const TNS_OBJ_IMAGE_VERSION: u8 = 1;
pub(crate) const TNS_OBJ_NON_NULL_OID: u8 = 0x02;
pub(crate) const TNS_OBJ_HAS_EXTENT_OID: u8 = 0x08;
pub(crate) const TNS_OBJ_HAS_INDEXES: u8 = 0x10;
pub(crate) const TNS_OBJ_MAX_SHORT_LENGTH: usize = 245;
/// `TNS_EXTENT_OID` = hex `00000000000000000000000000010001` (16 bytes).
pub(crate) const TNS_EXTENT_OID: [u8; 16] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1];
pub(crate) const TNS_XML_TYPE_LOB: u32 = 0x0001;
pub(crate) const TNS_XML_TYPE_STRING: u32 = 0x0004;
pub(crate) const TNS_XML_TYPE_FLAG_SKIP_NEXT_4: u32 = 0x100000;
pub(crate) const TNS_LOB_LOC_OFFSET_FLAG_1: usize = 4;
pub(crate) const TNS_LOB_LOC_OFFSET_FLAG_3: usize = 6;
pub(crate) const TNS_LOB_LOC_OFFSET_FLAG_4: usize = 7;
pub(crate) const TNS_LOB_LOC_FLAGS_ABSTRACT: u8 = 0x40;
pub(crate) const TNS_LOB_LOC_FLAGS_TEMP: u8 = 0x01;
pub(crate) const TNS_LOB_LOC_FLAGS_VAR_LENGTH_CHARSET: u8 = 0x80;
pub(crate) const TNS_LOB_LOC_FLAGS_LITTLE_ENDIAN: u8 = 0x40;

pub const CS_FORM_IMPLICIT: u8 = 1;
pub const CS_FORM_NCHAR: u8 = 2;

pub(crate) const TNS_GSO_DONT_CARE: u16 = 0x0001;
/// Service-option bit advertising that the endpoint can receive an out-of-band
/// "attention" (urgent-TCP break). The server echoes it in the accept's
/// `protocol_options` when OOB breaks are negotiated (reference
/// `TNS_GSO_CAN_RECV_ATTENTION`, constants.pxi:396); the reference derives
/// `Capabilities.supports_oob` from `protocol_options & this`
/// (capabilities.pyx:121).
pub(crate) const TNS_GSO_CAN_RECV_ATTENTION: u16 = 0x0400;
pub(crate) const TNS_NSI_DISABLE_NA: u8 = 0x04;
pub(crate) const TNS_NSI_NA_REQUIRED: u8 = 0x10;
pub(crate) const TNS_NSI_SUPPORT_SECURITY_RENEG: u8 = 0x80;
pub(crate) const TNS_PROTOCOL_CHARACTERISTICS: u16 = 0x4f98;
pub(crate) const TNS_ACCEPT_FLAG_FAST_AUTH: u32 = 0x1000_0000;
pub(crate) const TNS_ACCEPT_FLAG_HAS_END_OF_RESPONSE: u32 = 0x0200_0000;
pub(crate) const TNS_ACCEPT_FLAG_CHECK_OOB: u32 = 0x0000_0001;
pub(crate) const TNS_SERVER_PIGGYBACK_QUERY_CACHE_INVALIDATION: u8 = 1;
pub(crate) const TNS_SERVER_PIGGYBACK_OS_PID_MTS: u8 = 2;
pub(crate) const TNS_SERVER_PIGGYBACK_TRACE_EVENT: u8 = 3;
pub(crate) const TNS_SERVER_PIGGYBACK_SESS_RET: u8 = 4;
pub(crate) const TNS_SERVER_PIGGYBACK_SYNC: u8 = 5;
pub(crate) const TNS_SERVER_PIGGYBACK_LTXID: u8 = 7;
pub(crate) const TNS_SERVER_PIGGYBACK_AC_REPLAY_CONTEXT: u8 = 8;
pub(crate) const TNS_SERVER_PIGGYBACK_EXT_SYNC: u8 = 9;
pub(crate) const TNS_SERVER_PIGGYBACK_SESS_SIGNATURE: u8 = 10;
pub(crate) const TNS_CCAP_FIELD_VERSION: usize = 7;
pub(crate) const TNS_CCAP_FIELD_VERSION_12_2: u8 = 8;
pub(crate) const TNS_CCAP_FIELD_VERSION_20_1: u8 = 14;
pub(crate) const TNS_CCAP_FIELD_VERSION_21_1: u8 = 16;
pub(crate) const TNS_CCAP_FIELD_VERSION_23_1: u8 = 17;
pub(crate) const TNS_CCAP_FIELD_VERSION_23_1_EXT_1: u8 = 18;
pub(crate) const TNS_CCAP_FIELD_VERSION_23_1_EXT_3: u8 = 20;
pub(crate) const TNS_CCAP_FIELD_VERSION_23_4: u8 = 24;
pub(crate) const TNS_RCAP_TTC: usize = 6;
pub(crate) const TNS_RCAP_TTC_32K: u8 = 0x04;
pub(crate) const TNS_EXEC_OPTION_PARSE: u32 = 0x01;
pub(crate) const TNS_EXEC_OPTION_BIND: u32 = 0x08;
pub(crate) const TNS_EXEC_OPTION_DEFINE: u32 = 0x10;
pub(crate) const TNS_EXEC_OPTION_EXECUTE: u32 = 0x20;
pub(crate) const TNS_EXEC_OPTION_FETCH: u32 = 0x40;
pub(crate) const TNS_EXEC_OPTION_PLSQL_BIND: u32 = 0x400;
pub(crate) const TNS_EXEC_OPTION_NOT_PLSQL: u32 = 0x8000;
pub(crate) const TNS_EXEC_OPTION_DESCRIBE: u32 = 0x20000;
pub(crate) const TNS_EXEC_OPTION_BATCH_ERRORS: u32 = 0x80000;
pub(crate) const TNS_EXEC_FLAGS_DML_ROWCOUNTS: u32 = 0x4000;
pub(crate) const TNS_EXEC_FLAGS_SCROLLABLE: u32 = 0x02;
pub(crate) const TNS_EXEC_FLAGS_NO_CANCEL_ON_EOF: u32 = 0x80;
pub(crate) const TNS_DURATION_SESSION: u32 = 10;
pub(crate) const TNS_LOB_OP_READ: u32 = 0x0002;
pub(crate) const TNS_LOB_OP_TRIM: u32 = 0x0020;
pub(crate) const TNS_LOB_OP_WRITE: u32 = 0x0040;
pub(crate) const TNS_LOB_OP_CREATE_TEMP: u32 = 0x0110;
pub(crate) const TNS_LOB_OP_FREE_TEMP: u32 = 0x0111;
pub(crate) const TNS_LOB_OP_ARRAY: u32 = 0x80000;
pub(crate) const TNS_LOB_PREFETCH_FLAG: u64 = 0x0200_0000;
pub(crate) const TNS_EXEC_FLAGS_IMPLICIT_RESULTSET: u32 = 0x8000;
pub(crate) const TNS_BIND_USE_INDICATORS: u8 = 0x01;
pub(crate) const TNS_BIND_ARRAY: u8 = 0x40;
pub(crate) const TNS_BIND_DIR_INPUT: u8 = 32;
pub(crate) const TNS_CHARSET_UTF8: u16 = 873;
pub const TNS_MAX_LONG_LENGTH: u32 = 0x7fff_ffff;
pub(crate) const TNS_ERR_NO_DATA_FOUND: u32 = 1403;
pub(crate) const TNS_ERR_ARRAY_DML_ERRORS: u32 = 24381;
// reference thin/constants.pxi:581-582
pub(crate) const TNS_UDS_FLAGS_IS_JSON: u32 = 0x0000_0100;
pub(crate) const TNS_UDS_FLAGS_IS_OSON: u32 = 0x0000_0800;
pub(crate) const ORA_TYPE_SIZE_BINARY_DOUBLE: u32 = 8;
pub(crate) const ORA_TYPE_SIZE_BINARY_FLOAT: u32 = 4;
pub(crate) const ORA_TYPE_SIZE_BOOLEAN: u32 = 4;
/// Marker byte introducing a length-escaped value on the wire. A NULL BOOLEAN
/// bind is encoded as the two raw bytes `[TNS_ESCAPE_CHAR, 1]` rather than the
/// usual single `0` null indicator (reference messages/base.pyx
/// `_write_bind_params_column`).
pub(crate) const TNS_ESCAPE_CHAR: u8 = 253;
pub(crate) const ORA_TYPE_SIZE_NUMBER: u32 = 22;
pub(crate) const ORA_TYPE_SIZE_DATE: u32 = 7;
pub(crate) const ORA_TYPE_SIZE_INTERVAL_DS: u32 = 11;
pub(crate) const ORA_TYPE_SIZE_INTERVAL_YM: u32 = 5;
pub(crate) const ORA_TYPE_SIZE_ROWID: u32 = 18;
pub(crate) const ORA_TYPE_SIZE_TIMESTAMP: u32 = 11;
pub(crate) const ORA_TYPE_SIZE_TIMESTAMP_TZ: u32 = 13;
pub(crate) const TNS_BASE64_ALPHABET: &[u8; 64] =
    b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
pub(crate) const TNS_HAS_REGION_ID: u8 = 0x80;
pub(crate) const TZ_HOUR_OFFSET: u8 = 20;
pub(crate) const TZ_MINUTE_OFFSET: u8 = 60;
pub(crate) const NUMBER_AS_TEXT_CHARS: usize = 172;
pub(crate) const NUMBER_MAX_DIGITS: usize = 40;

pub(crate) const FAST_AUTH_PREFIX_HEX: &str = concat!(
    "22010100010600707974686f6e2d6f7261636c6564620000000000000d0269036903033506000000",
    "ea180018010100000000002990030703000100cf000004010000001000000c2000b80008640005003",
    "e02000000000000030b0200000000000500000000000100010001000000020002000a000000080008",
    "00010000000c000c000a0000001700170001000000180018000100000019001900010000001a001a",
    "00010000001b001b000a0000001c001c00010000001d001d00010000001e001e00010000001f001f",
    "0001000000200020000100000021002100010000000a000a00010000000b000b0001000000280028",
    "00010000002900290001000000750075000100000078007800010000012201220001000001230123",
    "00010000012401240001000001250125000100000126012600010000012a012a00010000012b012b",
    "00010000012c012c00010000012d012d00010000012e012e00010000012f012f0001000001300130",
    "00010000013101310001000001320132000100000133013300010000013401340001000001350135",
    "000100000136013600010000013701370001000001380138000100000139013900010000013b013b",
    "00010000013c013c00010000013d013d00010000013e013e00010000013f013f0001000001400140",
    "00010000014101410001000001420142000100000143014300010000014701470001000001480148",
    "000100000149014900010000014b014b00010000014d014d00010000014e014e00010000014f014f",
    "00010000015001500001000001510151000100000152015200010000015301530001000001540154",
    "00010000015501550001000001560156000100000157015700010000015801580001000001590159",
    "00010000015a015a00010000015c015c00010000015d015d00010000016201620001000001630163",
    "000100000167016700010000016b016b00010000017c017c00010000017d017d00010000017e017e",
    "00010000017f017f0001000001800180000100000181018100010000018201820001000001830183",
    "00010000018401840001000001850185000100000186018600010000018701870001000001890189",
    "00010000018a018a00010000018b018b00010000018c018c00010000018d018d00010000018e018e",
    "00010000018f018f0001000001900190000100000191019100010000019401940001000001950195",
    "0001000001960196000100000197019700010000019d019d00010000019e019e00010000019f019f",
    "0001000001a001a00001000001a101a10001000001a201a20001000001a301a30001000001a401a4",
    "0001000001a501a50001000001a601a60001000001a701a70001000001a801a80001000001a901a9",
    "0001000001aa01aa0001000001ab01ab0001000001ad01ad0001000001ae01ae0001000001af01af",
    "0001000001b001b00001000001b101b10001000001c101c10001000001c201c20001000001c601c6",
    "0001000001c701c70001000001c801c80001000001c901c90001000001ca01ca0001000001cb01cb",
    "0001000001cc01cc0001000001cd01cd0001000001ce01ce0001000001cf01cf0001000001d201d2",
    "0001000001d301d30001000001d401d40001000001d501d50001000001d601d60001000001d701d7",
    "0001000001d801d80001000001d901d90001000001da01da0001000001db01db0001000001dc01dc",
    "0001000001dd01dd0001000001de01de0001000001df01df0001000001e001e00001000001e101e1",
    "0001000001e201e20001000001e301e30001000001e401e40001000001e501e50001000001e601e6",
    "0001000001ea01ea0001000001eb01eb0001000001ec01ec0001000001ed01ed0001000001ee01ee",
    "0001000001ef01ef0001000001f001f00001000001f201f20001000001f301f30001000001f401f4",
    "0001000001f501f50001000001f601f60001000001fd01fd0001000001fe01fe0001000002010201",
    "00010000020202020001000002040204000100000205020500010000020602060001000002070207",
    "0001000002080208000100000209020900010000020a020a00010000020b020b00010000020c020c",
    "00010000020d020d00010000020e020e00010000020f020f00010000021002100001000002110211",
    "00010000021202120001000002130213000100000214021400010000021502150001000002160216",
    "00010000021702170001000002180218000100000219021900010000021a021a00010000021b021b",
    "00010000021c021c00010000021d021d00010000021e021e00010000021f021f0001000002300230",
    "000100000235023500010000023c023c00010000023d023d00010000023e023e00010000023f023f",
    "00010000024002400001000002420242000100000233023300010000023402340001000002430243",
    "00010000024402440001000002450245000100000246024600010000024702470001000002480248",
    "00010000024902490001000000030002000a000000040002000a0000000500010001000000060002",
    "000a000000070002000a00000009000100010000000f000100010000002700270001000000440002",
    "000a0000005b0002000a0000005e000100010000005f001700010000006000600001000000610060",
    "000100000064006400010000006500650001000000660066000100000068000b00010000006a006a",
    "00010000006c006d00010000006d006d00010000006e006f00010000006f006f0001000000700070",
    "00010000007100710001000000720072000100000073007300010000007400660001000000770077",
    "0001000000c600c600010000009200920001000000980002000a000000990002000a0000009a0002",
    "000a0000009b000100010000009c000c000a000000ac0002000a000000b200b20001000000b300b3",
    "0001000000b400b40001000000b500b50001000000b600b60001000000b700b70001000000b8000c",
    "000a000000b900b90001000000ba00ba0001000000bb00bb0001000000bc00bc0001000000bd00bd",
    "0001000000be00be0001000000c300700001000000c400710001000000c500720001000000d000d0",
    "0001000000e700e70001000000e800e70001000000e900e90001000000f1006d0001000000fc00fc",
    "00010000024e024e00010000024f024f000100000250025000010000026502650001000002660266",
    "00010000026702670001000002680268000100000263026300010000026402640001000002510251",
    "00010000025202520001000002530253000100000254025400010000025502550001000002560256",
    "00010000025702570001000002580258000100000259025900010000025a025a00010000025b025b",
    "00010000025c025c00010000025d025d00010000026e026e00010000026f026f0001000002700270",
    "00010000027102710001000002720272000100000273027300010000027402740001000002750275",
    "00010000027602760001000002770277000100000278027800010000027d027d00010000027e027e",
    "00010000027c027c00010000027f027f0001000002970297000100000280028000010000028c028c",
    "0001000002860286000100000287028700010000007f007f00010000029402940001000002950295",
    "000100000299029900010000029d029d00010000029e029e000100000000"
);

pub(crate) const TNS_DURATION_MID: i64 = 0x8000_0000;
pub(crate) const TNS_DURATION_OFFSET: i32 = 60;