FreeTDS API: src/tds/tds_types.h Source File

FreeTDS API

tds_types.h
1 /*
2 * This file produced from ./types.pl
3 */
4
8 int
9 tds_get_size_by_type(TDS_SERVER_TYPE servertype)
10 {
11 switch (servertype) {
12 case SYBVOID:
13 return 0;
14 case SYBBIT:
15 case SYBBITN:
16 case SYBINT1:
17 case SYBSINT1:
18 case SYBUINT1:
19 return 1;
20 case SYBINT2:
21 case SYBUINT2:
22 return 2;
23 case SYBMSDATE:
24 return 3;
25 case SYBDATE:
26 case SYBDATEN:
27 case SYBDATETIME4:
28 case SYBINT4:
29 case SYBMONEY4:
30 case SYBREAL:
31 case SYBTIME:
32 case SYBTIMEN:
33 case SYBUINT4:
34 return 4;
35 case SYB5BIGDATETIME:
36 case SYB5BIGTIME:
37 case SYB5INT8:
38 case SYBDATETIME:
39 case SYBFLT8:
40 case SYBINT8:
41 case SYBINTERVAL:
42 case SYBMONEY:
43 case SYBUINT8:
44 return 8;
45 case SYBUNIQUE:
46 return 16;
47 default:
48 return 0;
49 }
50 }
51
56 int
57 tds_get_varint_size(TDSCONNECTION * conn, int datatype)
58 {
59 switch (datatype) {
60 case SYBBIT:
61 case SYBDATETIME:
62 case SYBDATETIME4:
63 case SYBFLT8:
64 case SYBINT1:
65 case SYBINT2:
66 case SYBINT4:
67 case SYBMONEY:
68 case SYBMONEY4:
69 case SYBREAL:
70 case SYBVOID:
71 return 0;
72 case SYBIMAGE:
73 case SYBTEXT:
74 return 4;
75 }
76
77 if (IS_TDS7_PLUS(conn)) {
78 switch (datatype) {
79 case SYBINT8:
80 return 0;
81 case XSYBBINARY:
82 case XSYBCHAR:
83 case XSYBNCHAR:
84 case XSYBNVARCHAR:
85 case XSYBVARBINARY:
86 case XSYBVARCHAR:
87 return 2;
88 case SYBNTEXT:
89 case SYBVARIANT:
90 return 4;
91 case SYBMSUDT:
92 case SYBMSXML:
93 return 8;
94 }
95 } else if (IS_TDS50(conn)) {
96 switch (datatype) {
97 case SYB5INT8:
98 case SYBDATE:
99 case SYBINTERVAL:
100 case SYBSINT1:
101 case SYBTIME:
102 case SYBUINT1:
103 case SYBUINT2:
104 case SYBUINT4:
105 case SYBUINT8:
106 return 0;
107 case SYBUNITEXT:
108 case SYBXML:
109 return 4;
110 case SYBLONGBINARY:
111 case SYBLONGCHAR:
112 return 5;
113 }
114 }
115 return 1;
116 }
117
124 TDS_SERVER_TYPE
125 tds_get_conversion_type(TDS_SERVER_TYPE srctype, int colsize)
126 {
127 switch (srctype) {
128 case SYBBITN:
129 return SYBBIT;
130 case SYBDATEN:
131 return SYBDATE;
132 case SYBDATETIMN:
133 switch (colsize) {
134 case 8:
135 return SYBDATETIME;
136 case 4:
137 return SYBDATETIME4;
138 }
139 break;
140 case SYBFLTN:
141 switch (colsize) {
142 case 8:
143 return SYBFLT8;
144 case 4:
145 return SYBREAL;
146 }
147 break;
148 case SYBINTN:
149 switch (colsize) {
150 case 8:
151 return SYBINT8;
152 case 4:
153 return SYBINT4;
154 case 2:
155 return SYBINT2;
156 case 1:
157 return SYBINT1;
158 }
159 break;
160 case SYBMONEYN:
161 switch (colsize) {
162 case 8:
163 return SYBMONEY;
164 case 4:
165 return SYBMONEY4;
166 }
167 break;
168 case SYBTIMEN:
169 return SYBTIME;
170 case SYBUINTN:
171 switch (colsize) {
172 case 8:
173 return SYBUINT8;
174 case 4:
175 return SYBUINT4;
176 case 2:
177 return SYBUINT2;
178 case 1:
179 return SYBUINT1;
180 }
181 break;
182 case SYB5INT8:
183 return SYBINT8;
184 default:
185 break;
186 }
187 return srctype;
188 }
189
190 const uint16_t tds_type_flags_ms[256] = {
191 /* 0 empty */ TDS_TYPEFLAG_INVALID,
192 /* 1 empty */ TDS_TYPEFLAG_INVALID,
193 /* 2 empty */ TDS_TYPEFLAG_INVALID,
194 /* 3 empty */ TDS_TYPEFLAG_INVALID,
195 /* 4 empty */ TDS_TYPEFLAG_INVALID,
196 /* 5 empty */ TDS_TYPEFLAG_INVALID,
197 /* 6 empty */ TDS_TYPEFLAG_INVALID,
198 /* 7 empty */ TDS_TYPEFLAG_INVALID,
199 /* 8 empty */ TDS_TYPEFLAG_INVALID,
200 /* 9 empty */ TDS_TYPEFLAG_INVALID,
201 /* 10 empty */ TDS_TYPEFLAG_INVALID,
202 /* 11 empty */ TDS_TYPEFLAG_INVALID,
203 /* 12 empty */ TDS_TYPEFLAG_INVALID,
204 /* 13 empty */ TDS_TYPEFLAG_INVALID,
205 /* 14 empty */ TDS_TYPEFLAG_INVALID,
206 /* 15 empty */ TDS_TYPEFLAG_INVALID,
207 /* 16 empty */ TDS_TYPEFLAG_INVALID,
208 /* 17 empty */ TDS_TYPEFLAG_INVALID,
209 /* 18 empty */ TDS_TYPEFLAG_INVALID,
210 /* 19 empty */ TDS_TYPEFLAG_INVALID,
211 /* 20 empty */ TDS_TYPEFLAG_INVALID,
212 /* 21 empty */ TDS_TYPEFLAG_INVALID,
213 /* 22 empty */ TDS_TYPEFLAG_INVALID,
214 /* 23 empty */ TDS_TYPEFLAG_INVALID,
215 /* 24 empty */ TDS_TYPEFLAG_INVALID,
216 /* 25 empty */ TDS_TYPEFLAG_INVALID,
217 /* 26 empty */ TDS_TYPEFLAG_INVALID,
218 /* 27 empty */ TDS_TYPEFLAG_INVALID,
219 /* 28 empty */ TDS_TYPEFLAG_INVALID,
220 /* 29 empty */ TDS_TYPEFLAG_INVALID,
221 /* 30 empty */ TDS_TYPEFLAG_INVALID,
222 /* 31 SYBVOID */ TDS_TYPEFLAG_FIXED,
223 /* 32 empty */ TDS_TYPEFLAG_INVALID,
224 /* 33 empty */ TDS_TYPEFLAG_INVALID,
225 /* 34 SYBIMAGE */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY,
226 /* 35 SYBTEXT */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_COLLATE|TDS_TYPEFLAG_ASCII,
227 /* 36 SYBUNIQUE */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
228 /* 37 SYBVARBINARY */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY|TDS_TYPEFLAG_VARIANT,
229 /* 38 SYBINTN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIANT,
230 /* 39 SYBVARCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_ASCII|TDS_TYPEFLAG_VARIANT,
231 /* 40 SYBMSDATE */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
232 /* 41 SYBMSTIME */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
233 /* 42 SYBMSDATETIME2 */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
234 /* 43 SYBMSDATETIMEOFFSET */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
235 /* 44 empty */ TDS_TYPEFLAG_INVALID,
236 /* 45 SYBBINARY */ TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY|TDS_TYPEFLAG_VARIANT,
237 /* 46 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
238 /* 47 SYBCHAR */ TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_ASCII|TDS_TYPEFLAG_VARIANT,
239 /* 48 SYBINT1 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
240 /* 49 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME,
241 /* 50 SYBBIT */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
242 /* 51 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME,
243 /* 52 SYBINT2 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
244 /* 53 empty */ TDS_TYPEFLAG_INVALID,
245 /* 54 empty */ TDS_TYPEFLAG_INVALID,
246 /* 55 empty */ TDS_TYPEFLAG_INVALID,
247 /* 56 SYBINT4 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
248 /* 57 empty */ TDS_TYPEFLAG_INVALID,
249 /* 58 SYBDATETIME4 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
250 /* 59 SYBREAL */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
251 /* 60 SYBMONEY */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
252 /* 61 SYBDATETIME */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
253 /* 62 SYBFLT8 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
254 /* 63 empty */ TDS_TYPEFLAG_INVALID,
255 /* 64 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
256 /* 65 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
257 /* 66 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
258 /* 67 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
259 /* 68 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE,
260 /* 69 empty */ TDS_TYPEFLAG_INVALID,
261 /* 70 empty */ TDS_TYPEFLAG_INVALID,
262 /* 71 empty */ TDS_TYPEFLAG_INVALID,
263 /* 72 empty */ TDS_TYPEFLAG_INVALID,
264 /* 73 empty */ TDS_TYPEFLAG_INVALID,
265 /* 74 empty */ TDS_TYPEFLAG_INVALID,
266 /* 75 empty */ TDS_TYPEFLAG_INVALID,
267 /* 76 empty */ TDS_TYPEFLAG_INVALID,
268 /* 77 empty */ TDS_TYPEFLAG_INVALID,
269 /* 78 empty */ TDS_TYPEFLAG_INVALID,
270 /* 79 empty */ TDS_TYPEFLAG_INVALID,
271 /* 80 empty */ TDS_TYPEFLAG_INVALID,
272 /* 81 empty */ TDS_TYPEFLAG_INVALID,
273 /* 82 empty */ TDS_TYPEFLAG_INVALID,
274 /* 83 empty */ TDS_TYPEFLAG_INVALID,
275 /* 84 empty */ TDS_TYPEFLAG_INVALID,
276 /* 85 empty */ TDS_TYPEFLAG_INVALID,
277 /* 86 empty */ TDS_TYPEFLAG_INVALID,
278 /* 87 empty */ TDS_TYPEFLAG_INVALID,
279 /* 88 empty */ TDS_TYPEFLAG_INVALID,
280 /* 89 empty */ TDS_TYPEFLAG_INVALID,
281 /* 90 empty */ TDS_TYPEFLAG_INVALID,
282 /* 91 empty */ TDS_TYPEFLAG_INVALID,
283 /* 92 empty */ TDS_TYPEFLAG_INVALID,
284 /* 93 empty */ TDS_TYPEFLAG_INVALID,
285 /* 94 empty */ TDS_TYPEFLAG_INVALID,
286 /* 95 empty */ TDS_TYPEFLAG_INVALID,
287 /* 96 empty */ TDS_TYPEFLAG_INVALID,
288 /* 97 empty */ TDS_TYPEFLAG_INVALID,
289 /* 98 SYBVARIANT */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE,
290 /* 99 SYBNTEXT */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_COLLATE|TDS_TYPEFLAG_UNICODE,
291 /* 100 empty */ TDS_TYPEFLAG_INVALID,
292 /* 101 empty */ TDS_TYPEFLAG_INVALID,
293 /* 102 empty */ TDS_TYPEFLAG_INVALID,
294 /* 103 SYBNVARCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE|TDS_TYPEFLAG_VARIANT,
295 /* 104 SYBBITN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIANT,
296 /* 105 empty */ TDS_TYPEFLAG_INVALID,
297 /* 106 SYBDECIMAL */ TDS_TYPEFLAG_NUMERIC|TDS_TYPEFLAG_VARIANT,
298 /* 107 empty */ TDS_TYPEFLAG_INVALID,
299 /* 108 SYBNUMERIC */ TDS_TYPEFLAG_NUMERIC|TDS_TYPEFLAG_VARIANT,
300 /* 109 SYBFLTN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIANT,
301 /* 110 SYBMONEYN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIANT,
302 /* 111 SYBDATETIMN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
303 /* 112 empty */ TDS_TYPEFLAG_INVALID,
304 /* 113 empty */ TDS_TYPEFLAG_INVALID,
305 /* 114 empty */ TDS_TYPEFLAG_INVALID,
306 /* 115 empty */ TDS_TYPEFLAG_INVALID,
307 /* 116 empty */ TDS_TYPEFLAG_INVALID,
308 /* 117 empty */ TDS_TYPEFLAG_INVALID,
309 /* 118 empty */ TDS_TYPEFLAG_INVALID,
310 /* 119 empty */ TDS_TYPEFLAG_INVALID,
311 /* 120 empty */ TDS_TYPEFLAG_INVALID,
312 /* 121 empty */ TDS_TYPEFLAG_INVALID,
313 /* 122 SYBMONEY4 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
314 /* 123 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
315 /* 124 empty */ TDS_TYPEFLAG_INVALID,
316 /* 125 empty */ TDS_TYPEFLAG_INVALID,
317 /* 126 empty */ TDS_TYPEFLAG_INVALID,
318 /* 127 SYBINT8 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
319 /* 128 empty */ TDS_TYPEFLAG_INVALID,
320 /* 129 empty */ TDS_TYPEFLAG_INVALID,
321 /* 130 empty */ TDS_TYPEFLAG_INVALID,
322 /* 131 empty */ TDS_TYPEFLAG_INVALID,
323 /* 132 empty */ TDS_TYPEFLAG_INVALID,
324 /* 133 empty */ TDS_TYPEFLAG_INVALID,
325 /* 134 empty */ TDS_TYPEFLAG_INVALID,
326 /* 135 empty */ TDS_TYPEFLAG_INVALID,
327 /* 136 empty */ TDS_TYPEFLAG_INVALID,
328 /* 137 empty */ TDS_TYPEFLAG_INVALID,
329 /* 138 empty */ TDS_TYPEFLAG_INVALID,
330 /* 139 empty */ TDS_TYPEFLAG_INVALID,
331 /* 140 empty */ TDS_TYPEFLAG_INVALID,
332 /* 141 empty */ TDS_TYPEFLAG_INVALID,
333 /* 142 empty */ TDS_TYPEFLAG_INVALID,
334 /* 143 empty */ TDS_TYPEFLAG_INVALID,
335 /* 144 empty */ TDS_TYPEFLAG_INVALID,
336 /* 145 empty */ TDS_TYPEFLAG_INVALID,
337 /* 146 empty */ TDS_TYPEFLAG_INVALID,
338 /* 147 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
339 /* 148 empty */ TDS_TYPEFLAG_INVALID,
340 /* 149 empty */ TDS_TYPEFLAG_INVALID,
341 /* 150 empty */ TDS_TYPEFLAG_INVALID,
342 /* 151 empty */ TDS_TYPEFLAG_INVALID,
343 /* 152 empty */ TDS_TYPEFLAG_INVALID,
344 /* 153 empty */ TDS_TYPEFLAG_INVALID,
345 /* 154 empty */ TDS_TYPEFLAG_INVALID,
346 /* 155 empty */ TDS_TYPEFLAG_INVALID,
347 /* 156 empty */ TDS_TYPEFLAG_INVALID,
348 /* 157 empty */ TDS_TYPEFLAG_INVALID,
349 /* 158 empty */ TDS_TYPEFLAG_INVALID,
350 /* 159 empty */ TDS_TYPEFLAG_INVALID,
351 /* 160 empty */ TDS_TYPEFLAG_INVALID,
352 /* 161 empty */ TDS_TYPEFLAG_INVALID,
353 /* 162 empty */ TDS_TYPEFLAG_INVALID,
354 /* 163 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE,
355 /* 164 empty */ TDS_TYPEFLAG_INVALID,
356 /* 165 XSYBVARBINARY */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY|TDS_TYPEFLAG_VARIANT,
357 /* 166 empty */ TDS_TYPEFLAG_INVALID,
358 /* 167 XSYBVARCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_COLLATE|TDS_TYPEFLAG_ASCII|TDS_TYPEFLAG_VARIANT,
359 /* 168 empty */ TDS_TYPEFLAG_INVALID,
360 /* 169 empty */ TDS_TYPEFLAG_INVALID,
361 /* 170 empty */ TDS_TYPEFLAG_INVALID,
362 /* 171 empty */ TDS_TYPEFLAG_INVALID,
363 /* 172 empty */ TDS_TYPEFLAG_INVALID,
364 /* 173 XSYBBINARY */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY|TDS_TYPEFLAG_VARIANT,
365 /* 174 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE,
366 /* 175 XSYBCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_COLLATE|TDS_TYPEFLAG_ASCII|TDS_TYPEFLAG_VARIANT,
367 /* 176 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
368 /* 177 empty */ TDS_TYPEFLAG_INVALID,
369 /* 178 empty */ TDS_TYPEFLAG_INVALID,
370 /* 179 empty */ TDS_TYPEFLAG_INVALID,
371 /* 180 empty */ TDS_TYPEFLAG_INVALID,
372 /* 181 empty */ TDS_TYPEFLAG_INVALID,
373 /* 182 empty */ TDS_TYPEFLAG_INVALID,
374 /* 183 empty */ TDS_TYPEFLAG_INVALID,
375 /* 184 empty */ TDS_TYPEFLAG_INVALID,
376 /* 185 empty */ TDS_TYPEFLAG_INVALID,
377 /* 186 empty */ TDS_TYPEFLAG_INVALID,
378 /* 187 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
379 /* 188 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
380 /* 189 empty */ TDS_TYPEFLAG_INVALID,
381 /* 190 empty */ TDS_TYPEFLAG_INVALID,
382 /* 191 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
383 /* 192 empty */ TDS_TYPEFLAG_INVALID,
384 /* 193 empty */ TDS_TYPEFLAG_INVALID,
385 /* 194 empty */ TDS_TYPEFLAG_INVALID,
386 /* 195 empty */ TDS_TYPEFLAG_INVALID,
387 /* 196 empty */ TDS_TYPEFLAG_INVALID,
388 /* 197 empty */ TDS_TYPEFLAG_INVALID,
389 /* 198 empty */ TDS_TYPEFLAG_INVALID,
390 /* 199 empty */ TDS_TYPEFLAG_INVALID,
391 /* 200 empty */ TDS_TYPEFLAG_INVALID,
392 /* 201 empty */ TDS_TYPEFLAG_INVALID,
393 /* 202 empty */ TDS_TYPEFLAG_INVALID,
394 /* 203 empty */ TDS_TYPEFLAG_INVALID,
395 /* 204 empty */ TDS_TYPEFLAG_INVALID,
396 /* 205 empty */ TDS_TYPEFLAG_INVALID,
397 /* 206 empty */ TDS_TYPEFLAG_INVALID,
398 /* 207 empty */ TDS_TYPEFLAG_INVALID,
399 /* 208 empty */ TDS_TYPEFLAG_INVALID,
400 /* 209 empty */ TDS_TYPEFLAG_INVALID,
401 /* 210 empty */ TDS_TYPEFLAG_INVALID,
402 /* 211 empty */ TDS_TYPEFLAG_INVALID,
403 /* 212 empty */ TDS_TYPEFLAG_INVALID,
404 /* 213 empty */ TDS_TYPEFLAG_INVALID,
405 /* 214 empty */ TDS_TYPEFLAG_INVALID,
406 /* 215 empty */ TDS_TYPEFLAG_INVALID,
407 /* 216 empty */ TDS_TYPEFLAG_INVALID,
408 /* 217 empty */ TDS_TYPEFLAG_INVALID,
409 /* 218 empty */ TDS_TYPEFLAG_INVALID,
410 /* 219 empty */ TDS_TYPEFLAG_INVALID,
411 /* 220 empty */ TDS_TYPEFLAG_INVALID,
412 /* 221 empty */ TDS_TYPEFLAG_INVALID,
413 /* 222 empty */ TDS_TYPEFLAG_INVALID,
414 /* 223 empty */ TDS_TYPEFLAG_INVALID,
415 /* 224 empty */ TDS_TYPEFLAG_INVALID,
416 /* 225 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY,
417 /* 226 empty */ TDS_TYPEFLAG_INVALID,
418 /* 227 empty */ TDS_TYPEFLAG_INVALID,
419 /* 228 empty */ TDS_TYPEFLAG_INVALID,
420 /* 229 empty */ TDS_TYPEFLAG_INVALID,
421 /* 230 empty */ TDS_TYPEFLAG_INVALID,
422 /* 231 XSYBNVARCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_COLLATE|TDS_TYPEFLAG_UNICODE|TDS_TYPEFLAG_VARIANT,
423 /* 232 empty */ TDS_TYPEFLAG_INVALID,
424 /* 233 empty */ TDS_TYPEFLAG_INVALID,
425 /* 234 empty */ TDS_TYPEFLAG_INVALID,
426 /* 235 empty */ TDS_TYPEFLAG_INVALID,
427 /* 236 empty */ TDS_TYPEFLAG_INVALID,
428 /* 237 empty */ TDS_TYPEFLAG_INVALID,
429 /* 238 empty */ TDS_TYPEFLAG_INVALID,
430 /* 239 XSYBNCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_COLLATE|TDS_TYPEFLAG_UNICODE|TDS_TYPEFLAG_VARIANT,
431 /* 240 SYBMSUDT */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE,
432 /* 241 SYBMSXML */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE,
433 /* 242 empty */ TDS_TYPEFLAG_INVALID,
434 /* 243 empty */ TDS_TYPEFLAG_INVALID,
435 /* 244 empty */ TDS_TYPEFLAG_INVALID,
436 /* 245 empty */ TDS_TYPEFLAG_INVALID,
437 /* 246 empty */ TDS_TYPEFLAG_INVALID,
438 /* 247 empty */ TDS_TYPEFLAG_INVALID,
439 /* 248 empty */ TDS_TYPEFLAG_INVALID,
440 /* 249 empty */ TDS_TYPEFLAG_INVALID,
441 /* 250 empty */ TDS_TYPEFLAG_INVALID,
442 /* 251 empty */ TDS_TYPEFLAG_INVALID,
443 /* 252 empty */ TDS_TYPEFLAG_INVALID,
444 /* 253 empty */ TDS_TYPEFLAG_INVALID,
445 /* 254 empty */ TDS_TYPEFLAG_INVALID,
446 /* 255 empty */ TDS_TYPEFLAG_INVALID,
447 };
448
449 #if 0
450 const uint16_t tds_type_flags_syb[256] = {
451 /* 0 empty */ TDS_TYPEFLAG_INVALID,
452 /* 1 empty */ TDS_TYPEFLAG_INVALID,
453 /* 2 empty */ TDS_TYPEFLAG_INVALID,
454 /* 3 empty */ TDS_TYPEFLAG_INVALID,
455 /* 4 empty */ TDS_TYPEFLAG_INVALID,
456 /* 5 empty */ TDS_TYPEFLAG_INVALID,
457 /* 6 empty */ TDS_TYPEFLAG_INVALID,
458 /* 7 empty */ TDS_TYPEFLAG_INVALID,
459 /* 8 empty */ TDS_TYPEFLAG_INVALID,
460 /* 9 empty */ TDS_TYPEFLAG_INVALID,
461 /* 10 empty */ TDS_TYPEFLAG_INVALID,
462 /* 11 empty */ TDS_TYPEFLAG_INVALID,
463 /* 12 empty */ TDS_TYPEFLAG_INVALID,
464 /* 13 empty */ TDS_TYPEFLAG_INVALID,
465 /* 14 empty */ TDS_TYPEFLAG_INVALID,
466 /* 15 empty */ TDS_TYPEFLAG_INVALID,
467 /* 16 empty */ TDS_TYPEFLAG_INVALID,
468 /* 17 empty */ TDS_TYPEFLAG_INVALID,
469 /* 18 empty */ TDS_TYPEFLAG_INVALID,
470 /* 19 empty */ TDS_TYPEFLAG_INVALID,
471 /* 20 empty */ TDS_TYPEFLAG_INVALID,
472 /* 21 empty */ TDS_TYPEFLAG_INVALID,
473 /* 22 empty */ TDS_TYPEFLAG_INVALID,
474 /* 23 empty */ TDS_TYPEFLAG_INVALID,
475 /* 24 empty */ TDS_TYPEFLAG_INVALID,
476 /* 25 empty */ TDS_TYPEFLAG_INVALID,
477 /* 26 empty */ TDS_TYPEFLAG_INVALID,
478 /* 27 empty */ TDS_TYPEFLAG_INVALID,
479 /* 28 empty */ TDS_TYPEFLAG_INVALID,
480 /* 29 empty */ TDS_TYPEFLAG_INVALID,
481 /* 30 empty */ TDS_TYPEFLAG_INVALID,
482 /* 31 SYBVOID */ TDS_TYPEFLAG_FIXED,
483 /* 32 empty */ TDS_TYPEFLAG_INVALID,
484 /* 33 empty */ TDS_TYPEFLAG_INVALID,
485 /* 34 SYBIMAGE */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY,
486 /* 35 SYBTEXT */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_COLLATE|TDS_TYPEFLAG_ASCII,
487 /* 36 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_NULLABLE,
488 /* 37 SYBVARBINARY */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY|TDS_TYPEFLAG_VARIANT,
489 /* 38 SYBINTN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIANT,
490 /* 39 SYBVARCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_ASCII|TDS_TYPEFLAG_VARIANT,
491 /* 40 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
492 /* 41 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
493 /* 42 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
494 /* 43 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
495 /* 44 empty */ TDS_TYPEFLAG_INVALID,
496 /* 45 SYBBINARY */ TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY|TDS_TYPEFLAG_VARIANT,
497 /* 46 SYBINTERVAL */ TDS_TYPEFLAG_FIXED,
498 /* 47 SYBCHAR */ TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_ASCII|TDS_TYPEFLAG_VARIANT,
499 /* 48 SYBINT1 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
500 /* 49 SYBDATE */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME,
501 /* 50 SYBBIT */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
502 /* 51 SYBTIME */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME,
503 /* 52 SYBINT2 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
504 /* 53 empty */ TDS_TYPEFLAG_INVALID,
505 /* 54 empty */ TDS_TYPEFLAG_INVALID,
506 /* 55 empty */ TDS_TYPEFLAG_INVALID,
507 /* 56 SYBINT4 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
508 /* 57 empty */ TDS_TYPEFLAG_INVALID,
509 /* 58 SYBDATETIME4 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
510 /* 59 SYBREAL */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
511 /* 60 SYBMONEY */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
512 /* 61 SYBDATETIME */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
513 /* 62 SYBFLT8 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
514 /* 63 empty */ TDS_TYPEFLAG_INVALID,
515 /* 64 SYBUINT1 */ TDS_TYPEFLAG_FIXED,
516 /* 65 SYBUINT2 */ TDS_TYPEFLAG_FIXED,
517 /* 66 SYBUINT4 */ TDS_TYPEFLAG_FIXED,
518 /* 67 SYBUINT8 */ TDS_TYPEFLAG_FIXED,
519 /* 68 SYBUINTN */ TDS_TYPEFLAG_NULLABLE,
520 /* 69 empty */ TDS_TYPEFLAG_INVALID,
521 /* 70 empty */ TDS_TYPEFLAG_INVALID,
522 /* 71 empty */ TDS_TYPEFLAG_INVALID,
523 /* 72 empty */ TDS_TYPEFLAG_INVALID,
524 /* 73 empty */ TDS_TYPEFLAG_INVALID,
525 /* 74 empty */ TDS_TYPEFLAG_INVALID,
526 /* 75 empty */ TDS_TYPEFLAG_INVALID,
527 /* 76 empty */ TDS_TYPEFLAG_INVALID,
528 /* 77 empty */ TDS_TYPEFLAG_INVALID,
529 /* 78 empty */ TDS_TYPEFLAG_INVALID,
530 /* 79 empty */ TDS_TYPEFLAG_INVALID,
531 /* 80 empty */ TDS_TYPEFLAG_INVALID,
532 /* 81 empty */ TDS_TYPEFLAG_INVALID,
533 /* 82 empty */ TDS_TYPEFLAG_INVALID,
534 /* 83 empty */ TDS_TYPEFLAG_INVALID,
535 /* 84 empty */ TDS_TYPEFLAG_INVALID,
536 /* 85 empty */ TDS_TYPEFLAG_INVALID,
537 /* 86 empty */ TDS_TYPEFLAG_INVALID,
538 /* 87 empty */ TDS_TYPEFLAG_INVALID,
539 /* 88 empty */ TDS_TYPEFLAG_INVALID,
540 /* 89 empty */ TDS_TYPEFLAG_INVALID,
541 /* 90 empty */ TDS_TYPEFLAG_INVALID,
542 /* 91 empty */ TDS_TYPEFLAG_INVALID,
543 /* 92 empty */ TDS_TYPEFLAG_INVALID,
544 /* 93 empty */ TDS_TYPEFLAG_INVALID,
545 /* 94 empty */ TDS_TYPEFLAG_INVALID,
546 /* 95 empty */ TDS_TYPEFLAG_INVALID,
547 /* 96 empty */ TDS_TYPEFLAG_INVALID,
548 /* 97 empty */ TDS_TYPEFLAG_INVALID,
549 /* 98 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE,
550 /* 99 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE,
551 /* 100 empty */ TDS_TYPEFLAG_INVALID,
552 /* 101 empty */ TDS_TYPEFLAG_INVALID,
553 /* 102 empty */ TDS_TYPEFLAG_INVALID,
554 /* 103 SYBSENSITIVITY */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_ASCII,
555 /* 104 SYBBOUNDARY */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_ASCII,
556 /* 105 empty */ TDS_TYPEFLAG_INVALID,
557 /* 106 SYBDECIMAL */ TDS_TYPEFLAG_NUMERIC|TDS_TYPEFLAG_VARIANT,
558 /* 107 empty */ TDS_TYPEFLAG_INVALID,
559 /* 108 SYBNUMERIC */ TDS_TYPEFLAG_NUMERIC|TDS_TYPEFLAG_VARIANT,
560 /* 109 SYBFLTN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIANT,
561 /* 110 SYBMONEYN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIANT,
562 /* 111 SYBDATETIMN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME|TDS_TYPEFLAG_VARIANT,
563 /* 112 empty */ TDS_TYPEFLAG_INVALID,
564 /* 113 empty */ TDS_TYPEFLAG_INVALID,
565 /* 114 empty */ TDS_TYPEFLAG_INVALID,
566 /* 115 empty */ TDS_TYPEFLAG_INVALID,
567 /* 116 empty */ TDS_TYPEFLAG_INVALID,
568 /* 117 empty */ TDS_TYPEFLAG_INVALID,
569 /* 118 empty */ TDS_TYPEFLAG_INVALID,
570 /* 119 empty */ TDS_TYPEFLAG_INVALID,
571 /* 120 empty */ TDS_TYPEFLAG_INVALID,
572 /* 121 empty */ TDS_TYPEFLAG_INVALID,
573 /* 122 SYBMONEY4 */ TDS_TYPEFLAG_FIXED|TDS_TYPEFLAG_VARIANT,
574 /* 123 SYBDATEN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
575 /* 124 empty */ TDS_TYPEFLAG_INVALID,
576 /* 125 empty */ TDS_TYPEFLAG_INVALID,
577 /* 126 empty */ TDS_TYPEFLAG_INVALID,
578 /* 127 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_FIXED,
579 /* 128 empty */ TDS_TYPEFLAG_INVALID,
580 /* 129 empty */ TDS_TYPEFLAG_INVALID,
581 /* 130 empty */ TDS_TYPEFLAG_INVALID,
582 /* 131 empty */ TDS_TYPEFLAG_INVALID,
583 /* 132 empty */ TDS_TYPEFLAG_INVALID,
584 /* 133 empty */ TDS_TYPEFLAG_INVALID,
585 /* 134 empty */ TDS_TYPEFLAG_INVALID,
586 /* 135 empty */ TDS_TYPEFLAG_INVALID,
587 /* 136 empty */ TDS_TYPEFLAG_INVALID,
588 /* 137 empty */ TDS_TYPEFLAG_INVALID,
589 /* 138 empty */ TDS_TYPEFLAG_INVALID,
590 /* 139 empty */ TDS_TYPEFLAG_INVALID,
591 /* 140 empty */ TDS_TYPEFLAG_INVALID,
592 /* 141 empty */ TDS_TYPEFLAG_INVALID,
593 /* 142 empty */ TDS_TYPEFLAG_INVALID,
594 /* 143 empty */ TDS_TYPEFLAG_INVALID,
595 /* 144 empty */ TDS_TYPEFLAG_INVALID,
596 /* 145 empty */ TDS_TYPEFLAG_INVALID,
597 /* 146 empty */ TDS_TYPEFLAG_INVALID,
598 /* 147 SYBTIMEN */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
599 /* 148 empty */ TDS_TYPEFLAG_INVALID,
600 /* 149 empty */ TDS_TYPEFLAG_INVALID,
601 /* 150 empty */ TDS_TYPEFLAG_INVALID,
602 /* 151 empty */ TDS_TYPEFLAG_INVALID,
603 /* 152 empty */ TDS_TYPEFLAG_INVALID,
604 /* 153 empty */ TDS_TYPEFLAG_INVALID,
605 /* 154 empty */ TDS_TYPEFLAG_INVALID,
606 /* 155 empty */ TDS_TYPEFLAG_INVALID,
607 /* 156 empty */ TDS_TYPEFLAG_INVALID,
608 /* 157 empty */ TDS_TYPEFLAG_INVALID,
609 /* 158 empty */ TDS_TYPEFLAG_INVALID,
610 /* 159 empty */ TDS_TYPEFLAG_INVALID,
611 /* 160 empty */ TDS_TYPEFLAG_INVALID,
612 /* 161 empty */ TDS_TYPEFLAG_INVALID,
613 /* 162 empty */ TDS_TYPEFLAG_INVALID,
614 /* 163 SYBXML */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE,
615 /* 164 empty */ TDS_TYPEFLAG_INVALID,
616 /* 165 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY,
617 /* 166 empty */ TDS_TYPEFLAG_INVALID,
618 /* 167 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE,
619 /* 168 empty */ TDS_TYPEFLAG_INVALID,
620 /* 169 empty */ TDS_TYPEFLAG_INVALID,
621 /* 170 empty */ TDS_TYPEFLAG_INVALID,
622 /* 171 empty */ TDS_TYPEFLAG_INVALID,
623 /* 172 empty */ TDS_TYPEFLAG_INVALID,
624 /* 173 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY,
625 /* 174 SYBUNITEXT */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE,
626 /* 175 SYBLONGCHAR */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_ASCII,
627 /* 176 SYBSINT1 */ TDS_TYPEFLAG_FIXED,
628 /* 177 empty */ TDS_TYPEFLAG_INVALID,
629 /* 178 empty */ TDS_TYPEFLAG_INVALID,
630 /* 179 empty */ TDS_TYPEFLAG_INVALID,
631 /* 180 empty */ TDS_TYPEFLAG_INVALID,
632 /* 181 empty */ TDS_TYPEFLAG_INVALID,
633 /* 182 empty */ TDS_TYPEFLAG_INVALID,
634 /* 183 empty */ TDS_TYPEFLAG_INVALID,
635 /* 184 empty */ TDS_TYPEFLAG_INVALID,
636 /* 185 empty */ TDS_TYPEFLAG_INVALID,
637 /* 186 empty */ TDS_TYPEFLAG_INVALID,
638 /* 187 SYB5BIGDATETIME */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
639 /* 188 SYB5BIGTIME */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_DATETIME,
640 /* 189 empty */ TDS_TYPEFLAG_INVALID,
641 /* 190 empty */ TDS_TYPEFLAG_INVALID,
642 /* 191 SYB5INT8 */ TDS_TYPEFLAG_FIXED,
643 /* 192 empty */ TDS_TYPEFLAG_INVALID,
644 /* 193 empty */ TDS_TYPEFLAG_INVALID,
645 /* 194 empty */ TDS_TYPEFLAG_INVALID,
646 /* 195 empty */ TDS_TYPEFLAG_INVALID,
647 /* 196 empty */ TDS_TYPEFLAG_INVALID,
648 /* 197 empty */ TDS_TYPEFLAG_INVALID,
649 /* 198 empty */ TDS_TYPEFLAG_INVALID,
650 /* 199 empty */ TDS_TYPEFLAG_INVALID,
651 /* 200 empty */ TDS_TYPEFLAG_INVALID,
652 /* 201 empty */ TDS_TYPEFLAG_INVALID,
653 /* 202 empty */ TDS_TYPEFLAG_INVALID,
654 /* 203 empty */ TDS_TYPEFLAG_INVALID,
655 /* 204 empty */ TDS_TYPEFLAG_INVALID,
656 /* 205 empty */ TDS_TYPEFLAG_INVALID,
657 /* 206 empty */ TDS_TYPEFLAG_INVALID,
658 /* 207 empty */ TDS_TYPEFLAG_INVALID,
659 /* 208 empty */ TDS_TYPEFLAG_INVALID,
660 /* 209 empty */ TDS_TYPEFLAG_INVALID,
661 /* 210 empty */ TDS_TYPEFLAG_INVALID,
662 /* 211 empty */ TDS_TYPEFLAG_INVALID,
663 /* 212 empty */ TDS_TYPEFLAG_INVALID,
664 /* 213 empty */ TDS_TYPEFLAG_INVALID,
665 /* 214 empty */ TDS_TYPEFLAG_INVALID,
666 /* 215 empty */ TDS_TYPEFLAG_INVALID,
667 /* 216 empty */ TDS_TYPEFLAG_INVALID,
668 /* 217 empty */ TDS_TYPEFLAG_INVALID,
669 /* 218 empty */ TDS_TYPEFLAG_INVALID,
670 /* 219 empty */ TDS_TYPEFLAG_INVALID,
671 /* 220 empty */ TDS_TYPEFLAG_INVALID,
672 /* 221 empty */ TDS_TYPEFLAG_INVALID,
673 /* 222 empty */ TDS_TYPEFLAG_INVALID,
674 /* 223 empty */ TDS_TYPEFLAG_INVALID,
675 /* 224 empty */ TDS_TYPEFLAG_INVALID,
676 /* 225 SYBLONGBINARY */ TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_BINARY,
677 /* 226 empty */ TDS_TYPEFLAG_INVALID,
678 /* 227 empty */ TDS_TYPEFLAG_INVALID,
679 /* 228 empty */ TDS_TYPEFLAG_INVALID,
680 /* 229 empty */ TDS_TYPEFLAG_INVALID,
681 /* 230 empty */ TDS_TYPEFLAG_INVALID,
682 /* 231 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE,
683 /* 232 empty */ TDS_TYPEFLAG_INVALID,
684 /* 233 empty */ TDS_TYPEFLAG_INVALID,
685 /* 234 empty */ TDS_TYPEFLAG_INVALID,
686 /* 235 empty */ TDS_TYPEFLAG_INVALID,
687 /* 236 empty */ TDS_TYPEFLAG_INVALID,
688 /* 237 empty */ TDS_TYPEFLAG_INVALID,
689 /* 238 empty */ TDS_TYPEFLAG_INVALID,
690 /* 239 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE,
691 /* 240 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE,
692 /* 241 empty */ TDS_TYPEFLAG_INVALID|TDS_TYPEFLAG_NULLABLE|TDS_TYPEFLAG_VARIABLE|TDS_TYPEFLAG_UNICODE,
693 /* 242 empty */ TDS_TYPEFLAG_INVALID,
694 /* 243 empty */ TDS_TYPEFLAG_INVALID,
695 /* 244 empty */ TDS_TYPEFLAG_INVALID,
696 /* 245 empty */ TDS_TYPEFLAG_INVALID,
697 /* 246 empty */ TDS_TYPEFLAG_INVALID,
698 /* 247 empty */ TDS_TYPEFLAG_INVALID,
699 /* 248 empty */ TDS_TYPEFLAG_INVALID,
700 /* 249 empty */ TDS_TYPEFLAG_INVALID,
701 /* 250 empty */ TDS_TYPEFLAG_INVALID,
702 /* 251 empty */ TDS_TYPEFLAG_INVALID,
703 /* 252 empty */ TDS_TYPEFLAG_INVALID,
704 /* 253 empty */ TDS_TYPEFLAG_INVALID,
705 /* 254 empty */ TDS_TYPEFLAG_INVALID,
706 /* 255 empty */ TDS_TYPEFLAG_INVALID,
707 };
708
709 const char *const tds_type_names[256] = {
710 /* 0 */ "",
711 /* 1 */ "",
712 /* 2 */ "",
713 /* 3 */ "",
714 /* 4 */ "",
715 /* 5 */ "",
716 /* 6 */ "",
717 /* 7 */ "",
718 /* 8 */ "",
719 /* 9 */ "",
720 /* 10 */ "",
721 /* 11 */ "",
722 /* 12 */ "",
723 /* 13 */ "",
724 /* 14 */ "",
725 /* 15 */ "",
726 /* 16 */ "",
727 /* 17 */ "",
728 /* 18 */ "",
729 /* 19 */ "",
730 /* 20 */ "",
731 /* 21 */ "",
732 /* 22 */ "",
733 /* 23 */ "",
734 /* 24 */ "",
735 /* 25 */ "",
736 /* 26 */ "",
737 /* 27 */ "",
738 /* 28 */ "",
739 /* 29 */ "",
740 /* 30 */ "",
741 /* 31 */ "SYBVOID",
742 /* 32 */ "",
743 /* 33 */ "",
744 /* 34 */ "SYBIMAGE",
745 /* 35 */ "SYBTEXT",
746 /* 36 */ "SYBUNIQUE",
747 /* 37 */ "SYBVARBINARY",
748 /* 38 */ "SYBINTN",
749 /* 39 */ "SYBVARCHAR",
750 /* 40 */ "SYBMSDATE",
751 /* 41 */ "SYBMSTIME",
752 /* 42 */ "SYBMSDATETIME2",
753 /* 43 */ "SYBMSDATETIMEOFFSET",
754 /* 44 */ "",
755 /* 45 */ "SYBBINARY",
756 /* 46 */ "SYBINTERVAL",
757 /* 47 */ "SYBCHAR",
758 /* 48 */ "SYBINT1",
759 /* 49 */ "SYBDATE",
760 /* 50 */ "SYBBIT",
761 /* 51 */ "SYBTIME",
762 /* 52 */ "SYBINT2",
763 /* 53 */ "",
764 /* 54 */ "",
765 /* 55 */ "",
766 /* 56 */ "SYBINT4",
767 /* 57 */ "",
768 /* 58 */ "SYBDATETIME4",
769 /* 59 */ "SYBREAL",
770 /* 60 */ "SYBMONEY",
771 /* 61 */ "SYBDATETIME",
772 /* 62 */ "SYBFLT8",
773 /* 63 */ "",
774 /* 64 */ "SYBUINT1",
775 /* 65 */ "SYBUINT2",
776 /* 66 */ "SYBUINT4",
777 /* 67 */ "SYBUINT8",
778 /* 68 */ "SYBUINTN",
779 /* 69 */ "",
780 /* 70 */ "",
781 /* 71 */ "",
782 /* 72 */ "",
783 /* 73 */ "",
784 /* 74 */ "",
785 /* 75 */ "",
786 /* 76 */ "",
787 /* 77 */ "",
788 /* 78 */ "",
789 /* 79 */ "",
790 /* 80 */ "",
791 /* 81 */ "",
792 /* 82 */ "",
793 /* 83 */ "",
794 /* 84 */ "",
795 /* 85 */ "",
796 /* 86 */ "",
797 /* 87 */ "",
798 /* 88 */ "",
799 /* 89 */ "",
800 /* 90 */ "",
801 /* 91 */ "",
802 /* 92 */ "",
803 /* 93 */ "",
804 /* 94 */ "",
805 /* 95 */ "",
806 /* 96 */ "",
807 /* 97 */ "",
808 /* 98 */ "SYBVARIANT",
809 /* 99 */ "SYBNTEXT",
810 /* 100 */ "",
811 /* 101 */ "",
812 /* 102 */ "",
813 /* 103 */ "SYBNVARCHAR or SYBSENSITIVITY",
814 /* 104 */ "SYBBITN or SYBBOUNDARY",
815 /* 105 */ "",
816 /* 106 */ "SYBDECIMAL",
817 /* 107 */ "",
818 /* 108 */ "SYBNUMERIC",
819 /* 109 */ "SYBFLTN",
820 /* 110 */ "SYBMONEYN",
821 /* 111 */ "SYBDATETIMN",
822 /* 112 */ "",
823 /* 113 */ "",
824 /* 114 */ "",
825 /* 115 */ "",
826 /* 116 */ "",
827 /* 117 */ "",
828 /* 118 */ "",
829 /* 119 */ "",
830 /* 120 */ "",
831 /* 121 */ "",
832 /* 122 */ "SYBMONEY4",
833 /* 123 */ "SYBDATEN",
834 /* 124 */ "",
835 /* 125 */ "",
836 /* 126 */ "",
837 /* 127 */ "SYBINT8",
838 /* 128 */ "",
839 /* 129 */ "",
840 /* 130 */ "",
841 /* 131 */ "",
842 /* 132 */ "",
843 /* 133 */ "",
844 /* 134 */ "",
845 /* 135 */ "",
846 /* 136 */ "",
847 /* 137 */ "",
848 /* 138 */ "",
849 /* 139 */ "",
850 /* 140 */ "",
851 /* 141 */ "",
852 /* 142 */ "",
853 /* 143 */ "",
854 /* 144 */ "",
855 /* 145 */ "",
856 /* 146 */ "",
857 /* 147 */ "SYBTIMEN",
858 /* 148 */ "",
859 /* 149 */ "",
860 /* 150 */ "",
861 /* 151 */ "",
862 /* 152 */ "",
863 /* 153 */ "",
864 /* 154 */ "",
865 /* 155 */ "",
866 /* 156 */ "",
867 /* 157 */ "",
868 /* 158 */ "",
869 /* 159 */ "",
870 /* 160 */ "",
871 /* 161 */ "",
872 /* 162 */ "",
873 /* 163 */ "SYBXML",
874 /* 164 */ "",
875 /* 165 */ "XSYBVARBINARY",
876 /* 166 */ "",
877 /* 167 */ "XSYBVARCHAR",
878 /* 168 */ "",
879 /* 169 */ "",
880 /* 170 */ "",
881 /* 171 */ "",
882 /* 172 */ "",
883 /* 173 */ "XSYBBINARY",
884 /* 174 */ "SYBUNITEXT",
885 /* 175 */ "XSYBCHAR or SYBLONGCHAR",
886 /* 176 */ "SYBSINT1",
887 /* 177 */ "",
888 /* 178 */ "",
889 /* 179 */ "",
890 /* 180 */ "",
891 /* 181 */ "",
892 /* 182 */ "",
893 /* 183 */ "",
894 /* 184 */ "",
895 /* 185 */ "",
896 /* 186 */ "",
897 /* 187 */ "SYB5BIGDATETIME",
898 /* 188 */ "SYB5BIGTIME",
899 /* 189 */ "",
900 /* 190 */ "",
901 /* 191 */ "SYB5INT8",
902 /* 192 */ "",
903 /* 193 */ "",
904 /* 194 */ "",
905 /* 195 */ "",
906 /* 196 */ "",
907 /* 197 */ "",
908 /* 198 */ "",
909 /* 199 */ "",
910 /* 200 */ "",
911 /* 201 */ "",
912 /* 202 */ "",
913 /* 203 */ "",
914 /* 204 */ "",
915 /* 205 */ "",
916 /* 206 */ "",
917 /* 207 */ "",
918 /* 208 */ "",
919 /* 209 */ "",
920 /* 210 */ "",
921 /* 211 */ "",
922 /* 212 */ "",
923 /* 213 */ "",
924 /* 214 */ "",
925 /* 215 */ "",
926 /* 216 */ "",
927 /* 217 */ "",
928 /* 218 */ "",
929 /* 219 */ "",
930 /* 220 */ "",
931 /* 221 */ "",
932 /* 222 */ "",
933 /* 223 */ "",
934 /* 224 */ "",
935 /* 225 */ "SYBLONGBINARY",
936 /* 226 */ "",
937 /* 227 */ "",
938 /* 228 */ "",
939 /* 229 */ "",
940 /* 230 */ "",
941 /* 231 */ "XSYBNVARCHAR",
942 /* 232 */ "",
943 /* 233 */ "",
944 /* 234 */ "",
945 /* 235 */ "",
946 /* 236 */ "",
947 /* 237 */ "",
948 /* 238 */ "",
949 /* 239 */ "XSYBNCHAR",
950 /* 240 */ "SYBMSUDT",
951 /* 241 */ "SYBMSXML",
952 /* 242 */ "",
953 /* 243 */ "",
954 /* 244 */ "",
955 /* 245 */ "",
956 /* 246 */ "",
957 /* 247 */ "",
958 /* 248 */ "",
959 /* 249 */ "",
960 /* 250 */ "",
961 /* 251 */ "",
962 /* 252 */ "",
963 /* 253 */ "",
964 /* 254 */ "",
965 /* 255 */ "",
966 };
967 #endif
tds_connection::cursors
TDSCURSOR * cursors
linked list of cursors allocated for this connection contains only cursors allocated on the server
Definition: tds.h:1108
tds_freeze::pkt_pos
unsigned pkt_pos
position in pkt
Definition: tds.h:1575
tds_dynamic::emulated
TDS_TINYINT emulated
this dynamic query cannot be prepared so libTDS have to construct a simple query.
Definition: tds.h:994
tds_freeze::size_len
unsigned size_len
length size (0, 1, 2 or 4)
Definition: tds.h:1577
tds_socket::frozen_packets
TDSPACKET * frozen_packets
list of packets frozen, points to first one.
Definition: tds.h:1204
TDS_IDLE
@ TDS_IDLE
no data expected
Definition: tds.h:791
tds_socket::in_buf
unsigned char * in_buf
Input buffer.
Definition: tds.h:1178
tds_env
Current environment as reported by the server.
Definition: tds.h:964
tds_freeze
Definition: tds.h:1569
tds.h
Main include file for libtds.
tds_socket::send_packet
TDSPACKET * send_packet
packet we are preparing to send
Definition: tds.h:1232
tds_socket::login
TDSLOGIN * login
config for login stuff.
Definition: tds.h:1259
tds_column::column_prec
TDS_TINYINT column_prec
precision for decimal/numeric
Definition: tds.h:704
TDS72_SMP_HEADER
TDS 7.2 SMP packet header.
Definition: proto.h:361
tds_result_info
Hold information for any results.
Definition: tds.h:770
tds_socket::out_buf
unsigned char * out_buf
Output buffer.
Definition: tds.h:1186
TDS_SENDING
@ TDS_SENDING
client would send data
Definition: tds.h:793
tds_authentication
Definition: tds.h:1048
tds_get_varint_size
int tds_get_varint_size(TDSCONNECTION *conn, int datatype)
tds_get_varint_size() returns the size of a variable length integer returned in a result string
Definition: tds_types.h:57
tds_connection::env
TDSENV env
environment is shared between all sessions
Definition: tds.h:1102
tds_socket
Information for a server connection.
Definition: tds.h:1164
TDS_WRITING
@ TDS_WRITING
client is writing data
Definition: tds.h:792
tds_connection::dyns
TDSDYNAMIC * dyns
list of dynamic allocated for this connection contains only dynamic allocated on the server
Definition: tds.h:1113
tds_dynamic::query
char * query
saved query, we need to know original query if prepare is impossible
Definition: tds.h:1010
tds_context
Definition: tds.h:1030
tds_cursor::ref_count
TDS_INT ref_count
reference counter so client can retain safely a pointer
Definition: tds.h:940
tds_login::port
int port
port of database service
Definition: tds.h:520
tds_freeze::pkt
TDSPACKET * pkt
first packet frozen
Definition: tds.h:1573
tds_get_n
bool tds_get_n(TDSSOCKET *tds, void *dest, size_t need)
Get N bytes from the buffer and return them in the already allocated space given to us.
Definition: read.c:230
tds_cursor::next
struct tds_cursor * next
next in linked list, keep first
Definition: tds.h:939
tdsdump_log
void tdsdump_log(const char *file, unsigned int level_line, const char *fmt,...)
Write a message to the debug log.
Definition: log.c:354
tds_column::column_size
TDS_INT column_size
maximun size of data.
Definition: tds.h:695
tds_env::block_size
int block_size
packet size (512-65535)
Definition: tds.h:966
tds_dynamic
Holds information for a dynamic (also called prepared) query.
Definition: tds.h:978
tds_dstr_cstr
static const char * tds_dstr_cstr(const DSTR *s)
Returns a C version (NUL terminated string) of dstr.
Definition: string.h:78
tds_dynamic::params
TDSPARAMINFO * params
query parameters.
Definition: tds.h:1008
tds_packet::data_len
unsigned data_len
data length, this does not account SMP header, only TDS part
Definition: tds.h:1072
tds_column::column_scale
TDS_TINYINT column_scale
scale for decimal/numeric
Definition: tds.h:705
tds_dstr_len
static size_t tds_dstr_len(const DSTR *s)
Returns the length of the string in bytes.
Definition: string.h:85
tds_cursor
Holds informations about a cursor.
Definition: tds.h:938
tds_login
Definition: tds.h:518
tds_get_conversion_type
TDS_SERVER_TYPE tds_get_conversion_type(TDS_SERVER_TYPE srctype, int colsize)
Return type suitable for conversions (convert all nullable types to fixed type)
Definition: tds_types.h:125
tds_socket::out_pos
unsigned out_pos
current position in out_buf
Definition: tds.h:1194
tds_dynamic::res_info
TDSPARAMINFO * res_info
query results
Definition: tds.h:1000
tds_column::column_cur_size
TDS_INT column_cur_size
size written in variable (ie: char, text, binary).
Definition: tds.h:737
tds_column::column_varint_size
TDS_TINYINT column_varint_size
size of length when reading from wire (0, 1, 2 or 4)
Definition: tds.h:702
tds_packet
Definition: tds.h:1058
tds_dynamic::ref_count
TDS_INT ref_count
reference counter so client can retain safely a pointer
Definition: tds.h:980
tds_socket::in_len
unsigned in_len
input buffer length
Definition: tds.h:1195
tds_get_size_by_type
int tds_get_size_by_type(TDS_SERVER_TYPE servertype)
Return the number of bytes needed by specified type.
Definition: tds_types.h:9
tds_freeze::tds
TDSSOCKET * tds
which socket we refer to
Definition: tds.h:1571
tds_dynamic::next
struct tds_dynamic * next
next in linked list, keep first
Definition: tds.h:979
tds_login::password
DSTR password
password of account login
Definition: tds.h:536
TDS_PENDING
@ TDS_PENDING
cilent is waiting for data
Definition: tds.h:794
tds_socket::out_buf_max
unsigned int out_buf_max
Maximum size of packet pointed by out_buf.
Definition: tds.h:1192
tds_column
Metadata about columns in regular and compute rows.
Definition: tds.h:690
TDS_DEAD
@ TDS_DEAD
no connection
Definition: tds.h:796
tds_flush_packet
TDSRET tds_flush_packet(TDSSOCKET *tds)
Flush packet to server.
Definition: write.c:224
tds_connection
Definition: tds.h:1092
tds_login::user_name
DSTR user_name
account for login
Definition: tds.h:535
tds_column::column_type
TDS_SERVER_TYPE column_type
This type can be different from wire type because conversion (e.g.
Definition: tds.h:697
tds_socket::in_pos
unsigned in_pos
current position in in_buf
Definition: tds.h:1193
TDS_READING
@ TDS_READING
client is reading data
Definition: tds.h:795