mirror of https://github.com/postgres/postgres
parent
276b3bb3e3
commit
c9970d5948
@ -1,62 +0,0 @@ |
||||
[NO_PID]: ECPGdebug: set to 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGsetcommit line 42 action = on connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 44 action = begin transaction connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 46: QUERY: create table test ( f float , i int , a int [ 10 ] , text char ( 10 ) , b bool , t int , err int ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 46 Ok: CREATE TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 48: QUERY: insert into test ( f , i , a , text , b , t , err ) values( 404.90 , 3 , '{0,1,2,3,4,5,6,7,8,9}' , 'abcdefghij' , 'f' , 0 , 0 ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 48 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 50: QUERY: insert into test ( f , i , a , text , b , t , err ) values( 140787.0 , 2 , array [9,8,7,6,5,4,3,2,1,0] , 'klmnopqrst' , 't' , 2 , 14 ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 50 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 55: QUERY: insert into test ( f , i , a , text , b , t , err ) values( 14.07 , 1 , array [9,8,7,6,5,4,3,2,1,0] , '0123456789' , 't' , 1 , 147 ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 55 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 59 action = commit connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 61 action = begin transaction connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 63: QUERY: select f , text , b from test where i = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 63: Correctly got 1 tuples with 3 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 63: RESULT: 14.07 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 63: RESULT: 0123456789 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 63: RESULT: t offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 71: QUERY: select a , text from test where f = 140787 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 71: Correctly got 1 tuples with 2 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGis_type_an_array line 71: TYPE database: 1007 C: 5 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 71: RESULT: {9,8,7,6,5,4,3,2,1,0} offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 71: RESULT: klmnopqrst offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 81: QUERY: select a from test where f = 140787 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 81: Correctly got 1 tuples with 1 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 81: RESULT: {9,8,7,6,5,4,3,2,1,0} offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 88: QUERY: drop table test on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 88 Ok: DROP TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 90 action = commit connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: Connection regress1 closed. |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
@ -1,56 +0,0 @@ |
||||
[NO_PID]: ECPGdebug: set to 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 44: QUERY: create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 44 Ok: CREATE TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 52: QUERY: insert into empl values( 1 , 'first user' , 320 , E'\\001\\155\\000\\212' ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 59: QUERY: select name , accs , byte from empl where idnum = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 59: Correctly got 1 tuples with 3 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 59: RESULT: first user offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 59: RESULT: 320 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 59: RESULT: \001m\000\212 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 71: QUERY: declare C cursor for select name , accs , byte from empl where idnum = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 71 Ok: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 72: QUERY: fetch C on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 72: Correctly got 1 tuples with 3 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 72: RESULT: first user offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 72: RESULT: 320 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 72: RESULT: \001m\000\212 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 84: QUERY: declare B binary cursor for select name , accs , byte from empl where idnum = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 84 Ok: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 85: QUERY: fetch B on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 85: Correctly got 1 tuples with 3 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 85: RESULT: BINARY offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 85: RESULT: BINARY offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 85: RESULT: BINARY offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 92: QUERY: close B on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 92 Ok: CLOSE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: Connection regress1 closed. |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
@ -1,2 +1,97 @@ |
||||
timestamp: 2003-12-04 17:34:29 |
||||
Date of timestamp: 2003-12-04 |
||||
Date[0]: - (N - T) |
||||
Date[1]: - (N - T) |
||||
Date[2]: - (N - T) |
||||
Date[3]: 1999-01-08 (N - F) |
||||
TS[3,0]: 1999-01-08 00:04:00 |
||||
TS[3,1]: 1999-01-08 01:59:00 |
||||
TS[3,2]: 1999-01-08 13:24:40 |
||||
TS[3,3]: 1999-01-08 13:24:40.495 |
||||
Date[4]: 1999-01-08 (N - F) |
||||
TS[4,0]: 1999-01-08 00:04:00 |
||||
TS[4,1]: 1999-01-08 01:59:00 |
||||
TS[4,2]: 1999-01-08 13:24:40 |
||||
TS[4,3]: 1999-01-08 13:24:40.495 |
||||
Date[5]: 1999-01-08 (N - F) |
||||
TS[5,0]: 1999-01-08 00:04:00 |
||||
TS[5,1]: 1999-01-08 01:59:00 |
||||
TS[5,2]: 1999-01-08 13:24:40 |
||||
TS[5,3]: 1999-01-08 13:24:40.495 |
||||
Date[6]: 1999-01-18 (N - F) |
||||
TS[6,0]: 1999-01-18 00:04:00 |
||||
TS[6,1]: 1999-01-18 01:59:00 |
||||
TS[6,2]: 1999-01-18 13:24:40 |
||||
TS[6,3]: 1999-01-18 13:24:40.495 |
||||
Date[7]: 2003-01-02 (N - F) |
||||
TS[7,0]: 2003-01-02 00:04:00 |
||||
TS[7,1]: 2003-01-02 01:59:00 |
||||
TS[7,2]: 2003-01-02 13:24:40 |
||||
TS[7,3]: 2003-01-02 13:24:40.495 |
||||
Date[8]: 1999-01-08 (N - F) |
||||
TS[8,0]: 1999-01-08 00:04:00 |
||||
TS[8,1]: 1999-01-08 01:59:00 |
||||
TS[8,2]: 1999-01-08 13:24:40 |
||||
TS[8,3]: 1999-01-08 13:24:40.495 |
||||
Date[9]: 1999-01-08 (N - F) |
||||
TS[9,0]: 1999-01-08 00:04:00 |
||||
TS[9,1]: 1999-01-08 01:59:00 |
||||
TS[9,2]: 1999-01-08 13:24:40 |
||||
TS[9,3]: 1999-01-08 13:24:40.495 |
||||
Date[10]: 1999-01-08 (N - F) |
||||
TS[10,0]: 1999-01-08 00:04:00 |
||||
TS[10,1]: 1999-01-08 01:59:00 |
||||
TS[10,2]: 1999-01-08 13:24:40 |
||||
TS[10,3]: 1999-01-08 13:24:40.495 |
||||
Date[11]: 1999-01-08 (N - F) |
||||
TS[11,0]: 1999-01-08 00:04:00 |
||||
TS[11,1]: 1999-01-08 01:59:00 |
||||
TS[11,2]: 1999-01-08 13:24:40 |
||||
TS[11,3]: 1999-01-08 13:24:40.495 |
||||
Date[12]: 1999-01-08 (N - F) |
||||
TS[12,0]: 1999-01-08 00:04:00 |
||||
TS[12,1]: 1999-01-08 01:59:00 |
||||
TS[12,2]: 1999-01-08 13:24:40 |
||||
TS[12,3]: 1999-01-08 13:24:40.495 |
||||
Date[13]: 2006-01-08 (N - F) |
||||
TS[13,0]: 2006-01-08 00:04:00 |
||||
TS[13,1]: 2006-01-08 01:59:00 |
||||
TS[13,2]: 2006-01-08 13:24:40 |
||||
TS[13,3]: 2006-01-08 13:24:40.495 |
||||
Date[14]: 1999-01-08 (N - F) |
||||
TS[14,0]: 1999-01-08 00:04:00 |
||||
TS[14,1]: 1999-01-08 01:59:00 |
||||
TS[14,2]: 1999-01-08 13:24:40 |
||||
TS[14,3]: 1999-01-08 13:24:40.495 |
||||
Date[15]: 1999-01-08 (N - F) |
||||
TS[15,0]: 1999-01-08 00:04:00 |
||||
TS[15,1]: 1999-01-08 01:59:00 |
||||
TS[15,2]: 1999-01-08 13:24:40 |
||||
TS[15,3]: 1999-01-08 13:24:40.495 |
||||
Date[16]: 1999-01-08 (N - F) |
||||
TS[16,0]: 1999-01-08 00:04:00 |
||||
TS[16,1]: 1999-01-08 01:59:00 |
||||
TS[16,2]: 1999-01-08 13:24:40 |
||||
TS[16,3]: 1999-01-08 13:24:40.495 |
||||
Date[17]: 1999-01-08 (N - F) |
||||
TS[17,0]: 1999-01-08 00:04:00 |
||||
TS[17,1]: 1999-01-08 01:59:00 |
||||
TS[17,2]: 1999-01-08 13:24:40 |
||||
TS[17,3]: 1999-01-08 13:24:40.495 |
||||
Date[18]: 1999-01-08 (N - F) |
||||
TS[18,0]: 1999-01-08 00:04:00 |
||||
TS[18,1]: 1999-01-08 01:59:00 |
||||
TS[18,2]: 1999-01-08 13:24:40 |
||||
TS[18,3]: 1999-01-08 13:24:40.495 |
||||
Date[19]: 0099-01-08 BC (N - F) |
||||
TS[19,0]: 0099-01-08 00:04:00 BC |
||||
TS[19,1]: 0099-01-08 01:59:00 BC |
||||
TS[19,2]: 0099-01-08 13:24:40 BC |
||||
TS[19,3]: 0099-01-08 13:24:40.495 BC |
||||
interval[0]: @ 1 min |
||||
interval[1]: @ 1 day 12 hours 59 mins 10 secs |
||||
interval[2]: @ 2 days 12 hours 59 mins 10 secs |
||||
interval[3]: @ 1 day 12 hours 59 mins 10 secs |
||||
interval[4]: @ 1 day 1 hour 1 min 1 sec |
||||
interval[5]: @ 1 year 59 mins |
||||
Error parsing interval 6 |
||||
|
@ -0,0 +1,127 @@ |
||||
/* Processed by ecpg (4.2.1) */ |
||||
/* These include files are added by the preprocessor */ |
||||
#include <ecpgtype.h> |
||||
#include <ecpglib.h> |
||||
#include <ecpgerrno.h> |
||||
#include <sqlca.h> |
||||
/* End of automatic include section */ |
||||
|
||||
#line 1 "define.pgc" |
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
|
||||
|
||||
#line 1 "regression.h" |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 4 "define.pgc" |
||||
|
||||
|
||||
typedef long mmInteger ; |
||||
|
||||
#line 6 "define.pgc" |
||||
|
||||
#line 6 "define.pgc" |
||||
|
||||
typedef char mmChar ; |
||||
|
||||
#line 7 "define.pgc" |
||||
|
||||
#line 7 "define.pgc" |
||||
|
||||
typedef short mmSmallInt ; |
||||
|
||||
#line 8 "define.pgc" |
||||
|
||||
#line 8 "define.pgc" |
||||
|
||||
|
||||
/* exec sql begin declare section */ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct TBempl {
|
||||
#line 13 "define.pgc" |
||||
mmInteger idnum ; |
||||
|
||||
#line 14 "define.pgc" |
||||
mmChar name [ 21 ] ; |
||||
|
||||
#line 15 "define.pgc" |
||||
mmSmallInt accs ; |
||||
} ;/* exec sql end declare section */ |
||||
#line 17 "define.pgc" |
||||
|
||||
|
||||
int |
||||
main (void) |
||||
{ |
||||
/* exec sql begin declare section */ |
||||
|
||||
|
||||
#line 23 "define.pgc" |
||||
struct TBempl empl ; |
||||
/* exec sql end declare section */ |
||||
#line 24 "define.pgc" |
||||
|
||||
|
||||
ECPGdebug (1, stderr); |
||||
|
||||
empl.idnum = 1; |
||||
{ ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , NULL, 0); } |
||||
#line 29 "define.pgc" |
||||
|
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("connect error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, "create table empl ( idnum integer , name char ( 20 ) , accs smallint ) ", ECPGt_EOIT, ECPGt_EORT);} |
||||
#line 37 "define.pgc" |
||||
|
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("create error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into empl values ( 1 , 'first user' , 320 ) ", ECPGt_EOIT, ECPGt_EORT);} |
||||
#line 44 "define.pgc" |
||||
|
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("insert error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, "select idnum , name , accs from empl where idnum = ? ",
|
||||
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_char,&(empl.name),(long)21,(long)1,(21)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_short,&(empl.accs),(long)1,(long)1,sizeof(short),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} |
||||
#line 54 "define.pgc" |
||||
|
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("select error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
printf ("id=%ld name=%s, accs=%d\n", empl.idnum, empl.name, empl.accs); |
||||
|
||||
{ ECPGdisconnect(__LINE__, "CURRENT");} |
||||
#line 62 "define.pgc" |
||||
|
||||
exit (0); |
||||
} |
@ -0,0 +1,24 @@ |
||||
[NO_PID]: ECPGdebug: set to 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 36: QUERY: create table empl ( idnum integer , name char ( 20 ) , accs smallint ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 36 Ok: CREATE TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 44: QUERY: insert into empl values ( 1 , 'first user' , 320 ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 44 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 51: QUERY: select idnum , name , accs from empl where idnum = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 51: Correctly got 1 tuples with 3 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 51: RESULT: 1 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 51: RESULT: first user offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 51: RESULT: 320 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: Connection regress1 closed. |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
@ -0,0 +1 @@ |
||||
id=1 name=first user , accs=320 |
@ -0,0 +1,60 @@ |
||||
[NO_PID]: ECPGdebug: set to 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGsetcommit line 29 action = on connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 31 action = begin transaction connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 33: QUERY: create table test ( f float , i int , a int [ 10 ] , text char ( 10 ) ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 33 Ok: CREATE TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 35: QUERY: insert into test ( f , i , a , text ) values ( 404.90 , 3 , '{0,1,2,3,4,5,6,7,8,9}' , 'abcdefghij' ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 35 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 37: QUERY: insert into test ( f , i , a , text ) values ( 140787.0 , 2 , array [9,8,7,6,5,4,3,2,1,0] , 'klmnopqrst' ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 37 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 39: QUERY: insert into test ( f , i , a , text ) values ( 14.07 , 1 , array [9,8,7,6,5,4,3,2,1,0] , '0123456789' ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 39 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 41 action = commit connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 43 action = begin transaction connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 45: QUERY: select f , text from test where i = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 45: Correctly got 1 tuples with 2 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 45: RESULT: 14.07 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 45: RESULT: 0123456789 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 53: QUERY: select a , text from test where f = 140787 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 53: Correctly got 1 tuples with 2 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGis_type_an_array line 53: TYPE database: 1007 C: 5 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 53: RESULT: {9,8,7,6,5,4,3,2,1,0} offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 53: RESULT: klmnopqrst offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 63: QUERY: select a from test where f = 140787 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 63: Correctly got 1 tuples with 1 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 63: RESULT: {9,8,7,6,5,4,3,2,1,0} offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 70: QUERY: drop table test on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 70 Ok: DROP TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans line 72 action = commit connection = regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: Connection regress1 closed. |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
@ -1,4 +1,4 @@ |
||||
Found f=14.070000 text=0123456789 b=1 |
||||
Found f=14.070000 text=0123456789 |
||||
Found a[0] = 9 |
||||
Found a[1] = 8 |
||||
Found a[2] = 7 |
@ -0,0 +1,46 @@ |
||||
[NO_PID]: ECPGdebug: set to 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 35: QUERY: create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 35 Ok: CREATE TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 43: QUERY: insert into empl values ( 1 , 'first user' , 320 , E'\\001\\155\\000\\212' ) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 43 Ok: INSERT 0 1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 51: QUERY: declare C cursor for select name , accs , byte from empl where idnum = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 51 Ok: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 52: QUERY: fetch C on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 52: Correctly got 1 tuples with 3 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 52: RESULT: first user offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 52: RESULT: 320 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 52: RESULT: \001m\000\212 offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 64: QUERY: declare B binary cursor for select name , accs , byte from empl where idnum = 1 on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 64 Ok: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 65: QUERY: fetch B on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 65: Correctly got 1 tuples with 3 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 65: RESULT: BINARY offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 65: RESULT: BINARY offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGget_data line 65: RESULT: BINARY offset: -1 array: Yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 72: QUERY: close B on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGexecute line 72 Ok: CLOSE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: Connection regress1 closed. |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
@ -1,3 +1,2 @@ |
||||
name=first user , accs=320 byte=\001m\000\212 |
||||
name=first user , accs=320 byte=\001m\000\212 |
||||
name=first user , byte=(1)(155)(0)(212) |
@ -0,0 +1,11 @@ |
||||
subdir = src/interfaces/ecpg/test/preproc
|
||||
top_builddir = ../../../../..
|
||||
include $(top_builddir)/src/Makefile.global |
||||
include $(top_srcdir)/$(subdir)/../Makefile.regress |
||||
|
||||
|
||||
TESTS = define define.c \
|
||||
init init.c
|
||||
|
||||
all: $(TESTS) |
||||
|
@ -0,0 +1,64 @@ |
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
|
||||
EXEC SQL include ../regression; |
||||
|
||||
EXEC SQL typedef long mmInteger; |
||||
EXEC SQL typedef char mmChar; |
||||
EXEC SQL typedef short mmSmallInt; |
||||
|
||||
EXEC SQL BEGIN DECLARE SECTION; |
||||
struct TBempl |
||||
{ |
||||
mmInteger idnum; |
||||
mmChar name[21]; |
||||
mmSmallInt accs; |
||||
}; |
||||
EXEC SQL END DECLARE SECTION; |
||||
|
||||
int |
||||
main (void) |
||||
{ |
||||
EXEC SQL BEGIN DECLARE SECTION; |
||||
struct TBempl empl; |
||||
EXEC SQL END DECLARE SECTION; |
||||
|
||||
ECPGdebug (1, stderr); |
||||
|
||||
empl.idnum = 1; |
||||
EXEC SQL connect to REGRESSDB1; |
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("connect error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
|
||||
EXEC SQL create table empl |
||||
(idnum integer, name char (20), accs smallint); |
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("create error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
|
||||
EXEC SQL insert into empl values (1, 'first user', 320); |
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("insert error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
|
||||
EXEC SQL select idnum, name, accs |
||||
into :empl |
||||
from empl |
||||
where idnum =:empl.idnum; |
||||
if (sqlca.sqlcode) |
||||
{ |
||||
printf ("select error = %ld\n", sqlca.sqlcode); |
||||
exit (sqlca.sqlcode); |
||||
} |
||||
printf ("id=%ld name=%s, accs=%d\n", empl.idnum, empl.name, empl.accs); |
||||
|
||||
EXEC SQL disconnect; |
||||
exit (0); |
||||
} |
@ -0,0 +1,100 @@ |
||||
exec sql include sqlca; |
||||
|
||||
enum e { ENUM0, ENUM1 }; |
||||
struct sa { int member; }; |
||||
|
||||
static int fa(void) |
||||
{ |
||||
printf("in fa\n"); |
||||
return 2; |
||||
} |
||||
|
||||
static int |
||||
fb(int x) |
||||
{ |
||||
printf("in fb (%d)\n", x); |
||||
return x; |
||||
} |
||||
|
||||
static int |
||||
fc(const char *x) |
||||
{ |
||||
printf("in fc (%s)\n", x); |
||||
return *x; |
||||
} |
||||
|
||||
static int fd(const char *x,int i) |
||||
{ |
||||
printf("in fd (%s, %d)\n", x, i); |
||||
return (*x)*i; |
||||
} |
||||
|
||||
static int fe(enum e x) |
||||
{ |
||||
printf("in fe (%d)\n", (int) x); |
||||
return (int)x; |
||||
} |
||||
|
||||
static void sqlnotice(char *notice, short trans) |
||||
{ |
||||
if (!notice) |
||||
notice = "-empty-"; |
||||
printf("in sqlnotice (%s, %d)\n", notice, trans); |
||||
} |
||||
|
||||
exec sql define NONO 0; |
||||
|
||||
#define YES 1 |
||||
|
||||
#ifdef _cplusplus |
||||
namespace N |
||||
{ |
||||
static const int i=2; |
||||
}; |
||||
#endif |
||||
|
||||
int main(void) |
||||
{ |
||||
struct sa x = { 14 },*y = &x; |
||||
exec sql begin declare section; |
||||
int a=(int)2; |
||||
int b=2+2; |
||||
int b2=(14*7); |
||||
int d=x.member; |
||||
int g=fb(2); |
||||
int i=3^1; |
||||
int j=1?1:2; |
||||
|
||||
int e=y->member; |
||||
int c=10>>2; |
||||
bool h=2||1; |
||||
long iay /* = 1L */ ; |
||||
exec sql end declare section; |
||||
|
||||
int f=fa(); |
||||
|
||||
#ifdef _cplusplus |
||||
exec sql begin declare section; |
||||
int k=N::i; /* compile error */ |
||||
exec sql end declare section; |
||||
#endif |
||||
|
||||
ECPGdebug(1, stderr); |
||||
|
||||
printf("%d %d %d %d %d %d %d %d %d %d %d\n", a, b, b2, c, d, e, f, g, h, i, j); |
||||
iay = 0; |
||||
printf("%ld\n", iay); |
||||
exec sql whenever sqlerror do fa(); |
||||
exec sql select now(); |
||||
exec sql whenever sqlerror do fb(20); |
||||
exec sql select now(); |
||||
exec sql whenever sqlerror do fc("50"); |
||||
exec sql select now(); |
||||
exec sql whenever sqlerror do fd("50",1); |
||||
exec sql select now(); |
||||
exec sql whenever sqlerror do fe(ENUM0); |
||||
exec sql select now(); |
||||
exec sql whenever sqlerror do sqlnotice(NULL, NONO); |
||||
exec sql select now(); |
||||
return 0; |
||||
} |
Loading…
Reference in new issue