23 #ifndef _ALTERNATIVE_CHARACTER_SETS_H_
24 #define _ALTERNATIVE_CHARACTER_SETS_H_
35 {
"US-ASCII",
"US-ASCII" }
36 , {
"US-ASCII",
"ANSI_X3.4-1968" }
37 , {
"US-ASCII",
"ANSI_X3.4-1986" }
38 , {
"US-ASCII",
"ASCII" }
39 , {
"US-ASCII",
"CP367" }
40 , {
"US-ASCII",
"CSASCII" }
41 , {
"US-ASCII",
"IBM367" }
42 , {
"US-ASCII",
"ISO-IR-6" }
43 , {
"US-ASCII",
"ISO646-US" }
44 , {
"US-ASCII",
"ISO_646.IRV:1991" }
45 , {
"US-ASCII",
"US" }
46 , {
"US-ASCII",
"646" }
48 , {
"ISO-8859-1",
"ISO-8859-1" }
49 , {
"ISO-8859-1",
"CP819" }
50 , {
"ISO-8859-1",
"CSISOLATIN1" }
51 , {
"ISO-8859-1",
"IBM819" }
52 , {
"ISO-8859-1",
"ISO-IR-100" }
53 , {
"ISO-8859-1",
"ISO8859-1" }
54 , {
"ISO-8859-1",
"ISO_8859-1" }
55 , {
"ISO-8859-1",
"ISO_8859-1:1987" }
56 , {
"ISO-8859-1",
"L1" }
57 , {
"ISO-8859-1",
"LATIN1" }
58 , {
"ISO-8859-1",
"iso81" }
59 , {
"ISO-8859-1",
"iso88591" }
61 , {
"UCS-2",
"UCS-2" }
62 , {
"UCS-2",
"CSUNICODE" }
63 , {
"UCS-2",
"ISO-10646-UCS-2" }
66 , {
"UCS-2-INTERNAL",
"UCS-2-INTERNAL" }
67 , {
"UCS-2-SWAPPED",
"UCS-2-SWAPPED" }
68 , {
"UCS-2BE",
"UCS-2BE" }
69 , {
"UCS-2BE",
"CSUNICODE11" }
70 , {
"UCS-2BE",
"UNICODE-1-1" }
71 , {
"UCS-2BE",
"UNICODEBIG" }
72 , {
"UCS-2LE",
"UCS-2LE" }
73 , {
"UCS-2LE",
"UNICODELITTLE" }
75 , {
"UTF-8",
"UTF-8" }
80 , {
"ARMSCII-8",
"ARMSCII-8" }
81 , {
"BIG-5",
"BIG-5" }
82 , {
"BIG-5",
"BIG-FIVE" }
84 , {
"BIG-5",
"BIGFIVE" }
85 , {
"BIG-5",
"CN-BIG5" }
86 , {
"BIG-5",
"CSBIG5" }
88 , {
"BIG5-HKSCS",
"BIG5-HKSCS" }
89 , {
"BIG5-HKSCS",
"BIG5HKSCS" }
91 , {
"CHINESE",
"CHINESE" }
92 , {
"CHINESE",
"CSISO58GB231280" }
93 , {
"CHINESE",
"GB_2312-80" }
94 , {
"CHINESE",
"ISO-IR-58" }
95 , {
"CHINESE",
"hp15CN" }
97 , {
"CN",
"CSISO57GB1988" }
98 , {
"CN",
"GB_1988-80" }
99 , {
"CN",
"ISO-IR-57" }
100 , {
"CN",
"ISO646-CN" }
101 , {
"CN-GB",
"CN-GB" }
102 , {
"CN-GB",
"CSGB2312" }
103 , {
"CN-GB",
"EUC-CN" }
104 , {
"CN-GB",
"EUCCN" }
105 , {
"CN-GB",
"GB2312" }
106 , {
"CN-GB-ISOIR165",
"CN-GB-ISOIR165" }
107 , {
"CN-GB-ISOIR165",
"ISO-IR-165" }
108 , {
"CP1133",
"CP1133" }
109 , {
"CP1133",
"IBM-CP1133" }
110 , {
"CP1250",
"CP1250" }
111 , {
"CP1250",
"MS-EE" }
112 , {
"CP1250",
"WINDOWS-1250" }
113 , {
"CP1250",
"cp1250" }
114 , {
"CP1251",
"CP1251" }
115 , {
"CP1251",
"MS-CYRL" }
116 , {
"CP1251",
"WINDOWS-1251" }
117 , {
"CP1251",
"cp1251" }
118 , {
"CP1252",
"CP1252" }
119 , {
"CP1252",
"MS-ANSI" }
120 , {
"CP1252",
"WINDOWS-1252" }
121 , {
"CP1252",
"cp1252" }
122 , {
"CP1253",
"CP1253" }
123 , {
"CP1253",
"MS-GREEK" }
124 , {
"CP1253",
"WINDOWS-1253" }
125 , {
"CP1253",
"cp1253" }
126 , {
"CP1254",
"CP1254" }
127 , {
"CP1254",
"MS-TURK" }
128 , {
"CP1254",
"WINDOWS-1254" }
129 , {
"CP1254",
"cp1254" }
130 , {
"CP1255",
"CP1255" }
131 , {
"CP1255",
"MS-HEBR" }
132 , {
"CP1255",
"WINDOWS-1255" }
133 , {
"CP1255",
"cp1255" }
134 , {
"CP1256",
"CP1256" }
135 , {
"CP1256",
"MS-ARAB" }
136 , {
"CP1256",
"WINDOWS-1256" }
137 , {
"CP1256",
"cp1256" }
138 , {
"CP1257",
"CP1257" }
139 , {
"CP1257",
"WINBALTRIM" }
140 , {
"CP1257",
"WINDOWS-1257" }
141 , {
"CP1257",
"cp1257" }
142 , {
"CP1258",
"CP1258" }
143 , {
"CP1258",
"WINDOWS-1258" }
144 , {
"CP1258",
"cp1258" }
145 , {
"CP1361",
"CP1361" }
146 , {
"CP1361",
"JOHAB" }
147 , {
"CP850",
"CP850" }
149 , {
"CP850",
"CSPC850MULTILINGUAL" }
150 , {
"CP850",
"IBM850" }
151 , {
"CP850",
"cp850" }
152 , {
"CP862",
"CP862" }
154 , {
"CP862",
"CSPC862LATINHEBREW" }
155 , {
"CP862",
"IBM862" }
156 , {
"CP862",
"cp862" }
157 , {
"CP866",
"CP866" }
159 , {
"CP866",
"CSIBM866" }
160 , {
"CP866",
"IBM866" }
161 , {
"CP866",
"cp866" }
162 , {
"CP874",
"CP874" }
163 , {
"CP874",
"WINDOWS-874" }
164 , {
"CP874",
"cp874" }
165 , {
"CP932",
"CP932" }
166 , {
"CP936",
"CP936" }
168 , {
"CP949",
"CP949" }
170 , {
"CP950",
"CP950" }
171 , {
"CP437",
"CP437" }
172 , {
"CP437",
"cp437" }
173 , {
"CP437",
"IBM437" }
174 , {
"EUC-JP",
"EUC-JP" }
175 , {
"EUC-JP",
"CSEUCPKDFMTJAPANESE" }
176 , {
"EUC-JP",
"EUCJP" }
177 , {
"EUC-JP",
"EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE"}
178 , {
"EUC-JP",
"eucJP" }
179 , {
"EUC-KR",
"EUC-KR" }
180 , {
"EUC-KR",
"CSEUCKR" }
181 , {
"EUC-KR",
"EUCKR" }
182 , {
"EUC-KR",
"eucKR" }
183 , {
"EUC-TW",
"CSEUCTW" }
184 , {
"EUC-TW",
"EUC-TW" }
185 , {
"EUC-TW",
"EUCTW" }
186 , {
"EUC-TW",
"eucTW" }
187 , {
"GB18030",
"GB18030" }
188 , {
"GEORGIAN-ACADEMY",
"GEORGIAN-ACADEMY" }
189 , {
"GEORGIAN-PS",
"GEORGIAN-PS" }
191 , {
"HZ",
"HZ-GB-2312" }
192 , {
"ISO-2022-CN",
"ISO-2022-CN" }
193 , {
"ISO-2022-CN",
"CSISO2022CN" }
194 , {
"ISO-2022-CN-EXT",
"ISO-2022-CN-EXT" }
195 , {
"ISO-2022-JP",
"ISO-2022-JP" }
196 , {
"ISO-2022-JP",
"CSISO2022JP" }
197 , {
"ISO-2022-JP-1",
"ISO-2022-JP-1" }
198 , {
"ISO-2022-JP-2",
"ISO-2022-JP-2" }
199 , {
"ISO-2022-JP-2",
"CSISO2022JP2" }
200 , {
"ISO-2022-KR",
"ISO-2022-KR" }
201 , {
"ISO-2022-KR",
"CSISO2022KR" }
202 , {
"ISO-8859-10",
"ISO-8859-10" }
203 , {
"ISO-8859-10",
"CSISOLATIN6" }
204 , {
"ISO-8859-10",
"ISO-IR-157" }
205 , {
"ISO-8859-10",
"ISO8859-10" }
206 , {
"ISO-8859-10",
"ISO_8859-10" }
207 , {
"ISO-8859-10",
"ISO_8859-10:1992" }
208 , {
"ISO-8859-10",
"L6" }
209 , {
"ISO-8859-10",
"LATIN6" }
210 , {
"ISO-8859-13",
"ISO-8859-13" }
211 , {
"ISO-8859-13",
"ISO-IR-179" }
212 , {
"ISO-8859-13",
"ISO_8859-13" }
213 , {
"ISO-8859-13",
"L7" }
214 , {
"ISO-8859-13",
"LATIN7" }
215 , {
"ISO-8859-14",
"ISO-8859-14" }
216 , {
"ISO-8859-14",
"ISO-CELTIC" }
217 , {
"ISO-8859-14",
"ISO-IR-199" }
218 , {
"ISO-8859-14",
"ISO_8859-14" }
219 , {
"ISO-8859-14",
"ISO_8859-14:1998" }
220 , {
"ISO-8859-14",
"L8" }
221 , {
"ISO-8859-14",
"LATIN8" }
222 , {
"ISO-8859-15",
"ISO8859-15" }
223 , {
"ISO-8859-15",
"ISO-8859-15" }
224 , {
"ISO-8859-15",
"ISO-IR-203" }
225 , {
"ISO-8859-15",
"ISO_8859-15" }
226 , {
"ISO-8859-15",
"ISO_8859-15:1998" }
227 , {
"ISO-8859-15",
"iso815" }
228 , {
"ISO-8859-15",
"iso885915" }
229 , {
"ISO-8859-16",
"ISO-8859-16" }
230 , {
"ISO-8859-16",
"ISO-IR-226" }
231 , {
"ISO-8859-16",
"ISO_8859-16" }
232 , {
"ISO-8859-16",
"ISO_8859-16:2000" }
233 , {
"ISO-8859-2",
"ISO-8859-2" }
234 , {
"ISO-8859-2",
"CSISOLATIN2" }
235 , {
"ISO-8859-2",
"ISO8859-2" }
236 , {
"ISO-8859-2",
"ISO-IR-101" }
237 , {
"ISO-8859-2",
"ISO_8859-2" }
238 , {
"ISO-8859-2",
"ISO_8859-2:1987" }
239 , {
"ISO-8859-2",
"L2" }
240 , {
"ISO-8859-2",
"LATIN2" }
241 , {
"ISO-8859-2",
"iso82" }
242 , {
"ISO-8859-2",
"iso88592" }
243 , {
"ISO-8859-3",
"ISO-8859-3" }
244 , {
"ISO-8859-3",
"CSISOLATIN3" }
245 , {
"ISO-8859-3",
"ISO-IR-109" }
246 , {
"ISO-8859-3",
"ISO_8859-3" }
247 , {
"ISO-8859-3",
"ISO_8859-3:1988" }
248 , {
"ISO-8859-3",
"L3" }
249 , {
"ISO-8859-3",
"LATIN3" }
250 , {
"ISO-8859-3",
"iso83" }
251 , {
"ISO-8859-3",
"iso88593" }
252 , {
"ISO-8859-4",
"ISO8859-4" }
253 , {
"ISO-8859-4",
"CSISOLATIN4" }
254 , {
"ISO-8859-4",
"ISO-8859-4" }
255 , {
"ISO-8859-4",
"ISO-IR-110" }
256 , {
"ISO-8859-4",
"ISO_8859-4" }
257 , {
"ISO-8859-4",
"ISO_8859-4:1988" }
258 , {
"ISO-8859-4",
"L4" }
259 , {
"ISO-8859-4",
"LATIN4" }
260 , {
"ISO-8859-4",
"iso84" }
261 , {
"ISO-8859-4",
"iso88594" }
262 , {
"ISO-8859-5",
"ISO-8859-5" }
263 , {
"ISO-8859-5",
"CSISOLATINCYRILLIC" }
264 , {
"ISO-8859-5",
"CYRILLIC" }
265 , {
"ISO-8859-5",
"ISO8859-5" }
266 , {
"ISO-8859-5",
"ISO-IR-144" }
267 , {
"ISO-8859-5",
"ISO8859-5" }
268 , {
"ISO-8859-5",
"ISO_8859-5" }
269 , {
"ISO-8859-5",
"ISO_8859-5:1988" }
270 , {
"ISO-8859-5",
"iso85" }
271 , {
"ISO-8859-5",
"iso88595" }
272 , {
"ISO-8859-6",
"ISO-8859-6" }
273 , {
"ISO-8859-6",
"ARABIC" }
274 , {
"ISO-8859-6",
"ASMO-708" }
275 , {
"ISO-8859-6",
"CSISOLATINARABIC" }
276 , {
"ISO-8859-6",
"ECMA-114" }
277 , {
"ISO-8859-6",
"ISO-IR-127" }
278 , {
"ISO-8859-6",
"ISO8859-6" }
279 , {
"ISO-8859-6",
"ISO_8859-6" }
280 , {
"ISO-8859-6",
"ISO_8859-6:1987" }
281 , {
"ISO-8859-6",
"iso86" }
282 , {
"ISO-8859-6",
"iso88596" }
283 , {
"ISO-8859-7",
"ISO-8859-7" }
284 , {
"ISO-8859-7",
"CSISOLATINGREEK" }
285 , {
"ISO-8859-7",
"ECMA-118" }
286 , {
"ISO-8859-7",
"ELOT_928" }
287 , {
"ISO-8859-7",
"GREEK" }
288 , {
"ISO-8859-7",
"GREEK8" }
289 , {
"ISO-8859-7",
"ISO-IR-126" }
290 , {
"ISO-8859-7",
"ISO8859-7" }
291 , {
"ISO-8859-7",
"ISO_8859-7" }
292 , {
"ISO-8859-7",
"ISO_8859-7:1987" }
293 , {
"ISO-8859-7",
"iso87" }
294 , {
"ISO-8859-7",
"iso88597" }
295 , {
"ISO-8859-8",
"ISO-8859-8" }
296 , {
"ISO-8859-8",
"CSISOLATINHEBREW" }
297 , {
"ISO-8859-8",
"HEBREW" }
298 , {
"ISO-8859-8",
"ISO8859-8" }
299 , {
"ISO-8859-8",
"ISO-IR-138" }
300 , {
"ISO-8859-8",
"ISO_8859-8" }
301 , {
"ISO-8859-8",
"ISO_8859-8:1988" }
302 , {
"ISO-8859-8",
"iso88" }
303 , {
"ISO-8859-8",
"iso88598" }
304 , {
"ISO-8859-9",
"ISO-8859-9" }
305 , {
"ISO-8859-9",
"CSISOLATIN5" }
306 , {
"ISO-8859-9",
"ISO-IR-148" }
307 , {
"ISO-8859-9",
"ISO8859-9" }
308 , {
"ISO-8859-9",
"ISO_8859-9" }
309 , {
"ISO-8859-9",
"ISO_8859-9:1989" }
310 , {
"ISO-8859-9",
"L5" }
311 , {
"ISO-8859-9",
"LATIN5" }
312 , {
"ISO-8859-9",
"iso88599" }
313 , {
"ISO-8859-9",
"iso89" }
314 , {
"ISO-IR-14",
"ISO-IR-14" }
315 , {
"ISO-IR-14",
"CSISO14JISC6220RO" }
316 , {
"ISO-IR-14",
"ISO646-JP" }
317 , {
"ISO-IR-14",
"JIS_C6220-1969-RO" }
318 , {
"ISO-IR-14",
"JP" }
319 , {
"ISO-IR-149",
"ISO-IR-149" }
320 , {
"ISO-IR-149",
"CSKSC56011987" }
321 , {
"ISO-IR-149",
"KOREAN" }
322 , {
"ISO-IR-149",
"KSC_5601" }
323 , {
"ISO-IR-149",
"KS_C_5601-1987" }
324 , {
"ISO-IR-149",
"KS_C_5601-1989" }
325 , {
"ISO-IR-159",
"ISO-IR-159" }
326 , {
"ISO-IR-159",
"CSISO159JISX02121990" }
327 , {
"ISO-IR-159",
"JIS_X0212" }
328 , {
"ISO-IR-159",
"JIS_X0212-1990" }
329 , {
"ISO-IR-159",
"JIS_X0212.1990-0" }
330 , {
"ISO-IR-159",
"X0212" }
331 , {
"ISO-IR-166",
"ISO-IR-166" }
332 , {
"ISO-IR-166",
"TIS-620" }
333 , {
"ISO-IR-166",
"TIS620" }
334 , {
"ISO-IR-166",
"TIS620-0" }
335 , {
"ISO-IR-166",
"TIS620.2529-1" }
336 , {
"ISO-IR-166",
"TIS620.2533-0" }
337 , {
"ISO-IR-166",
"TIS620.2533-1" }
338 , {
"ISO-IR-166",
"thai8" }
339 , {
"ISO-IR-166",
"tis620" }
340 , {
"ISO-IR-87",
"ISO-IR-87" }
341 , {
"ISO-IR-87",
"CSISO87JISX0208" }
342 , {
"ISO-IR-87",
"JIS0208" }
343 , {
"ISO-IR-87",
"JIS_C6226-1983" }
344 , {
"ISO-IR-87",
"JIS_X0208" }
345 , {
"ISO-IR-87",
"JIS_X0208-1983" }
346 , {
"ISO-IR-87",
"JIS_X0208-1990" }
347 , {
"ISO-IR-87",
"X0208" }
349 , {
"JISX0201-1976",
"JISX0201-1976" }
350 , {
"JISX0201-1976",
"CSHALFWIDTHKATAKANA" }
351 , {
"JISX0201-1976",
"JIS_X0201" }
352 , {
"JISX0201-1976",
"X0201" }
353 , {
"KOI8-R",
"KOI8-R" }
354 , {
"KOI8-R",
"CSKOI8R" }
355 , {
"KOI8-RU",
"KOI8-RU" }
356 , {
"KOI8-T",
"KOI8-T" }
357 , {
"KOI8-U",
"KOI8-U" }
359 , {
"MAC",
"CSMACINTOSH" }
360 , {
"MAC",
"MACINTOSH" }
361 , {
"MAC",
"MACROMAN" }
362 , {
"MACARABIC",
"MACARABIC" }
363 , {
"MACCENTRALEUROPE",
"MACCENTRALEUROPE" }
364 , {
"MACCROATIAN",
"MACCROATIAN" }
365 , {
"MACCYRILLIC",
"MACCYRILLIC" }
366 , {
"MACGREEK",
"MACGREEK" }
367 , {
"MACHEBREW",
"MACHEBREW" }
368 , {
"MACICELAND",
"MACICELAND" }
369 , {
"MACROMANIA",
"MACROMANIA" }
370 , {
"MACTHAI",
"MACTHAI" }
371 , {
"MACTURKISH",
"MACTURKISH" }
372 , {
"MACUKRAINE",
"MACUKRAINE" }
373 , {
"MULELAO-1",
"MULELAO-1" }
374 , {
"NEXTSTEP",
"NEXTSTEP" }
375 , {
"ROMAN8",
"ROMAN8" }
376 , {
"ROMAN8",
"CSHPROMAN8" }
377 , {
"ROMAN8",
"HP-ROMAN8" }
379 , {
"ROMAN8",
"roma8" }
380 , {
"ROMAN8",
"roman8" }
382 , {
"SJIS",
"CSSHIFTJIS" }
383 , {
"SJIS",
"MS_KANJI" }
384 , {
"SJIS",
"SHIFT-JIS" }
385 , {
"SJIS",
"SHIFT_JIS" }
388 , {
"TCVN",
"TCVN-5712" }
389 , {
"TCVN",
"TCVN5712-1" }
390 , {
"TCVN",
"TCVN5712-1:1993" }
391 , {
"UCS-4",
"UCS-4" }
392 , {
"UCS-4",
"CSUCS4" }
393 , {
"UCS-4",
"ISO-10646-UCS-4" }
394 , {
"UCS-4",
"UCS4" }
395 , {
"UCS-4",
"ucs4" }
396 , {
"UCS-4-INTERNAL",
"UCS-4-INTERNAL" }
397 , {
"UCS-4-SWAPPED",
"UCS-4-SWAPPED" }
398 , {
"UCS-4BE",
"UCS-4BE" }
399 , {
"UCS-4LE",
"UCS-4LE" }
400 , {
"UTF-16",
"UTF-16" }
401 , {
"UTF-16",
"UTF16" }
402 , {
"UTF-16BE",
"UTF-16BE" }
403 , {
"UTF-16LE",
"UTF-16LE" }
404 , {
"UTF-32",
"UTF-32" }
405 , {
"UTF-32BE",
"UTF-32BE" }
406 , {
"UTF-32LE",
"UTF-32LE" }
407 , {
"UTF-7",
"UTF-7" }
408 , {
"UTF-7",
"CSUNICODE11UTF7" }
409 , {
"UTF-7",
"UNICODE-1-1-UTF-7" }
410 , {
"UTF-7",
"UTF7" }
411 , {
"VISCII",
"VISCII" }
412 , {
"VISCII",
"CSVISCII" }
413 , {
"VISCII",
"VISCII1.1-1" }
int tds_needs_unprepare(TDSCONNECTION *conn, TDSDYNAMIC *dyn)
Check if dynamic request must be unprepared.
Definition: query.c:1752
int tds7_get_instance_port(struct addrinfo *addr, const char *instance)
Get port of given instance.
Definition: net.c:1229
unsigned int bulk_copy
if bulk copy should be enabled
Definition: tds.h:557
TDSRET tds_dynamic_stream_init(TDSDYNAMICSTREAM *stream, void **ptr, size_t allocated)
Initialize a dynamic output stream.
Definition: stream.c:354
TDS_USMALLINT tds_version
TDS version.
Definition: tds.h:521
static const char * tds_skip_comment_ucs2le(const char *s, const char *end)
Skip a comment in a query.
Definition: query.c:589
DSTR new_password
new password to set (TDS 7.2+)
Definition: tds.h:537
bool has_status
true is ret_status is valid
Definition: tds.h:1246
TDSRET tds_submit_unprepare(TDSSOCKET *tds, TDSDYNAMIC *dyn)
Send a unprepare request for a prepared query.
Definition: query.c:1797
size_t tds_quote_id(TDSSOCKET *tds, char *buffer, const char *id, int idlen)
Quote an id.
Definition: query.c:2171
struct addrinfo * ip_addrs
ip(s) of server
Definition: tds.h:547
TDS_TINYINT emulated
this dynamic query cannot be prepared so libTDS have to construct a simple query.
Definition: tds.h:994
DSTR * tds_dstr_alloc(DSTR *s, size_t length)
allocate space for length char
Definition: tdsstring.c:165
void tdsdump_on(void)
Turn logging back on.
Definition: log.c:88
size_t size
size of data inside buffer
Definition: stream.h:106
DSTR server_name
server name (in freetds.conf)
Definition: tds.h:519
void tds_dstr_free(DSTR *s)
free string
Definition: tdsstring.c:62
@ TDS_IDLE
no data expected
Definition: tds.h:791
static void tds_quote_and_put(TDSSOCKET *tds, const char *s, const char *end)
Send a string to server while quoting it.
Definition: query.c:3079
unsigned char * in_buf
Input buffer.
Definition: tds.h:1178
TDSCURSOR * cur_cursor
cursor in use
Definition: tds.h:1244
void tds_set_cur_dyn(TDSSOCKET *tds, TDSDYNAMIC *dyn)
Set current dynamic.
Definition: query.c:192
input stream to read data from a static buffer
Definition: stream.h:81
TDSDYNAMIC * tds_alloc_dynamic(TDSCONNECTION *conn, const char *id)
Allocate a dynamic statement.
Definition: mem.c:160
void tds_start_query(TDSSOCKET *tds, unsigned char packet_type)
Start query packet of a given type.
Definition: query.c:332
static TDSRET tds_query_flush_packet(TDSSOCKET *tds)
Flush query packet.
Definition: query.c:178
TDSRET tds_submit_execute(TDSSOCKET *tds, TDSDYNAMIC *dyn)
Sends a previously prepared dynamic statement to the server.
Definition: query.c:1630
TDSRET tds71_submit_prepexec(TDSSOCKET *tds, const char *query, const char *id, TDSDYNAMIC **dyn_out, TDSPARAMINFO *params)
Creates a temporary stored procedure in the server and execute it.
Definition: query.c:1401
#define TDS_SYB_VER(maj, min, x)
Calc a version number for Sybase.
Definition: tds.h:1724
static TDSRET tds7_send_execute(TDSSOCKET *tds, TDSDYNAMIC *dyn)
Send dynamic request on TDS 7+ to be executed.
Definition: query.c:1593
TDSRET tds_submit_rpc(TDSSOCKET *tds, const char *rpc_name, TDSPARAMINFO *params, TDSHEADERS *head)
Calls a RPC from server.
Definition: query.c:1929
static const char * tds_next_placeholder_ucs2le(const char *start, const char *end, int named)
Found the next placeholder (? or @param) in a string.
Definition: query.c:644
tds_func_put_data * put_data
Send column data to server.
Definition: tds.h:663
TDSRET tds_convert_stream(TDSSOCKET *tds, TDSICONV *char_conv, TDS_ICONV_DIRECTION direction, TDSINSTREAM *istream, TDSOUTSTREAM *ostream)
Reads and writes from a stream converting characters.
Definition: stream.c:71
TDSRET tds_submit_queryf(TDSSOCKET *tds, const char *queryf,...)
Format and submit a query.
Definition: query.c:467
int tds_read_packet(TDSSOCKET *tds)
Read in one 'packet' from the server.
Definition: packet.c:527
Information about blobs (e.g.
Definition: tds.h:594
void tds_freeze(TDSSOCKET *tds, TDSFREEZE *freeze, unsigned size_len)
Stop writing to server and cache every packet not sending them to server.
Definition: packet.c:907
static TDSRET tds_put_data_info(TDSSOCKET *tds, TDSCOLUMN *curcol, int flags)
Put data information to wire.
Definition: query.c:1533
void tds_staticin_stream_init(TDSSTATICINSTREAM *stream, const void *ptr, size_t len)
Initialize an input stream for read from a static allocated buffer.
Definition: stream.c:286
TDSRET tds_submit_begin_tran(TDSSOCKET *tds)
Send a rollback request.
Definition: query.c:3665
TDS_INT cursor_rows
< number of updatable columns
Definition: tds.h:952
TDS_TINYINT column_prec
precision for decimal/numeric
Definition: tds.h:704
DSTR * tds_dstr_set(DSTR *s, char *src)
set a string from another buffer.
Definition: tdsstring.c:107
TDS 7.2 SMP packet header.
Definition: proto.h:361
int tdsdump_open(const char *filename)
Create and truncate a human readable dump file for the TDS traffic.
Definition: log.c:112
bool defer_close
true if dynamic was marker to be closed when connection is idle
Definition: tds.h:998
#define tds_dstr_empty(s)
Make a string empty.
Definition: string.h:91
Hold information for any results.
Definition: tds.h:770
static char * tds_dstr_buf(DSTR *s)
Returns a buffer to edit the string.
Definition: string.h:71
static size_t tds_quote(TDSSOCKET *tds, char *buffer, char quoting, const char *id, size_t len)
Quote a string properly.
Definition: query.c:2128
int(* write)(struct tds_output_stream *stream, size_t len)
write len bytes from buffer, return <0 if error or len
Definition: stream.h:41
TDS_INT type
row fetched from this cursor
Definition: tds.h:957
TDS_UINT product_version
version of product (Sybase/MS and full version)
Definition: tds.h:1094
TDS_INT cursor_id
cursor id returned by the server after cursor declare
Definition: tds.h:942
Information for a server connection.
Definition: tds.h:1164
const char * tds_convert_string(TDSSOCKET *tds, TDSICONV *char_conv, const char *s, int len, size_t *out_len)
Convert a string in an allocated buffer.
Definition: query.c:126
@ TDS_WRITING
client is writing data
Definition: tds.h:792
DSTR db_filename
database filename to attach (MSSQL)
Definition: tds.h:530
TDSRET tds_process_simple_query(TDSSOCKET *tds)
Process results for simple query as "SET TEXTSIZE" or "USE dbname" If the statement returns results,...
Definition: token.c:877
const char * tds_skip_quoted(const char *s)
Skip quoting string (like 'sfsf', "dflkdj" or [dfkjd])
Definition: query.c:515
TDS_UINT tds_get_uint(TDSSOCKET *tds)
Get an int32 from the server.
Definition: read.c:127
unsigned char canonic
internal numeric index into array of all encodings
Definition: tds.h:625
TDSRET tds_submit_optioncmd(TDSSOCKET *tds, TDS_OPTION_CMD command, TDS_OPTION option, TDS_OPTION_ARG *param, TDS_INT param_size)
Send option commands to server.
Definition: query.c:3389
size_t tds_iconv(TDSSOCKET *tds, TDSICONV *conv, TDS_ICONV_DIRECTION io, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
Wrapper around iconv(3).
Definition: iconv.c:590
tds_func_put_info * put_info
Send metadata column information to server.
Definition: tds.h:653
void tds_dstr_zero(DSTR *s)
clear all string filling with zeroes (mainly for security reason)
Definition: tdsstring.c:55
TDSRET tds_submit_query(TDSSOCKET *tds, const char *query)
Sends a language string to the database server for processing.
Definition: query.c:210
TDSRET tds_freeze_abort(TDSFREEZE *freeze)
Discard all data written after the freeze.
Definition: packet.c:961
define a stream of data used for output
Definition: stream.h:39
char * query
saved query, we need to know original query if prepare is impossible
Definition: tds.h:1010
TDSRET tds_get_column_declaration(TDSSOCKET *tds, TDSCOLUMN *curcol, char *out)
Return declaration for column (like "varchar(20)").
Definition: query.c:718
TDSAUTHENTICATION * tds_ntlm_get_auth(TDSSOCKET *tds)
Build a NTLMSPP packet to send to server.
Definition: challenge.c:721
TDSRET tds_process_login_tokens(TDSSOCKET *tds)
tds_process_login_tokens() is called after sending the login packet to the server.
Definition: token.c:410
const char * tds_skip_comment(const char *s)
Skip a comment in a query.
Definition: query.c:490
TDS_INT ref_count
reference counter so client can retain safely a pointer
Definition: tds.h:940
int tds_count_placeholders(const char *query)
Count the number of placeholders ('?') in a query.
Definition: query.c:571
int port
port of database service
Definition: tds.h:520
TDSDYNAMIC * cur_dyn
dynamic structure in use
Definition: tds.h:1257
TDSRET tds_submit_rollback(TDSSOCKET *tds, int cont)
Send a rollback request.
Definition: query.c:3693
TDSRESULTINFO * current_results
Current query information.
Definition: tds.h:1239
unsigned char tds_get_byte(TDSSOCKET *tds)
Return a single byte from the input buffer.
Definition: read.c:72
size_t tds_quote_id_rpc(TDSSOCKET *tds, char *buffer, const char *id, int idlen)
Quote an id for a RPC call.
Definition: query.c:2216
DSTR server_charset
charset of server e.g.
Definition: tds.h:524
char * cursor_name
name of the cursor
Definition: tds.h:941
static void tds_set_cur_cursor(TDSSOCKET *tds, TDSCURSOR *cursor)
Set current cursor.
Definition: query.c:2253
static int tds_dstr_isempty(const DSTR *s)
test if string is empty
Definition: string.h:60
static char * tds5_fix_dot_query(const char *query, size_t *query_len, TDSPARAMINFO *params)
Substitute ?-style placeholders with named (@param) ones.
Definition: query.c:227
int tds_put_string(TDSSOCKET *tds, const char *s, int len)
Output a string to wire automatic translate string to unicode if needed.
Definition: write.c:97
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
static const char * tds_skip_quoted_ucs2le(const char *s, const char *end)
Return pointer to end of a quoted string.
Definition: query.c:618
size_t tds_quote_string(TDSSOCKET *tds, char *buffer, const char *str, int len)
Quote a string.
Definition: query.c:2241
#define tds_put_tinyint(tds, ti)
Output a tinyint value.
Definition: tds.h:1468
char * query
SQL query.
Definition: tds.h:948
TDSICONV * tds_iconv_get_info(TDSCONNECTION *conn, int canonic_client, int canonic_server)
Get a iconv info structure, allocate and initialize if needed.
Definition: iconv.c:756
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_INT tds_convert(const TDSCONTEXT *tds_ctx, int srctype, const void *src, TDS_UINT srclen, int desttype, CONV_RESULT *cr)
tds_convert convert a type to another.
Definition: convert.c:1878
TDS_INT column_size
maximun size of data.
Definition: tds.h:695
static TDSRET tds_put_data(TDSSOCKET *tds, TDSCOLUMN *curcol)
Write data to wire.
Definition: query.c:279
static TDSRET tds4_send_emulated_rpc(TDSSOCKET *tds, const char *rpc_name, TDSPARAMINFO *params)
Send RPC as string query.
Definition: query.c:1873
DSTR * tds_dstr_get(TDSSOCKET *tds, DSTR *s, size_t len)
Reads a string from wire and put in a DSTR.
Definition: read.c:293
void tds_close_socket(TDSSOCKET *tds)
Close current socket.
Definition: net.c:548
bool tds_set_server(TDSLOGIN *tds_login, const char *server) TDS_WUR
Set the servername in a TDSLOGIN structure.
Definition: login.c:125
void tdsdump_off(void)
Temporarily turn off logging.
Definition: log.c:76
static TDSRET tds7_write_param_def_from_params(TDSSOCKET *tds, const char *query, size_t query_len, TDSPARAMINFO *params) TDS_WUR
Write string with parameters definition, useful for TDS7+.
Definition: query.c:964
Holds information for a dynamic (also called prepared) query.
Definition: tds.h:978
static const char * tds_dstr_cstr(const DSTR *s)
Returns a C version (NUL terminated string) of dstr.
Definition: string.h:78
volatile unsigned char in_cancel
indicate we are waiting a cancel reply; discard tokens till acknowledge; 1 mean we have to send cance...
Definition: tds.h:1249
bool defer_close
true if cursor was marker to be closed when connection is idle
Definition: tds.h:947
TDSPARAMINFO * params
query parameters.
Definition: tds.h:1008
TDSRET tds_process_tokens(TDSSOCKET *tds, TDS_INT *result_type, int *done_flags, unsigned flag)
process all streams.
Definition: token.c:530
TDSRET tds_freeze_close_len(TDSFREEZE *freeze, int32_t size)
Stop keeping data for this specific freeze.
Definition: packet.c:1031
static void tds7_put_query_params(TDSSOCKET *tds, const char *query, size_t query_len)
Output params types and query (required by sp_prepare/sp_executesql/sp_prepexec)
Definition: query.c:1064
#define TDS_PUT_N_AS_UCS2(tds, s)
Utility to convert a constant ascii string to ucs2 and send to server.
Definition: query.c:110
TDS_TINYINT column_scale
scale for decimal/numeric
Definition: tds.h:705
static size_t tds_dstr_len(const DSTR *s)
Returns the length of the string in bytes.
Definition: string.h:85
static TDSRET tds7_write_param_def_from_query(TDSSOCKET *tds, const char *converted_query, size_t converted_query_len, TDSPARAMINFO *params) TDS_WUR
Write string with parameters definition, useful for TDS7+.
Definition: query.c:903
@ TDS_DONE_ERROR
error occurred
Definition: tds.h:254
TDS_STATE tds_set_state(TDSSOCKET *tds, TDS_STATE state)
Set state of TDS connection, with logging and checking.
Definition: util.c:58
Holds informations about a cursor.
Definition: tds.h:938
unsigned char out_flag
output buffer type
Definition: tds.h:1197
TDSRET tds_submit_prepare(TDSSOCKET *tds, const char *query, const char *id, TDSDYNAMIC **dyn_out, TDSPARAMINFO *params)
Creates a temporary stored procedure in the server.
Definition: query.c:1124
TDSRET tds_submit_execdirect(TDSSOCKET *tds, const char *query, TDSPARAMINFO *params, TDSHEADERS *head)
Submit a prepared query with parameters.
Definition: query.c:1256
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
TDSRET tds_freeze_close(TDSFREEZE *freeze)
Stop keeping data for this specific freeze.
Definition: packet.c:996
unsigned out_pos
current position in out_buf
Definition: tds.h:1194
static int tds_count_placeholders_ucs2le(const char *query, const char *query_end)
Count the number of placeholders ('?') in a query.
Definition: query.c:692
TDS_INT num_id
numeric id for mssql7+
Definition: tds.h:982
unsigned int pending_close
true is connection has pending closing (cursors or dynamic)
Definition: tds.h:1124
static TDSRET tds5_put_params(TDSSOCKET *tds, TDSPARAMINFO *info, int flags) TDS_WUR
Send parameters to server.
Definition: query.c:1693
char id[30]
id of dynamic.
Definition: tds.h:988
TDS_INT column_cur_size
size written in variable (ie: char, text, binary).
Definition: tds.h:737
Structure to hold a string.
Definition: string.h:36
TDSICONV * char_conv
refers to previously allocated iconv information
Definition: tds.h:713
TDS_TINYINT column_varint_size
size of length when reading from wire (0, 1, 2 or 4)
Definition: tds.h:702
static size_t tds_ascii_to_ucs2(char *buffer, const char *buf)
Accept an ASCII string, convert it to UCS2-LE The input is NUL-terminated, but the output does not co...
Definition: query.c:91
int tdserror(const TDSCONTEXT *tds_ctx, TDSSOCKET *tds, int msgno, int errnum)
Call the client library's error handler (for library-generated errors only)
Definition: util.c:321
TDS_INT ref_count
reference counter so client can retain safely a pointer
Definition: tds.h:980
unsigned in_len
input buffer length
Definition: tds.h:1195
size_t tds_freeze_written(TDSFREEZE *freeze)
Compute how many bytes has been written from freeze.
Definition: packet.c:935
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_INT ret_status
return status from store procedure
Definition: tds.h:1251
DSTR password
password of account login
Definition: tds.h:536
TDSRET tds_submit_commit(TDSSOCKET *tds, int cont)
Send a commit request.
Definition: query.c:3724
TDSRET tds_submit_query_params(TDSSOCKET *tds, const char *query, TDSPARAMINFO *params, TDSHEADERS *head)
Sends a language string to the database server for processing.
Definition: query.c:350
@ TDS_DONE_COUNT
count field in packet is valid
Definition: tds.h:257
const char * tds_next_placeholder(const char *start)
Get position of next placeholder.
Definition: query.c:535
void tds_release_dynamic(TDSDYNAMIC **pdyn)
Frees dynamic statement.
Definition: mem.c:253
TDSRET tds_deferred_unprepare(TDSCONNECTION *conn, TDSDYNAMIC *dyn)
Unprepare dynamic on idle.
Definition: query.c:1774
@ TDS_PENDING
cilent is waiting for data
Definition: tds.h:794
unsigned int out_buf_max
Maximum size of packet pointed by out_buf.
Definition: tds.h:1192
Metadata about columns in regular and compute rows.
Definition: tds.h:690
size_t tds_fix_column_size(TDSSOCKET *tds, TDSCOLUMN *curcol)
Get column size for wire.
Definition: query.c:1491
TDSRET tds_flush_packet(TDSSOCKET *tds)
Flush packet to server.
Definition: write.c:224
#define TDS_IS_MSSQL(x)
Check if product is Microsft SQL Server.
Definition: tds.h:1715
DSTR user_name
account for login
Definition: tds.h:535
TDSRET tds_send_cancel(TDSSOCKET *tds)
tds_send_cancel() sends an empty packet (8 byte header only) tds_process_cancel should be called dire...
Definition: query.c:2026
#define DSTR_INITIALIZER
Initializer, used to initialize string like in the following example.
Definition: string.h:49
TDS_SERVER_TYPE column_type
This type can be different from wire type because conversion (e.g.
Definition: tds.h:697
unsigned char in_flag
input buffer type
Definition: tds.h:1196
TDSRET tds_deferred_cursor_dealloc(TDSCONNECTION *conn, TDSCURSOR *cursor)
Deallocate cursor on idle.
Definition: query.c:3057
static TDSRET tds_put_param_as_string(TDSSOCKET *tds, TDSPARAMINFO *params, int n)
Send a parameter to server.
Definition: query.c:3189
DSTR * tds_dstr_setlen(DSTR *s, size_t length)
limit length of string, MUST be <= current length
Definition: tdsstring.c:145
static bool tds_cursor_check_allocated(TDSCONNECTION *conn, TDSCURSOR *cursor)
Check if a cursor is allocated into the server.
Definition: query.c:2991
TDS_CURSOR_STATUS status
cursor parameter
Definition: tds.h:954
char * buffer
write buffer.
Definition: stream.h:50
output stream to write data to a dynamic buffer
Definition: stream.h:99
unsigned in_pos
current position in in_buf
Definition: tds.h:1193
static TDSRET tds_send_emulated_execute(TDSSOCKET *tds, const char *query, TDSPARAMINFO *params)
Emulate prepared execute traslating to a normal language.
Definition: query.c:3269
static TDSRET tds_start_query_head(TDSSOCKET *tds, unsigned char packet_type, TDSHEADERS *head)
Start query packet of a given type.
Definition: query.c:291
TDSRET tds_cursor_dealloc(TDSSOCKET *tds, TDSCURSOR *cursor)
Send a deallocation request to server.
Definition: query.c:3006
DSTR * tds_dstr_copy(DSTR *s, const char *src)
copy a string from another
Definition: tdsstring.c:122