7 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y)) 14 #line 1 "regression.h" 49 #define CURNAME "mycur" 66 char * stmt1 =
"SELECT id, t FROM t1" ;
78 struct varchar_1 {
int len;
char arr[ 50 ]; } curname4 ;
99 strcpy(msg,
"connect");
100 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL ,
"test1", 0);
101 #line 39 "cursor.pgc" 103 if (
sqlca.sqlcode < 0) exit (1);}
104 #line 39 "cursor.pgc" 106 {
ECPGconnect(__LINE__, 0,
"ecpg2_regression" , NULL, NULL ,
"test2", 0);
107 #line 40 "cursor.pgc" 109 if (
sqlca.sqlcode < 0) exit (1);}
110 #line 40 "cursor.pgc" 115 #line 43 "cursor.pgc" 117 if (
sqlca.sqlcode < 0) exit (1);}
118 #line 43 "cursor.pgc" 121 strcpy(msg,
"create");
123 #line 46 "cursor.pgc" 125 if (
sqlca.sqlcode < 0) exit (1);}
126 #line 46 "cursor.pgc" 129 #line 47 "cursor.pgc" 131 if (
sqlca.sqlcode < 0) exit (1);}
132 #line 47 "cursor.pgc" 135 strcpy(msg,
"insert");
136 {
ECPGdo(__LINE__, 0, 1,
"test1", 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'a' )",
ECPGt_EOIT,
ECPGt_EORT);
137 #line 50 "cursor.pgc" 139 if (
sqlca.sqlcode < 0) exit (1);}
140 #line 50 "cursor.pgc" 142 {
ECPGdo(__LINE__, 0, 1,
"test1", 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'b' )",
ECPGt_EOIT,
ECPGt_EORT);
143 #line 51 "cursor.pgc" 145 if (
sqlca.sqlcode < 0) exit (1);}
146 #line 51 "cursor.pgc" 148 {
ECPGdo(__LINE__, 0, 1,
"test1", 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'c' )",
ECPGt_EOIT,
ECPGt_EORT);
149 #line 52 "cursor.pgc" 151 if (
sqlca.sqlcode < 0) exit (1);}
152 #line 52 "cursor.pgc" 154 {
ECPGdo(__LINE__, 0, 1,
"test1", 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'd' )",
ECPGt_EOIT,
ECPGt_EORT);
155 #line 53 "cursor.pgc" 157 if (
sqlca.sqlcode < 0) exit (1);}
158 #line 53 "cursor.pgc" 160 {
ECPGdo(__LINE__, 0, 1,
"test2", 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'e' )",
ECPGt_EOIT,
ECPGt_EORT);
161 #line 54 "cursor.pgc" 163 if (
sqlca.sqlcode < 0) exit (1);}
164 #line 54 "cursor.pgc" 167 strcpy(msg,
"commit");
168 {
ECPGtrans(__LINE__,
"test1",
"commit");
169 #line 57 "cursor.pgc" 171 if (
sqlca.sqlcode < 0) exit (1);}
172 #line 57 "cursor.pgc" 174 {
ECPGtrans(__LINE__,
"test2",
"commit");
175 #line 58 "cursor.pgc" 177 if (
sqlca.sqlcode < 0) exit (1);}
178 #line 58 "cursor.pgc" 183 strcpy(msg,
"declare");
186 #line 64 "cursor.pgc" 188 if (
sqlca.sqlcode < 0) exit (1);
189 #line 64 "cursor.pgc" 191 #line 64 "cursor.pgc" 195 {
ECPGdo(__LINE__, 0, 1,
"test1", 0,
ECPGst_normal,
"declare $0 cursor for select id , t from t1",
196 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
198 #line 67 "cursor.pgc" 200 if (
sqlca.sqlcode < 0) exit (1);}
201 #line 67 "cursor.pgc" 204 strcpy(msg,
"fetch from");
206 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
208 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
210 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
212 #line 70 "cursor.pgc" 214 if (
sqlca.sqlcode < 0) exit (1);}
215 #line 70 "cursor.pgc" 219 strcpy(msg,
"fetch");
221 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
223 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
225 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
227 #line 74 "cursor.pgc" 229 if (
sqlca.sqlcode < 0) exit (1);}
230 #line 74 "cursor.pgc" 234 strcpy(msg,
"fetch 1 from");
236 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
238 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
240 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
242 #line 78 "cursor.pgc" 244 if (
sqlca.sqlcode < 0) exit (1);}
245 #line 78 "cursor.pgc" 249 strcpy(msg,
"fetch :count from");
252 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
254 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
256 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
258 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
260 #line 83 "cursor.pgc" 262 if (
sqlca.sqlcode < 0) exit (1);}
263 #line 83 "cursor.pgc" 267 strcpy(msg,
"move in");
269 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
271 #line 87 "cursor.pgc" 273 if (
sqlca.sqlcode < 0) exit (1);}
274 #line 87 "cursor.pgc" 277 strcpy(msg,
"fetch 1");
279 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
281 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
283 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
285 #line 90 "cursor.pgc" 287 if (
sqlca.sqlcode < 0) exit (1);}
288 #line 90 "cursor.pgc" 292 strcpy(msg,
"fetch :count");
295 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
297 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
299 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
301 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
303 #line 95 "cursor.pgc" 305 if (
sqlca.sqlcode < 0) exit (1);}
306 #line 95 "cursor.pgc" 310 strcpy(msg,
"close");
312 ECPGt_char,&(curname1),(
long)0,(
long)1,(1)*
sizeof(
char),
314 #line 99 "cursor.pgc" 316 if (
sqlca.sqlcode < 0) exit (1);}
317 #line 99 "cursor.pgc" 322 strcpy(msg,
"declare");
324 ECPGset_var( 2, ( t ), __LINE__);\
325 ECPGset_var( 3, &(
id ), __LINE__);\
327 #line 105 "cursor.pgc" 329 if (
sqlca.sqlcode < 0) exit (1);
330 #line 105 "cursor.pgc" 332 #line 105 "cursor.pgc" 336 {
ECPGdo(__LINE__, 0, 1,
"test1", 0,
ECPGst_normal,
"declare $0 cursor for select id , t from t1",
337 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
339 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
341 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
343 #line 108 "cursor.pgc" 345 if (
sqlca.sqlcode < 0) exit (1);}
346 #line 108 "cursor.pgc" 349 strcpy(msg,
"fetch from");
351 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
353 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
355 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
357 #line 111 "cursor.pgc" 359 if (
sqlca.sqlcode < 0) exit (1);}
360 #line 111 "cursor.pgc" 364 strcpy(msg,
"fetch");
366 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
368 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
370 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
372 #line 115 "cursor.pgc" 374 if (
sqlca.sqlcode < 0) exit (1);}
375 #line 115 "cursor.pgc" 379 strcpy(msg,
"fetch 1 from");
381 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
383 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
385 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
387 #line 119 "cursor.pgc" 389 if (
sqlca.sqlcode < 0) exit (1);}
390 #line 119 "cursor.pgc" 394 strcpy(msg,
"fetch :count from");
397 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
399 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
401 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
403 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
405 #line 124 "cursor.pgc" 407 if (
sqlca.sqlcode < 0) exit (1);}
408 #line 124 "cursor.pgc" 414 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
416 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
418 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
420 #line 128 "cursor.pgc" 422 if (
sqlca.sqlcode < 0) exit (1);}
423 #line 128 "cursor.pgc" 426 strcpy(msg,
"fetch 1");
428 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
430 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
432 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
434 #line 131 "cursor.pgc" 436 if (
sqlca.sqlcode < 0) exit (1);}
437 #line 131 "cursor.pgc" 441 strcpy(msg,
"fetch :count");
444 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
446 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
448 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
450 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
452 #line 136 "cursor.pgc" 454 if (
sqlca.sqlcode < 0) exit (1);}
455 #line 136 "cursor.pgc" 459 strcpy(msg,
"close");
461 ECPGt_char,&(curname2),(
long)0,(
long)1,(1)*
sizeof(
char),
463 #line 140 "cursor.pgc" 465 if (
sqlca.sqlcode < 0) exit (1);}
466 #line 140 "cursor.pgc" 471 strcpy(msg,
"prepare");
472 {
ECPGprepare(__LINE__,
"test1", 0,
"st_id1", stmt1);
473 #line 145 "cursor.pgc" 475 if (
sqlca.sqlcode < 0) exit (1);}
476 #line 145 "cursor.pgc" 478 {
ECPGprepare(__LINE__,
"test2", 0,
"st_id1", stmt1);
479 #line 146 "cursor.pgc" 481 if (
sqlca.sqlcode < 0) exit (1);}
482 #line 146 "cursor.pgc" 485 strcpy(msg,
"declare");
488 #line 149 "cursor.pgc" 490 if (
sqlca.sqlcode < 0) exit (1);
491 #line 149 "cursor.pgc" 493 #line 149 "cursor.pgc" 497 #line 150 "cursor.pgc" 499 if (
sqlca.sqlcode < 0) exit (1);
500 #line 150 "cursor.pgc" 502 #line 150 "cursor.pgc" 507 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
511 #line 153 "cursor.pgc" 513 if (
sqlca.sqlcode < 0) exit (1);}
514 #line 153 "cursor.pgc" 517 ECPGt_char,&(curname5),(
long)0,(
long)1,(1)*
sizeof(
char),
521 #line 154 "cursor.pgc" 523 if (
sqlca.sqlcode < 0) exit (1);}
524 #line 154 "cursor.pgc" 527 strcpy(msg,
"fetch");
529 ECPGt_char,&(curname5),(
long)0,(
long)1,(1)*
sizeof(
char),
531 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
533 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
535 #line 157 "cursor.pgc" 537 if (
sqlca.sqlcode < 0) exit (1);}
538 #line 157 "cursor.pgc" 542 strcpy(msg,
"fetch from");
544 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
546 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
548 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
550 #line 161 "cursor.pgc" 552 if (
sqlca.sqlcode < 0) exit (1);}
553 #line 161 "cursor.pgc" 557 strcpy(msg,
"fetch 1 from");
559 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
561 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
563 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
565 #line 165 "cursor.pgc" 567 if (
sqlca.sqlcode < 0) exit (1);}
568 #line 165 "cursor.pgc" 572 strcpy(msg,
"fetch :count from");
575 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
577 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
579 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
581 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
583 #line 170 "cursor.pgc" 585 if (
sqlca.sqlcode < 0) exit (1);}
586 #line 170 "cursor.pgc" 592 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
594 #line 174 "cursor.pgc" 596 if (
sqlca.sqlcode < 0) exit (1);}
597 #line 174 "cursor.pgc" 600 strcpy(msg,
"fetch 1");
602 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
604 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
606 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
608 #line 177 "cursor.pgc" 610 if (
sqlca.sqlcode < 0) exit (1);}
611 #line 177 "cursor.pgc" 615 strcpy(msg,
"fetch :count");
618 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
620 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
622 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
624 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
626 #line 182 "cursor.pgc" 628 if (
sqlca.sqlcode < 0) exit (1);}
629 #line 182 "cursor.pgc" 633 strcpy(msg,
"close");
635 ECPGt_char,&(curname3),(
long)0,(
long)1,(1)*
sizeof(
char),
637 #line 186 "cursor.pgc" 639 if (
sqlca.sqlcode < 0) exit (1);}
640 #line 186 "cursor.pgc" 643 ECPGt_char,&(curname5),(
long)0,(
long)1,(1)*
sizeof(
char),
645 #line 187 "cursor.pgc" 647 if (
sqlca.sqlcode < 0) exit (1);}
648 #line 187 "cursor.pgc" 651 strcpy(msg,
"deallocate prepare");
653 #line 190 "cursor.pgc" 655 if (
sqlca.sqlcode < 0) exit (1);}
656 #line 190 "cursor.pgc" 659 #line 191 "cursor.pgc" 661 if (
sqlca.sqlcode < 0) exit (1);}
662 #line 191 "cursor.pgc" 668 curname4.len = strlen(
CURNAME);
671 strcpy(msg,
"prepare");
672 {
ECPGprepare(__LINE__,
"test1", 0,
"st_id2", stmt1);
673 #line 200 "cursor.pgc" 675 if (
sqlca.sqlcode < 0) exit (1);}
676 #line 200 "cursor.pgc" 679 strcpy(msg,
"declare");
682 #line 203 "cursor.pgc" 684 if (
sqlca.sqlcode < 0) exit (1);
685 #line 203 "cursor.pgc" 687 #line 203 "cursor.pgc" 692 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
696 #line 206 "cursor.pgc" 698 if (
sqlca.sqlcode < 0) exit (1);}
699 #line 206 "cursor.pgc" 702 strcpy(msg,
"fetch from");
704 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
706 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
708 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
710 #line 209 "cursor.pgc" 712 if (
sqlca.sqlcode < 0) exit (1);}
713 #line 209 "cursor.pgc" 717 strcpy(msg,
"fetch");
719 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
721 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
723 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
725 #line 213 "cursor.pgc" 727 if (
sqlca.sqlcode < 0) exit (1);}
728 #line 213 "cursor.pgc" 732 strcpy(msg,
"fetch 1 from");
734 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
736 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
738 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
740 #line 217 "cursor.pgc" 742 if (
sqlca.sqlcode < 0) exit (1);}
743 #line 217 "cursor.pgc" 747 strcpy(msg,
"fetch :count from");
750 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
752 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
754 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
756 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
758 #line 222 "cursor.pgc" 760 if (
sqlca.sqlcode < 0) exit (1);}
761 #line 222 "cursor.pgc" 767 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
769 #line 226 "cursor.pgc" 771 if (
sqlca.sqlcode < 0) exit (1);}
772 #line 226 "cursor.pgc" 775 strcpy(msg,
"fetch 1");
777 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
779 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
781 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
783 #line 229 "cursor.pgc" 785 if (
sqlca.sqlcode < 0) exit (1);}
786 #line 229 "cursor.pgc" 790 strcpy(msg,
"fetch :count");
793 ECPGt_int,&(count),(
long)1,(
long)1,
sizeof(
int),
795 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
797 ECPGt_int,&(
id),(
long)1,(
long)1,
sizeof(
int),
799 ECPGt_char,(t),(
long)64,(
long)1,(64)*
sizeof(
char),
801 #line 234 "cursor.pgc" 803 if (
sqlca.sqlcode < 0) exit (1);}
804 #line 234 "cursor.pgc" 808 strcpy(msg,
"close");
810 ECPGt_varchar,&(curname4),(
long)50,(
long)1,
sizeof(
struct varchar_1),
812 #line 238 "cursor.pgc" 814 if (
sqlca.sqlcode < 0) exit (1);}
815 #line 238 "cursor.pgc" 818 strcpy(msg,
"deallocate prepare");
820 #line 241 "cursor.pgc" 822 if (
sqlca.sqlcode < 0) exit (1);}
823 #line 241 "cursor.pgc" 830 #line 246 "cursor.pgc" 832 if (
sqlca.sqlcode < 0) exit (1);}
833 #line 246 "cursor.pgc" 836 #line 247 "cursor.pgc" 838 if (
sqlca.sqlcode < 0) exit (1);}
839 #line 247 "cursor.pgc" 842 strcpy(msg,
"commit");
843 {
ECPGtrans(__LINE__,
"test1",
"commit");
844 #line 250 "cursor.pgc" 846 if (
sqlca.sqlcode < 0) exit (1);}
847 #line 250 "cursor.pgc" 850 strcpy(msg,
"disconnect");
852 #line 253 "cursor.pgc" 854 if (
sqlca.sqlcode < 0) exit (1);}
855 #line 253 "cursor.pgc"
bool ECPGdisconnect(int lineno, const char *connection_name)
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,...)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
void ECPGset_var(int number, void *pointer, int lineno)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno)