Added SET DATESTYLE to one test so the output format is defined.
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.35 2006/06/21 10:24:41 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.36 2006/09/26 07:56:56 meskes Exp $ */
#include "postgres_fe.h"
* reassemble to get a representation of local time.
*/
tmp = localtime(&mytime);
+ if (!tmp)
+ {
+ tm->tm_isdst = 0;
+ return 0;
+ }
day = (date2j(tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday) -
date2j(1970, 1, 1));
locsec = tmp->tm_sec + (tmp->tm_min + (day * HOURS_PER_DAY + tmp->tm_hour) * MINS_PER_HOUR) * SECS_PER_MINUTE;
mysec += delta1;
mytime = (time_t) mysec;
tmp = localtime(&mytime);
+ if (!tmp)
+ {
+ tm->tm_isdst = 0;
+ return 0;
+ }
day = (date2j(tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday) -
date2j(1970, 1, 1));
locsec = tmp->tm_sec + (tmp->tm_min + (day * HOURS_PER_DAY + tmp->tm_hour) * MINS_PER_HOUR) * SECS_PER_MINUTE;
mysec += (delta2 - delta1);
mytime = (time_t) mysec;
tmp = localtime(&mytime);
+ if (!tmp)
+ {
+ tm->tm_isdst = 0;
+ return 0;
+ }
day = (date2j(tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday) -
date2j(1970, 1, 1));
locsec = tmp->tm_sec + (tmp->tm_min + (day * HOURS_PER_DAY + tmp->tm_hour) * MINS_PER_HOUR) * SECS_PER_MINUTE;
exec sql include ../regression;
+
+/*
+
+NOTE: This file has a different expect file for regression tests on MinGW32
+
+*/
+
+
+
+
/*
TODO:
deccmp => DECUNKNOWN
#line 8 "dec_test.pgc"
+
+/*
+
+NOTE: This file has a different expect file for regression tests on MinGW32
+
+*/
+
+
+
+
/*
TODO:
deccmp => DECUNKNOWN
#line 6 "num_test.pgc"
+
+/*
+
+NOTE: This file has a different expect file for regression tests on MinGW32
+
+*/
+
+
int
main(void)
{
/* = {0, 0, 0, 0, 0, NULL, NULL} ; */
-#line 14 "num_test.pgc"
+#line 22 "num_test.pgc"
numeric * des ;
/* exec sql end declare section */
-#line 16 "num_test.pgc"
+#line 24 "num_test.pgc"
double d;
long l1, l2;
ECPGdebug(1, stderr);
/* exec sql whenever sqlerror do sqlprint ( ) ; */
-#line 22 "num_test.pgc"
+#line 30 "num_test.pgc"
{ ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , NULL, 0);
-#line 24 "num_test.pgc"
+#line 32 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
-#line 24 "num_test.pgc"
+#line 32 "num_test.pgc"
{ ECPGsetcommit(__LINE__, "off", NULL);
-#line 26 "num_test.pgc"
+#line 34 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
-#line 26 "num_test.pgc"
+#line 34 "num_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ) ", ECPGt_EOIT, ECPGt_EORT);
-#line 27 "num_test.pgc"
+#line 35 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
-#line 27 "num_test.pgc"
+#line 35 "num_test.pgc"
value1 = PGTYPESnumeric_new();
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( text , num ) values( 'test' , ? ) ",
ECPGt_numeric,&(des),(long)1,(long)0,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 52 "num_test.pgc"
+#line 60 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
-#line 52 "num_test.pgc"
+#line 60 "num_test.pgc"
value2 = PGTYPESnumeric_from_asc("2369.7", NULL);
{ ECPGdo(__LINE__, 0, 1, NULL, "select num from test where text = 'test' ", ECPGt_EOIT,
ECPGt_numeric,&(des),(long)1,(long)0,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
-#line 58 "num_test.pgc"
+#line 66 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
-#line 58 "num_test.pgc"
+#line 66 "num_test.pgc"
PGTYPESnumeric_mul(res, des, res);
PGTYPESnumeric_free(res);
{ ECPGtrans(__LINE__, NULL, "rollback");
-#line 82 "num_test.pgc"
+#line 90 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
-#line 82 "num_test.pgc"
+#line 90 "num_test.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");
-#line 83 "num_test.pgc"
+#line 91 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
-#line 83 "num_test.pgc"
+#line 91 "num_test.pgc"
return (0);
[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 26 action = off connection = regress1
+[NO_PID]: ECPGsetcommit line 34 action = off connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 27: QUERY: create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ) on connection regress1
+[NO_PID]: ECPGexecute line 35: QUERY: create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 27 Ok: CREATE TABLE
+[NO_PID]: ECPGexecute line 35 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 52: QUERY: insert into test ( text , num ) values( 'test' , 2369.7 ) on connection regress1
+[NO_PID]: ECPGexecute line 60: QUERY: insert into test ( text , num ) values ( 'test' , 2369.7 ) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1
+[NO_PID]: ECPGexecute line 60 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 58: QUERY: select num from test where text = 'test' on connection regress1
+[NO_PID]: ECPGexecute line 66: QUERY: select num from test where text = 'test' on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 58: Correctly got 1 tuples with 1 fields
+[NO_PID]: ECPGexecute line 66: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 58: RESULT: 2369.7000000 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 66: RESULT: 2369.7000000 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans line 82 action = rollback connection = regress1
+[NO_PID]: ECPGtrans line 90 action = rollback connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection regress1 closed.
[NO_PID]: sqlca: code: 0, state: 00000
#line 7 "num_test2.pgc"
+
+/*
+
+NOTE: This file has a different expect file for regression tests on MinGW32
+
+*/
+
+
char* nums[] = { "2E394", "-2", ".794", "3.44", "592.49E21", "-32.84e4",
"2E-394", ".1E-2", "+.0", "-592.49E-07", "+32.84e-4",
".500001", "-.5000001",
#line 43 "variable.pgc"
- strcpy(msg, "create");
- { ECPGdo(__LINE__, 0, 1, NULL, "create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ) ", ECPGt_EOIT, ECPGt_EORT);
+ strcpy(msg, "set");
+ { ECPGdo(__LINE__, 0, 1, NULL, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
#line 46 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 46 "variable.pgc"
- strcpy(msg, "insert");
- { ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
+ strcpy(msg, "create");
+ { ECPGdo(__LINE__, 0, 1, NULL, "create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ) ", ECPGt_EOIT, ECPGt_EORT);
#line 49 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 49 "variable.pgc"
+
+ strcpy(msg, "insert");
+ { ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
+#line 52 "variable.pgc"
+
+if (sqlca.sqlcode < 0) sqlprint();}
+#line 52 "variable.pgc"
+
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
-#line 50 "variable.pgc"
+#line 53 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 50 "variable.pgc"
+#line 53 "variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , age ) values ( 'Child 1' , 16 ) ", ECPGt_EOIT, ECPGt_EORT);
-#line 51 "variable.pgc"
+#line 54 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 51 "variable.pgc"
+#line 54 "variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , age ) values ( 'Child 2' , 14 ) ", ECPGt_EOIT, ECPGt_EORT);
-#line 52 "variable.pgc"
+#line 55 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 52 "variable.pgc"
+#line 55 "variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , age ) values ( 'Child 3' , 9 ) ", ECPGt_EOIT, ECPGt_EORT);
-#line 53 "variable.pgc"
+#line 56 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 53 "variable.pgc"
+#line 56 "variable.pgc"
strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit");
-#line 56 "variable.pgc"
+#line 59 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 56 "variable.pgc"
+#line 59 "variable.pgc"
strcpy(msg, "open");
{ ECPGdo(__LINE__, 0, 1, NULL, "declare cur cursor for select name , born , age , married , children from family ", ECPGt_EOIT, ECPGt_EORT);
-#line 59 "variable.pgc"
+#line 62 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 59 "variable.pgc"
+#line 62 "variable.pgc"
/* exec sql whenever not found break ; */
-#line 61 "variable.pgc"
+#line 64 "variable.pgc"
p=&personal;
ECPGt_long,&(ind_married),(long)1,(long)1,sizeof(long),
ECPGt_int,&(children.integer),(long)1,(long)1,sizeof(int),
ECPGt_short,&(ind_children.smallint),(long)1,(long)1,sizeof(short), ECPGt_EORT);
-#line 68 "variable.pgc"
+#line 71 "variable.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
-#line 68 "variable.pgc"
+#line 71 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 68 "variable.pgc"
+#line 71 "variable.pgc"
printf("%8.8s", personal.name.arr);
if (i->ind_birth.born >= 0)
strcpy(msg, "close");
{ ECPGdo(__LINE__, 0, 1, NULL, "close cur", ECPGt_EOIT, ECPGt_EORT);
-#line 85 "variable.pgc"
+#line 88 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 85 "variable.pgc"
+#line 88 "variable.pgc"
strcpy(msg, "drop");
{ ECPGdo(__LINE__, 0, 1, NULL, "drop table family ", ECPGt_EOIT, ECPGt_EORT);
-#line 88 "variable.pgc"
+#line 91 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 88 "variable.pgc"
+#line 91 "variable.pgc"
strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit");
-#line 91 "variable.pgc"
+#line 94 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 91 "variable.pgc"
+#line 94 "variable.pgc"
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
-#line 94 "variable.pgc"
+#line 97 "variable.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 94 "variable.pgc"
+#line 97 "variable.pgc"
return (0);
[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 46: QUERY: create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ) on connection regress1
+[NO_PID]: ECPGexecute line 46: QUERY: set datestyle to iso on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 46 Ok: CREATE TABLE
+[NO_PID]: ECPGexecute line 46 Ok: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 49: QUERY: insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ) on connection regress1
+[NO_PID]: ECPGexecute line 49: QUERY: create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 49 Ok: INSERT 0 1
+[NO_PID]: ECPGexecute line 49 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 50: QUERY: insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 ) on connection regress1
+[NO_PID]: ECPGexecute line 52: QUERY: insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 50 Ok: INSERT 0 1
+[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 51: QUERY: insert into family ( name , age ) values ( 'Child 1' , 16 ) on connection regress1
+[NO_PID]: ECPGexecute line 53: QUERY: insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 ) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 51 Ok: INSERT 0 1
+[NO_PID]: ECPGexecute line 53 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 52: QUERY: insert into family ( name , age ) values ( 'Child 2' , 14 ) on connection regress1
+[NO_PID]: ECPGexecute line 54: QUERY: insert into family ( name , age ) values ( 'Child 1' , 16 ) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1
+[NO_PID]: ECPGexecute line 54 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 53: QUERY: insert into family ( name , age ) values ( 'Child 3' , 9 ) on connection regress1
+[NO_PID]: ECPGexecute line 55: QUERY: insert into family ( name , age ) values ( 'Child 2' , 14 ) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 53 Ok: INSERT 0 1
+[NO_PID]: ECPGexecute line 55 Ok: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGexecute line 56: QUERY: insert into family ( name , age ) values ( 'Child 3' , 9 ) on connection regress1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGexecute line 56 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans line 56 action = commit connection = regress1
+[NO_PID]: ECPGtrans line 59 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 59: QUERY: declare cur cursor for select name , born , age , married , children from family on connection regress1
+[NO_PID]: ECPGexecute line 62: QUERY: declare cur cursor for select name , born , age , married , children from family on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 59 Ok: DECLARE CURSOR
+[NO_PID]: ECPGexecute line 62 Ok: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1
+[NO_PID]: ECPGexecute line 71: QUERY: fetch cur on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields
+[NO_PID]: ECPGexecute line 71: Correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: Mum offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: Mum offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples
+[NO_PID]: ECPGstore_result: line 71: allocating memory for 1 tuples
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 07-14-1987 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 1987-07-14 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 3 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 3 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1
+[NO_PID]: ECPGexecute line 71: QUERY: fetch cur on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields
+[NO_PID]: ECPGexecute line 71: Correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: Dad offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: Dad offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 19610721 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 19610721 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples
+[NO_PID]: ECPGstore_result: line 71: allocating memory for 1 tuples
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 07-14-1987 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 1987-07-14 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 3 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 3 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1
+[NO_PID]: ECPGexecute line 71: QUERY: fetch cur on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields
+[NO_PID]: ECPGexecute line 71: Correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: Child 1 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: Child 1 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 16 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 16 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples
+[NO_PID]: ECPGstore_result: line 71: allocating memory for 1 tuples
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1
+[NO_PID]: ECPGexecute line 71: QUERY: fetch cur on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields
+[NO_PID]: ECPGexecute line 71: Correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: Child 2 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: Child 2 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 14 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 14 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples
+[NO_PID]: ECPGstore_result: line 71: allocating memory for 1 tuples
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1
+[NO_PID]: ECPGexecute line 71: QUERY: fetch cur on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields
+[NO_PID]: ECPGexecute line 71: Correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: Child 3 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: Child 3 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: 9 offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: 9 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples
+[NO_PID]: ECPGstore_result: line 71: allocating memory for 1 tuples
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes
+[NO_PID]: ECPGget_data line 71: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1
+[NO_PID]: ECPGexecute line 71: QUERY: fetch cur on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 68: Correctly got 0 tuples with 5 fields
+[NO_PID]: ECPGexecute line 71: Correctly got 0 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlcode 100 in line 68, 'No data found in line 68.'.
+[NO_PID]: raising sqlcode 100 in line 71, 'No data found in line 71.'.
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ECPGexecute line 85: QUERY: close cur on connection regress1
+[NO_PID]: ECPGexecute line 88: QUERY: close cur on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 85 Ok: CLOSE CURSOR
+[NO_PID]: ECPGexecute line 88 Ok: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 88: QUERY: drop table family on connection regress1
+[NO_PID]: ECPGexecute line 91: QUERY: drop table family on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGexecute line 88 Ok: DROP TABLE
+[NO_PID]: ECPGexecute line 91 Ok: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans line 91 action = commit connection = regress1
+[NO_PID]: ECPGtrans line 94 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
-Mum , married 07-14-1987, children = 3
-Dad , born 19610721, married 07-14-1987, children = 3
+Mum , married 1987-07-14, children = 3
+Dad , born 19610721, married 1987-07-14, children = 3
Child 1 , age = 16
Child 2 , age = 14
Child 3 , age = 9
#! /bin/sh
-# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.14 2006/09/19 15:36:08 tgl Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.15 2006/09/26 07:56:56 meskes Exp $
me=`basename $0`
runprg=`echo $i | sed -e 's,\.pgc$,,'`
outprg=`echo $runprg | sed -e's/\//-/'`
+
+ case $host_platform in
+ *-*-mingw32*)
+ PLATFORM_TAG="-MinGW32"
+ ;;
+ esac
+
outfile_stderr="$outputdir/$outprg.stderr"
outfile_stdout="$outputdir/$outprg.stdout"
outfile_source="$outputdir/$outprg.c"
echo >> $f
echo "THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT" >> $f
echo >> $f
- cat $f.tmp | sed -e s,$PGPORT,55432,g >> $f
+ # MinGW could return such a line:
+ # "could not connect to server: Connection refused (0x0000274D/10061)"
+ cat $f.tmp | sed -e s,$PGPORT,55432,g | sed -e "s,could not connect to server: Connection refused (0x.*/.*),could not connect to server: Connection refused,g" >> $f
rm $f.tmp
done
fi
cat "$outfile_source.tmp" | sed -e 's,^\(#line [0-9]*\) ".*/\([^/]*\)",\1 "\2",' > "$outfile_source"
rm "$outfile_source.tmp"
+ expected_stderr="expected/$outprg$PLATFORM_TAG.stderr"
+ if [ ! -f "$expected_stderr" ]; then
+ expected_stderr="expected/$outprg.stderr"
+ fi
+ expected_stdout="expected/$outprg$PLATFORM_TAG.stdout"
+ if [ ! -f "$expected_stdout" ]; then
+ expected_stdout="expected/$outprg.stdout"
+ fi
+ # the source should be identical on all platforms
+ expected_source="expected/$outprg.c"
+
DIFFER=""
- diff $DIFFFLAGS expected/$outprg.stderr "$outfile_stderr" > /dev/null 2>&1
+ diff $DIFFFLAGS "$expected_stderr" "$outfile_stderr" > /dev/null 2>&1
if [ $? != 0 ]; then
DIFFER="$DIFFER, log"
- diff $DIFFPRETTYFLAGS expected/$outprg.stderr "$outfile_stderr" >> regression.diffs 2>&1
+ diff $DIFFPRETTYFLAGS "$expected_stderr" "$outfile_stderr" >> regression.diffs 2>&1
fi
- diff $DIFFFLAGS expected/$outprg.stdout "$outfile_stdout" > /dev/null 2>&1
+ diff $DIFFFLAGS "$expected_stdout" "$outfile_stdout" > /dev/null 2>&1
if [ $? != 0 ]; then
DIFFER="$DIFFER, output"
- diff $DIFFPRETTYFLAGS expected/$outprg.stdout "$outfile_stdout" >> regression.diffs 2>&1
+ diff $DIFFPRETTYFLAGS "$expected_stdout" "$outfile_stdout" >> regression.diffs 2>&1
fi
- diff $DIFFFLAGS expected/$outprg.c "$outputdir"/$outprg.c > /dev/null 2>&1
+ diff $DIFFFLAGS "$expected_source" "$outputdir"/$outprg.c > /dev/null 2>&1
if [ $? != 0 ]; then
DIFFER="$DIFFER, source"
- diff $DIFFPRETTYFLAGS expected/$outprg.c "$outputdir"/$outprg.c >> regression.diffs 2>&1
+ diff $DIFFPRETTYFLAGS "$expected_source" "$outputdir"/$outprg.c >> regression.diffs 2>&1
fi
DIFFER=`echo $DIFFER | sed -e 's/^, //'`
exec sql include ../regression;
+
+/*
+
+NOTE: This file has a different expect file for regression tests on MinGW32
+
+*/
+
+
int
main(void)
{
exec sql include ../regression;
+
+/*
+
+NOTE: This file has a different expect file for regression tests on MinGW32
+
+*/
+
+
char* nums[] = { "2E394", "-2", ".794", "3.44", "592.49E21", "-32.84e4",
"2E-394", ".1E-2", "+.0", "-592.49E-07", "+32.84e-4",
".500001", "-.5000001",
strcpy(msg, "connect");
exec sql connect to REGRESSDB1;
+ strcpy(msg, "set");
+ exec sql set datestyle to iso;
+
strcpy(msg, "create");
exec sql create table family(name char(8), born integer, age smallint, married date, children integer);