45{
46
47
48
49
50
51
52
53#line 27 "bytea.pgc"
54 struct bytea_1 {
int len;
char arr[ 512 ]; } send_buf [ 2 ] ;
55
56#line 28 "bytea.pgc"
57 struct bytea_2 {
int len;
char arr[
DATA_SIZE ]; } recv_buf [ 2 ] ;
58
59#line 29 "bytea.pgc"
60 struct bytea_3 {
int len;
char arr[
DATA_SIZE ]; } * recv_vlen_buf ;
61
62#line 30 "bytea.pgc"
64
65#line 31 "bytea.pgc"
67
68#line 32 "bytea.pgc"
69
71
72#define init() { \
73 for (i = 0; i < 2; ++i) \
74 { \
75 memset(recv_buf[i].arr, 0x0, sizeof(recv_buf[i].arr)); \
76 recv_buf[i].len = 0; \
77 ind[i] = 0; \
78 } \
79 recv_vlen_buf = NULL, \
80 memset(recv_short_buf.arr, 0x0, sizeof(recv_short_buf.arr)); \
81} \
82while (0)
83
85
86 for (
i = 0;
i < 2; ++
i)
87 {
89 send_buf[
i].arr[
j] =
c;
90
92 }
93
94 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
95#line 57 "bytea.pgc"
96
98#line 57 "bytea.pgc"
99
100
102#line 59 "bytea.pgc"
103
105#line 59 "bytea.pgc"
106
107
108 {
ECPGprepare(__LINE__, NULL, 0,
"ins_stmt",
"insert into test values(?,?)");
109#line 61 "bytea.pgc"
110
112#line 61 "bytea.pgc"
113
114 {
ECPGprepare(__LINE__, NULL, 0,
"sel_stmt",
"select data1,data2 from test");
115#line 62 "bytea.pgc"
116
118#line 62 "bytea.pgc"
119
121#line 63 "bytea.pgc"
122
124#line 63 "bytea.pgc"
125
127#line 64 "bytea.pgc"
128
130#line 64 "bytea.pgc"
131
132
133
136#line 68 "bytea.pgc"
137
139#line 68 "bytea.pgc"
140
142 ECPGt_bytea,&(send_buf[0]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
144 ECPGt_bytea,&(send_buf[1]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
146#line 69 "bytea.pgc"
147
149#line 69 "bytea.pgc"
150
156#line 70 "bytea.pgc"
157
159#line 70 "bytea.pgc"
160
163
164
167#line 76 "bytea.pgc"
168
170#line 76 "bytea.pgc"
171
173 ECPGt_bytea,&(send_buf[0]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
175 ECPGt_bytea,&(send_buf[1]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
177#line 77 "bytea.pgc"
178
180#line 77 "bytea.pgc"
181
183
184#line 78 "bytea.pgc"
185
187#line 78 "bytea.pgc"
188
189#line 78 "bytea.pgc"
190
191 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"declare cursor1 cursor for select data1 from test where data1 = $1 ",
192 ECPGt_bytea,&(send_buf[0]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
194#line 79 "bytea.pgc"
195
197#line 79 "bytea.pgc"
198
202#line 80 "bytea.pgc"
203
205#line 80 "bytea.pgc"
206
208#line 81 "bytea.pgc"
209
211#line 81 "bytea.pgc"
212
214#line 82 "bytea.pgc"
215
217#line 82 "bytea.pgc"
218
220
221
224#line 87 "bytea.pgc"
225
227#line 87 "bytea.pgc"
228
230 ECPGt_bytea,&(send_buf[0]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
232 ECPGt_bytea,&(send_buf[1]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
234#line 88 "bytea.pgc"
235
237#line 88 "bytea.pgc"
238
240 ECPGt_bytea,&(send_buf[0]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
242 ECPGt_bytea,&(send_buf[1]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
244#line 89 "bytea.pgc"
245
247#line 89 "bytea.pgc"
248
252#line 90 "bytea.pgc"
253
255#line 90 "bytea.pgc"
256
260
261
264#line 97 "bytea.pgc"
265
267#line 97 "bytea.pgc"
268
270 ECPGt_bytea,&(send_buf[0]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
272 ECPGt_bytea,&(send_buf[1]),(
long)512,(
long)1,
sizeof(
struct bytea_1),
274#line 98 "bytea.pgc"
275
277#line 98 "bytea.pgc"
278
284#line 99 "bytea.pgc"
285
287#line 99 "bytea.pgc"
288
291
292
295#line 105 "bytea.pgc"
296
298#line 105 "bytea.pgc"
299
302
303#line 106 "bytea.pgc"
304
306#line 106 "bytea.pgc"
307
310
311#line 107 "bytea.pgc"
312
314#line 107 "bytea.pgc"
315
319#line 108 "bytea.pgc"
320
322#line 108 "bytea.pgc"
323
327#line 109 "bytea.pgc"
328
330#line 109 "bytea.pgc"
331
335
336#line 110 "bytea.pgc"
337
339#line 110 "bytea.pgc"
340
344
345#line 111 "bytea.pgc"
346
348#line 111 "bytea.pgc"
349
352
354#line 115 "bytea.pgc"
355
357#line 115 "bytea.pgc"
358
360#line 116 "bytea.pgc"
361
363#line 116 "bytea.pgc"
364
366#line 117 "bytea.pgc"
367
369#line 117 "bytea.pgc"
370
371
372 return 0;
373}
bool ECPGdisconnect(int lineno, const char *connection_name)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGget_desc(int lineno, const char *desc_name, int index,...)
bool ECPGallocate_desc(int line, const char *name)
bool ECPGset_desc(int lineno, const char *desc_name, int index,...)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
void ECPGset_var(int number, void *pointer, int lineno)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
static void dump_binary(char *buf, int len, int ind)