Skip to main content

oracledb_protocol/thin/
constants.rs

1#![forbid(unsafe_code)]
2
3pub const TNS_PACKET_TYPE_CONNECT: u8 = 1;
4pub const TNS_PACKET_TYPE_ACCEPT: u8 = 2;
5pub const TNS_PACKET_TYPE_REFUSE: u8 = 4;
6pub const TNS_PACKET_TYPE_REDIRECT: u8 = 5;
7pub const TNS_PACKET_TYPE_DATA: u8 = 6;
8
9pub const TNS_DATA_FLAGS_EOF: u16 = 0x0040;
10pub const TNS_DATA_FLAGS_END_OF_REQUEST: u16 = 0x0800;
11pub const TNS_DATA_FLAGS_BEGIN_PIPELINE: u16 = 0x1000;
12pub const TNS_DATA_FLAGS_END_OF_RESPONSE: u16 = 0x2000;
13
14pub const TNS_MSG_TYPE_PROTOCOL: u8 = 1;
15pub const TNS_MSG_TYPE_DATA_TYPES: u8 = 2;
16pub const TNS_MSG_TYPE_FUNCTION: u8 = 3;
17pub const TNS_MSG_TYPE_ERROR: u8 = 4;
18pub const TNS_MSG_TYPE_ROW_HEADER: u8 = 6;
19pub const TNS_MSG_TYPE_ROW_DATA: u8 = 7;
20pub const TNS_MSG_TYPE_PARAMETER: u8 = 8;
21pub const TNS_MSG_TYPE_STATUS: u8 = 9;
22pub const TNS_MSG_TYPE_IO_VECTOR: u8 = 11;
23pub const TNS_MSG_TYPE_LOB_DATA: u8 = 14;
24pub const TNS_MSG_TYPE_FLUSH_OUT_BINDS: u8 = 19;
25pub const TNS_MSG_TYPE_BIT_VECTOR: u8 = 21;
26pub const TNS_MSG_TYPE_DESCRIBE_INFO: u8 = 16;
27pub const TNS_MSG_TYPE_PIGGYBACK: u8 = 17;
28pub const TNS_MSG_TYPE_SERVER_SIDE_PIGGYBACK: u8 = 23;
29pub const TNS_MSG_TYPE_IMPLICIT_RESULTSET: u8 = 27;
30pub const TNS_MSG_TYPE_END_OF_RESPONSE: u8 = 29;
31pub const TNS_MSG_TYPE_TOKEN: u8 = 33;
32
33pub const TNS_FUNC_AUTH_PHASE_ONE: u8 = 118;
34pub const TNS_FUNC_AUTH_PHASE_TWO: u8 = 115;
35pub const TNS_FUNC_COMMIT: u8 = 14;
36pub const TNS_FUNC_EXECUTE: u8 = 94;
37pub const TNS_FUNC_FETCH: u8 = 5;
38pub const TNS_FUNC_LOGOFF: u8 = 9;
39pub const TNS_FUNC_LOB_OP: u8 = 96;
40pub const TNS_FUNC_PING: u8 = 147;
41pub const TNS_FUNC_PIPELINE_BEGIN: u8 = 199;
42pub const TNS_FUNC_PIPELINE_END: u8 = 200;
43pub const TNS_FUNC_ROLLBACK: u8 = 15;
44pub const TNS_FUNC_CLOSE_CURSORS: u8 = 105;
45/// Two-phase-commit / sessionless transaction switch (start/attach/detach);
46/// reference `TNS_FUNC_TPC_TXN_SWITCH` (impl/thin/constants.pxi:440).
47pub const TNS_FUNC_TPC_TXN_SWITCH: u8 = 103;
48/// Two-phase-commit transaction change-state (commit/abort/prepare/forget);
49/// reference `TNS_FUNC_TPC_TXN_CHANGE_STATE` (impl/thin/constants.pxi:441).
50pub const TNS_FUNC_TPC_TXN_CHANGE_STATE: u8 = 104;
51
52// CQN / subscription wire constants (reference thin/constants.pxi).
53/// Register / unregister a subscription (FUNC byte on the primary connection).
54pub const TNS_FUNC_SUBSCRIBE: u8 = 125;
55/// Arm the EMON notification stream (FUNC byte on the second/emon connection).
56pub const TNS_FUNC_NOTIFY: u8 = 187;
57pub const TNS_SUBSCR_OP_REGISTER: u8 = 1;
58pub const TNS_SUBSCR_OP_UNREGISTER: u8 = 2;
59pub const TNS_SUBSCR_MODE_CLIENT_INITIATED: u32 = 4;
60pub const TNS_SUBSCR_CLIENT_ID_LEN: u32 = 29;
61pub const TNS_INIT_KPNDRREQ: u8 = 1;
62/// OAC record `message_type` value that ends the notification stream.
63pub const TNS_SUBSCR_STOP_NOTIF: u32 = 0x04;
64// Wire QOS flags (distinct numeric space from the public SUBSCR_QOS_* enums).
65pub const TNS_SUBSCR_QOS_RELIABLE: u32 = 0x01;
66pub const TNS_SUBSCR_QOS_SECURE: u32 = 0x08;
67pub const TNS_SUBSCR_QOS_PURGE_ON_NTFN: u32 = 0x10;
68// Wire registration flags.
69pub const TNS_SUBSCR_FLAGS_INCLUDE_ROWIDS: u32 = 0x10;
70pub const TNS_SUBSCR_FLAGS_QUERY: u32 = 0x20;
71/// Notification namespaces (shared numeric space with the public enums).
72pub const TNS_SUBSCR_NAMESPACE_AQ: u32 = 1;
73pub const TNS_SUBSCR_NAMESPACE_DBCHANGE: u32 = 2;
74/// OAC data message type read at the head of the notification stream.
75pub const TNS_MSG_TYPE_OAC: u8 = 13;
76/// `ttc_field_version` gate that drives the 12.1 SUBSCRIBE block / response
77/// client-id read (reference `TNS_CCAP_FIELD_VERSION_12_1`).
78pub const TNS_CCAP_FIELD_VERSION_12_1: u8 = 7;
79
80// Public QOS bits (base_impl.pxd SUBSCR_QOS_*), consumed when deriving the
81// wire qos/flags. These match `oracledb.SUBSCR_QOS_*` in the shipped python
82// layer.
83pub const SUBSCR_QOS_RELIABLE: u32 = 0x01;
84pub const SUBSCR_QOS_DEREG_NFY: u32 = 0x02;
85pub const SUBSCR_QOS_ROWIDS: u32 = 0x04;
86pub const SUBSCR_QOS_QUERY: u32 = 0x08;
87
88// CQN notification event types (base_impl.pxd EVENT_*).
89pub const EVENT_DEREG: u32 = 5;
90pub const EVENT_OBJCHANGE: u32 = 6;
91pub const EVENT_QUERYCHANGE: u32 = 7;
92pub const EVENT_AQ: u32 = 100;
93/// Table operation flag: rows are summarised (no per-row records follow).
94pub const OPCODE_ALLROWS: u32 = 0x01;
95
96// Advanced Queuing function codes (reference constants.pxi).
97pub const TNS_FUNC_AQ_ENQ: u8 = 121;
98pub const TNS_FUNC_AQ_DEQ: u8 = 122;
99pub const TNS_FUNC_AQ_ARRAY: u8 = 145;
100
101// AQ delivery modes (reference constants.pxi).
102pub const TNS_AQ_MSG_PERSISTENT: u16 = 1;
103pub const TNS_AQ_MSG_BUFFERED: u16 = 2;
104pub const TNS_AQ_MSG_PERSISTENT_OR_BUFFERED: u16 = 3;
105
106// AQ array operations.
107pub const TNS_AQ_ARRAY_ENQ: i32 = 1;
108pub const TNS_AQ_ARRAY_DEQ: i32 = 2;
109pub const TNS_AQ_ARRAY_FLAGS_RETURN_MESSAGE_ID: u32 = 0x01;
110
111// AQ message defaults / misc.
112pub const TNS_AQ_MESSAGE_ID_LENGTH: usize = 16;
113pub const TNS_AQ_MESSAGE_VERSION: u16 = 1;
114
115// AQ enqueue/dequeue flag bits (delivery-mode plumbing).
116pub const TNS_KPD_AQ_BUFMSG: u32 = 0x02;
117pub const TNS_KPD_AQ_EITHER: u32 = 0x10;
118
119// AQ extension keywords (reference constants.pxi).
120pub const TNS_AQ_EXT_KEYWORD_AGENT_NAME: u16 = 64;
121pub const TNS_AQ_EXT_KEYWORD_AGENT_ADDRESS: u16 = 65;
122pub const TNS_AQ_EXT_KEYWORD_AGENT_PROTOCOL: u16 = 66;
123pub const TNS_AQ_EXT_KEYWORD_ORIGINAL_MSGID: u16 = 69;
124
125/// ORA-25228: dequeue from an empty queue with NO_WAIT returns this; the thin
126/// driver clears it and surfaces `None` instead (reference aq_base.pyx).
127pub const TNS_ERR_NO_MESSAGES_FOUND: i32 = 25228;
128
129// Sessionless / TPC transaction switch operations (reference constants.pxi:597).
130pub const TNS_TPC_TXN_START: u32 = 0x01;
131pub const TNS_TPC_TXN_DETACH: u32 = 0x02;
132pub const TNS_TPC_TXN_POST_DETACH: u32 = 0x04;
133
134// TPC transaction change-state operations (reference constants.pxi:601-604).
135pub const TNS_TPC_TXN_COMMIT: u32 = 0x01;
136pub const TNS_TPC_TXN_ABORT: u32 = 0x02;
137pub const TNS_TPC_TXN_PREPARE: u32 = 0x03;
138pub const TNS_TPC_TXN_FORGET: u32 = 0x04;
139
140// TPC transaction states returned (and requested) by change-state
141// (reference constants.pxi:606-611).
142pub const TNS_TPC_TXN_STATE_PREPARE: u32 = 0;
143pub const TNS_TPC_TXN_STATE_REQUIRES_COMMIT: u32 = 1;
144pub const TNS_TPC_TXN_STATE_COMMITTED: u32 = 2;
145pub const TNS_TPC_TXN_STATE_ABORTED: u32 = 3;
146pub const TNS_TPC_TXN_STATE_READ_ONLY: u32 = 4;
147pub const TNS_TPC_TXN_STATE_FORGOTTEN: u32 = 5;
148
149// TPC transaction flags (reference base_impl.pxd:218).
150pub const TPC_TXN_FLAGS_NEW: u32 = 0x0000_0001;
151pub const TPC_TXN_FLAGS_JOIN: u32 = 0x0000_0002;
152pub const TPC_TXN_FLAGS_RESUME: u32 = 0x0000_0004;
153pub const TPC_TXN_FLAGS_PROMOTE: u32 = 0x0000_0008;
154pub const TPC_TXN_FLAGS_SESSIONLESS: u32 = 0x0000_0010;
155
156/// End-of-call status flag signalling a server-side transaction is in progress
157/// (reference constants.pxi:586 `TNS_EOCS_FLAGS_TXN_IN_PROGRESS`). Sampled from
158/// the last STATUS / ERROR message of every round trip to drive
159/// `transaction_in_progress` (reference protocol.pyx `_process_call_status`).
160pub const TNS_EOCS_FLAGS_TXN_IN_PROGRESS: u32 = 0x0000_0002;
161
162/// Format id stamped into the XID of a sessionless transaction so the server
163/// can distinguish it from an XA global transaction (reference
164/// impl/thin/connection.pyx `_SessionlessData.create_message`).
165pub const SESSIONLESS_FORMAT_ID: u32 = 0x4e_5c_3e;
166
167/// Keyword number carrying the (binary) sessionless transaction id / state in
168/// a return-parameter key/value pair (reference constants.pxi:207).
169pub const TNS_KEYWORD_NUM_TRANSACTION_ID: u16 = 201;
170
171// Sessionless server-state bits, packed in the second-to-last byte of the
172// transaction-id key/value binary payload (reference constants.pxi:608).
173pub const TNS_TPC_TXNID_SYNC_SET: u8 = 0x40;
174pub const TNS_TPC_TXNID_SYNC_UNSET: u8 = 0x80;
175// Sessionless state reason bits (reference constants.pxi:613).
176pub const TNS_TPC_TXNID_SYNC_SERVER: u8 = 0x01;
177
178/// Fetch orientations for scrollable cursors (reference constants.pxi).
179pub const TNS_FETCH_ORIENTATION_CURRENT: u32 = 0x01;
180pub const TNS_FETCH_ORIENTATION_NEXT: u32 = 0x02;
181pub const TNS_FETCH_ORIENTATION_FIRST: u32 = 0x04;
182pub const TNS_FETCH_ORIENTATION_LAST: u32 = 0x08;
183pub const TNS_FETCH_ORIENTATION_PRIOR: u32 = 0x10;
184pub const TNS_FETCH_ORIENTATION_ABSOLUTE: u32 = 0x20;
185pub const TNS_FETCH_ORIENTATION_RELATIVE: u32 = 0x40;
186
187pub const TNS_PIPELINE_MODE_CONTINUE_ON_ERROR: u8 = 1;
188pub const TNS_PIPELINE_MODE_ABORT_ON_ERROR: u8 = 2;
189
190pub const TNS_AUTH_MODE_LOGON: u32 = 0x0000_0001;
191pub const TNS_AUTH_MODE_CHANGE_PASSWORD: u32 = 0x0000_0002;
192pub const TNS_AUTH_MODE_WITH_PASSWORD: u32 = 0x0000_0100;
193
194pub const TNS_VERIFIER_TYPE_11G_1: u32 = 0xb152;
195pub const TNS_VERIFIER_TYPE_11G_2: u32 = 0x1b25;
196pub const TNS_VERIFIER_TYPE_12C: u32 = 0x4815;
197
198pub const ORA_TYPE_NUM_VARCHAR: u8 = 1;
199pub const ORA_TYPE_NUM_NUMBER: u8 = 2;
200pub const ORA_TYPE_NUM_BINARY_INTEGER: u8 = 3;
201pub const ORA_TYPE_NUM_LONG: u8 = 8;
202pub const ORA_TYPE_NUM_ROWID: u8 = 11;
203pub const ORA_TYPE_NUM_DATE: u8 = 12;
204pub const ORA_TYPE_NUM_RAW: u8 = 23;
205pub const ORA_TYPE_NUM_BINARY_FLOAT: u8 = 100;
206pub const ORA_TYPE_NUM_BINARY_DOUBLE: u8 = 101;
207pub const ORA_TYPE_NUM_BOOLEAN: u8 = 252;
208pub const ORA_TYPE_NUM_CURSOR: u8 = 102;
209pub const ORA_TYPE_NUM_LONG_RAW: u8 = 24;
210pub const ORA_TYPE_NUM_CHAR: u8 = 96;
211pub const ORA_TYPE_NUM_CLOB: u8 = 112;
212pub const ORA_TYPE_NUM_BLOB: u8 = 113;
213pub const ORA_TYPE_NUM_BFILE: u8 = 114;
214pub const ORA_TYPE_NUM_OBJECT: u8 = 109;
215pub const ORA_TYPE_NUM_JSON: u8 = 119;
216pub const ORA_TYPE_NUM_TIMESTAMP: u8 = 180;
217pub const ORA_TYPE_NUM_TIMESTAMP_TZ: u8 = 181;
218pub const ORA_TYPE_NUM_INTERVAL_DS: u8 = 183;
219pub const ORA_TYPE_NUM_INTERVAL_YM: u8 = 182;
220pub const ORA_TYPE_NUM_UROWID: u8 = 208;
221pub const ORA_TYPE_NUM_TIMESTAMP_LTZ: u8 = 231;
222pub const ORA_TYPE_NUM_VECTOR: u8 = 127;
223/// Maximum VECTOR prefetch length (`TNS_VECTOR_MAX_LENGTH` = 1 MiB).
224pub(crate) const TNS_VECTOR_MAX_LENGTH: u32 = 1024 * 1024;
225/// Maximum JSON (OSON) prefetch length (`TNS_JSON_MAX_LENGTH` = 32 MiB).
226pub(crate) const TNS_JSON_MAX_LENGTH: u32 = 32 * 1024 * 1024;
227pub const TNS_OBJ_TOP_LEVEL: u32 = 0x01;
228pub(crate) const TNS_LONG_LENGTH_INDICATOR: u8 = 254;
229pub(crate) const TNS_NULL_LENGTH_INDICATOR: u8 = 255;
230pub(crate) const TNS_OBJ_ATOMIC_NULL: u8 = 253;
231pub(crate) const TNS_OBJ_IS_DEGENERATE: u8 = 0x10;
232pub(crate) const TNS_OBJ_NO_PREFIX_SEG: u8 = 0x04;
233// DbObject pickle image constants (reference impl/thin/constants.pxi +
234// dbobject.pyx create_new_object/write_header).
235pub(crate) const TNS_OBJ_IS_VERSION_81: u8 = 0x80;
236pub(crate) const TNS_OBJ_IS_COLLECTION: u8 = 0x08;
237pub(crate) const TNS_OBJ_IMAGE_VERSION: u8 = 1;
238pub(crate) const TNS_OBJ_NON_NULL_OID: u8 = 0x02;
239pub(crate) const TNS_OBJ_HAS_EXTENT_OID: u8 = 0x08;
240pub(crate) const TNS_OBJ_HAS_INDEXES: u8 = 0x10;
241pub(crate) const TNS_OBJ_MAX_SHORT_LENGTH: usize = 245;
242/// `TNS_EXTENT_OID` = hex `00000000000000000000000000010001` (16 bytes).
243pub(crate) const TNS_EXTENT_OID: [u8; 16] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1];
244pub(crate) const TNS_XML_TYPE_LOB: u32 = 0x0001;
245pub(crate) const TNS_XML_TYPE_STRING: u32 = 0x0004;
246pub(crate) const TNS_XML_TYPE_FLAG_SKIP_NEXT_4: u32 = 0x100000;
247pub(crate) const TNS_LOB_LOC_OFFSET_FLAG_1: usize = 4;
248pub(crate) const TNS_LOB_LOC_OFFSET_FLAG_3: usize = 6;
249pub(crate) const TNS_LOB_LOC_OFFSET_FLAG_4: usize = 7;
250pub(crate) const TNS_LOB_LOC_FLAGS_ABSTRACT: u8 = 0x40;
251pub(crate) const TNS_LOB_LOC_FLAGS_TEMP: u8 = 0x01;
252pub(crate) const TNS_LOB_LOC_FLAGS_VAR_LENGTH_CHARSET: u8 = 0x80;
253pub(crate) const TNS_LOB_LOC_FLAGS_LITTLE_ENDIAN: u8 = 0x40;
254
255pub const CS_FORM_IMPLICIT: u8 = 1;
256pub const CS_FORM_NCHAR: u8 = 2;
257
258pub(crate) const TNS_GSO_DONT_CARE: u16 = 0x0001;
259/// Service-option bit advertising that the endpoint can receive an out-of-band
260/// "attention" (urgent-TCP break). The server echoes it in the accept's
261/// `protocol_options` when OOB breaks are negotiated (reference
262/// `TNS_GSO_CAN_RECV_ATTENTION`, constants.pxi:396); the reference derives
263/// `Capabilities.supports_oob` from `protocol_options & this`
264/// (capabilities.pyx:121).
265pub(crate) const TNS_GSO_CAN_RECV_ATTENTION: u16 = 0x0400;
266pub(crate) const TNS_NSI_DISABLE_NA: u8 = 0x04;
267pub(crate) const TNS_NSI_NA_REQUIRED: u8 = 0x10;
268pub(crate) const TNS_NSI_SUPPORT_SECURITY_RENEG: u8 = 0x80;
269pub(crate) const TNS_PROTOCOL_CHARACTERISTICS: u16 = 0x4f98;
270pub(crate) const TNS_ACCEPT_FLAG_FAST_AUTH: u32 = 0x1000_0000;
271pub(crate) const TNS_ACCEPT_FLAG_HAS_END_OF_RESPONSE: u32 = 0x0200_0000;
272pub(crate) const TNS_ACCEPT_FLAG_CHECK_OOB: u32 = 0x0000_0001;
273pub(crate) const TNS_SERVER_PIGGYBACK_QUERY_CACHE_INVALIDATION: u8 = 1;
274pub(crate) const TNS_SERVER_PIGGYBACK_OS_PID_MTS: u8 = 2;
275pub(crate) const TNS_SERVER_PIGGYBACK_TRACE_EVENT: u8 = 3;
276pub(crate) const TNS_SERVER_PIGGYBACK_SESS_RET: u8 = 4;
277pub(crate) const TNS_SERVER_PIGGYBACK_SYNC: u8 = 5;
278pub(crate) const TNS_SERVER_PIGGYBACK_LTXID: u8 = 7;
279pub(crate) const TNS_SERVER_PIGGYBACK_AC_REPLAY_CONTEXT: u8 = 8;
280pub(crate) const TNS_SERVER_PIGGYBACK_EXT_SYNC: u8 = 9;
281pub(crate) const TNS_SERVER_PIGGYBACK_SESS_SIGNATURE: u8 = 10;
282pub(crate) const TNS_CCAP_FIELD_VERSION: usize = 7;
283pub(crate) const TNS_CCAP_FIELD_VERSION_12_2: u8 = 8;
284pub(crate) const TNS_CCAP_FIELD_VERSION_20_1: u8 = 14;
285pub(crate) const TNS_CCAP_FIELD_VERSION_21_1: u8 = 16;
286pub(crate) const TNS_CCAP_FIELD_VERSION_23_1: u8 = 17;
287pub(crate) const TNS_CCAP_FIELD_VERSION_23_1_EXT_1: u8 = 18;
288pub(crate) const TNS_CCAP_FIELD_VERSION_23_1_EXT_3: u8 = 20;
289pub(crate) const TNS_CCAP_FIELD_VERSION_23_4: u8 = 24;
290pub(crate) const TNS_RCAP_TTC: usize = 6;
291pub(crate) const TNS_RCAP_TTC_32K: u8 = 0x04;
292pub(crate) const TNS_EXEC_OPTION_PARSE: u32 = 0x01;
293pub(crate) const TNS_EXEC_OPTION_BIND: u32 = 0x08;
294pub(crate) const TNS_EXEC_OPTION_DEFINE: u32 = 0x10;
295pub(crate) const TNS_EXEC_OPTION_EXECUTE: u32 = 0x20;
296pub(crate) const TNS_EXEC_OPTION_FETCH: u32 = 0x40;
297pub(crate) const TNS_EXEC_OPTION_PLSQL_BIND: u32 = 0x400;
298pub(crate) const TNS_EXEC_OPTION_NOT_PLSQL: u32 = 0x8000;
299pub(crate) const TNS_EXEC_OPTION_DESCRIBE: u32 = 0x20000;
300pub(crate) const TNS_EXEC_OPTION_BATCH_ERRORS: u32 = 0x80000;
301pub(crate) const TNS_EXEC_FLAGS_DML_ROWCOUNTS: u32 = 0x4000;
302pub(crate) const TNS_EXEC_FLAGS_SCROLLABLE: u32 = 0x02;
303pub(crate) const TNS_EXEC_FLAGS_NO_CANCEL_ON_EOF: u32 = 0x80;
304pub(crate) const TNS_DURATION_SESSION: u32 = 10;
305pub(crate) const TNS_LOB_OP_READ: u32 = 0x0002;
306pub(crate) const TNS_LOB_OP_TRIM: u32 = 0x0020;
307pub(crate) const TNS_LOB_OP_WRITE: u32 = 0x0040;
308pub(crate) const TNS_LOB_OP_CREATE_TEMP: u32 = 0x0110;
309pub(crate) const TNS_LOB_OP_FREE_TEMP: u32 = 0x0111;
310pub(crate) const TNS_LOB_OP_ARRAY: u32 = 0x80000;
311pub(crate) const TNS_LOB_PREFETCH_FLAG: u64 = 0x0200_0000;
312pub(crate) const TNS_EXEC_FLAGS_IMPLICIT_RESULTSET: u32 = 0x8000;
313pub(crate) const TNS_BIND_USE_INDICATORS: u8 = 0x01;
314pub(crate) const TNS_BIND_ARRAY: u8 = 0x40;
315pub(crate) const TNS_BIND_DIR_INPUT: u8 = 32;
316pub(crate) const TNS_CHARSET_UTF8: u16 = 873;
317pub const TNS_MAX_LONG_LENGTH: u32 = 0x7fff_ffff;
318pub(crate) const TNS_ERR_NO_DATA_FOUND: u32 = 1403;
319pub(crate) const TNS_ERR_ARRAY_DML_ERRORS: u32 = 24381;
320// reference thin/constants.pxi:581-582
321pub(crate) const TNS_UDS_FLAGS_IS_JSON: u32 = 0x0000_0100;
322pub(crate) const TNS_UDS_FLAGS_IS_OSON: u32 = 0x0000_0800;
323pub(crate) const ORA_TYPE_SIZE_BINARY_DOUBLE: u32 = 8;
324pub(crate) const ORA_TYPE_SIZE_BINARY_FLOAT: u32 = 4;
325pub(crate) const ORA_TYPE_SIZE_BOOLEAN: u32 = 4;
326/// Marker byte introducing a length-escaped value on the wire. A NULL BOOLEAN
327/// bind is encoded as the two raw bytes `[TNS_ESCAPE_CHAR, 1]` rather than the
328/// usual single `0` null indicator (reference messages/base.pyx
329/// `_write_bind_params_column`).
330pub(crate) const TNS_ESCAPE_CHAR: u8 = 253;
331pub(crate) const ORA_TYPE_SIZE_NUMBER: u32 = 22;
332pub(crate) const ORA_TYPE_SIZE_DATE: u32 = 7;
333pub(crate) const ORA_TYPE_SIZE_INTERVAL_DS: u32 = 11;
334pub(crate) const ORA_TYPE_SIZE_INTERVAL_YM: u32 = 5;
335pub(crate) const ORA_TYPE_SIZE_ROWID: u32 = 18;
336pub(crate) const ORA_TYPE_SIZE_TIMESTAMP: u32 = 11;
337pub(crate) const ORA_TYPE_SIZE_TIMESTAMP_TZ: u32 = 13;
338pub(crate) const TNS_BASE64_ALPHABET: &[u8; 64] =
339    b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
340pub(crate) const TNS_HAS_REGION_ID: u8 = 0x80;
341pub(crate) const TZ_HOUR_OFFSET: u8 = 20;
342pub(crate) const TZ_MINUTE_OFFSET: u8 = 60;
343pub(crate) const NUMBER_AS_TEXT_CHARS: usize = 172;
344pub(crate) const NUMBER_MAX_DIGITS: usize = 40;
345
346pub(crate) const FAST_AUTH_PREFIX_HEX: &str = concat!(
347    "22010100010600707974686f6e2d6f7261636c6564620000000000000d0269036903033506000000",
348    "ea180018010100000000002990030703000100cf000004010000001000000c2000b80008640005003",
349    "e02000000000000030b0200000000000500000000000100010001000000020002000a000000080008",
350    "00010000000c000c000a0000001700170001000000180018000100000019001900010000001a001a",
351    "00010000001b001b000a0000001c001c00010000001d001d00010000001e001e00010000001f001f",
352    "0001000000200020000100000021002100010000000a000a00010000000b000b0001000000280028",
353    "00010000002900290001000000750075000100000078007800010000012201220001000001230123",
354    "00010000012401240001000001250125000100000126012600010000012a012a00010000012b012b",
355    "00010000012c012c00010000012d012d00010000012e012e00010000012f012f0001000001300130",
356    "00010000013101310001000001320132000100000133013300010000013401340001000001350135",
357    "000100000136013600010000013701370001000001380138000100000139013900010000013b013b",
358    "00010000013c013c00010000013d013d00010000013e013e00010000013f013f0001000001400140",
359    "00010000014101410001000001420142000100000143014300010000014701470001000001480148",
360    "000100000149014900010000014b014b00010000014d014d00010000014e014e00010000014f014f",
361    "00010000015001500001000001510151000100000152015200010000015301530001000001540154",
362    "00010000015501550001000001560156000100000157015700010000015801580001000001590159",
363    "00010000015a015a00010000015c015c00010000015d015d00010000016201620001000001630163",
364    "000100000167016700010000016b016b00010000017c017c00010000017d017d00010000017e017e",
365    "00010000017f017f0001000001800180000100000181018100010000018201820001000001830183",
366    "00010000018401840001000001850185000100000186018600010000018701870001000001890189",
367    "00010000018a018a00010000018b018b00010000018c018c00010000018d018d00010000018e018e",
368    "00010000018f018f0001000001900190000100000191019100010000019401940001000001950195",
369    "0001000001960196000100000197019700010000019d019d00010000019e019e00010000019f019f",
370    "0001000001a001a00001000001a101a10001000001a201a20001000001a301a30001000001a401a4",
371    "0001000001a501a50001000001a601a60001000001a701a70001000001a801a80001000001a901a9",
372    "0001000001aa01aa0001000001ab01ab0001000001ad01ad0001000001ae01ae0001000001af01af",
373    "0001000001b001b00001000001b101b10001000001c101c10001000001c201c20001000001c601c6",
374    "0001000001c701c70001000001c801c80001000001c901c90001000001ca01ca0001000001cb01cb",
375    "0001000001cc01cc0001000001cd01cd0001000001ce01ce0001000001cf01cf0001000001d201d2",
376    "0001000001d301d30001000001d401d40001000001d501d50001000001d601d60001000001d701d7",
377    "0001000001d801d80001000001d901d90001000001da01da0001000001db01db0001000001dc01dc",
378    "0001000001dd01dd0001000001de01de0001000001df01df0001000001e001e00001000001e101e1",
379    "0001000001e201e20001000001e301e30001000001e401e40001000001e501e50001000001e601e6",
380    "0001000001ea01ea0001000001eb01eb0001000001ec01ec0001000001ed01ed0001000001ee01ee",
381    "0001000001ef01ef0001000001f001f00001000001f201f20001000001f301f30001000001f401f4",
382    "0001000001f501f50001000001f601f60001000001fd01fd0001000001fe01fe0001000002010201",
383    "00010000020202020001000002040204000100000205020500010000020602060001000002070207",
384    "0001000002080208000100000209020900010000020a020a00010000020b020b00010000020c020c",
385    "00010000020d020d00010000020e020e00010000020f020f00010000021002100001000002110211",
386    "00010000021202120001000002130213000100000214021400010000021502150001000002160216",
387    "00010000021702170001000002180218000100000219021900010000021a021a00010000021b021b",
388    "00010000021c021c00010000021d021d00010000021e021e00010000021f021f0001000002300230",
389    "000100000235023500010000023c023c00010000023d023d00010000023e023e00010000023f023f",
390    "00010000024002400001000002420242000100000233023300010000023402340001000002430243",
391    "00010000024402440001000002450245000100000246024600010000024702470001000002480248",
392    "00010000024902490001000000030002000a000000040002000a0000000500010001000000060002",
393    "000a000000070002000a00000009000100010000000f000100010000002700270001000000440002",
394    "000a0000005b0002000a0000005e000100010000005f001700010000006000600001000000610060",
395    "000100000064006400010000006500650001000000660066000100000068000b00010000006a006a",
396    "00010000006c006d00010000006d006d00010000006e006f00010000006f006f0001000000700070",
397    "00010000007100710001000000720072000100000073007300010000007400660001000000770077",
398    "0001000000c600c600010000009200920001000000980002000a000000990002000a0000009a0002",
399    "000a0000009b000100010000009c000c000a000000ac0002000a000000b200b20001000000b300b3",
400    "0001000000b400b40001000000b500b50001000000b600b60001000000b700b70001000000b8000c",
401    "000a000000b900b90001000000ba00ba0001000000bb00bb0001000000bc00bc0001000000bd00bd",
402    "0001000000be00be0001000000c300700001000000c400710001000000c500720001000000d000d0",
403    "0001000000e700e70001000000e800e70001000000e900e90001000000f1006d0001000000fc00fc",
404    "00010000024e024e00010000024f024f000100000250025000010000026502650001000002660266",
405    "00010000026702670001000002680268000100000263026300010000026402640001000002510251",
406    "00010000025202520001000002530253000100000254025400010000025502550001000002560256",
407    "00010000025702570001000002580258000100000259025900010000025a025a00010000025b025b",
408    "00010000025c025c00010000025d025d00010000026e026e00010000026f026f0001000002700270",
409    "00010000027102710001000002720272000100000273027300010000027402740001000002750275",
410    "00010000027602760001000002770277000100000278027800010000027d027d00010000027e027e",
411    "00010000027c027c00010000027f027f0001000002970297000100000280028000010000028c028c",
412    "0001000002860286000100000287028700010000007f007f00010000029402940001000002950295",
413    "000100000299029900010000029d029d00010000029e029e000100000000"
414);
415
416pub(crate) const TNS_DURATION_MID: i64 = 0x8000_0000;
417pub(crate) const TNS_DURATION_OFFSET: i32 = 60;