Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit27458bb

Browse files
author
Michael Meskes
committed
Applied test suite update by Joachim Wieland <joe@mcknight.de>.
1 parent961ec0c commit27458bb

27 files changed

+552
-354
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,5 +2064,9 @@ We Aug 2 13:15:25 CEST 2006
20642064
- Implemented EXEC SQL UNDEF.
20652065
- Applied first version of the regression test patch by Joachim
20662066
Wieland <joe@mcknight.de>.
2067+
2068+
Th Aug 3 14:45:06 CEST 2006
2069+
2070+
- Applied test suite update by Joachim Wieland <joe@mcknight.de>.
20672071
- Set ecpg library version to 5.2.
20682072
- Set ecpg version to 4.2.1.

‎src/interfaces/ecpg/test/compat_informix/test_informix2.pgc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ int main(void)
4848
EXEC SQL BEGIN DECLARE SECTION;
4949
int c;
5050
timestamp d;
51+
timestamp e;
5152
timestamp maxd;
5253
char dbname[30];
5354
EXEC SQL END DECLARE SECTION;
5455

56+
interval *intvl;
57+
5558
EXEC SQL whenever sqlerror sqlprint;
5659

5760
ECPGdebug(1, stderr);
@@ -91,17 +94,15 @@ int main(void)
9194
sql_check("main", "select", 0);
9295

9396
printf("Read in customer %d\n", c);
94-
95-
/* Adding 1 to d adds 1 second. So:
96-
60 1 minute
97-
3600 1 hour
98-
86400 1 day */
99-
d=d+86400;
97+
98+
intvl = PGTYPESinterval_from_asc("1 day 2 hours 24 minutes 65 seconds", NULL);
99+
PGTYPEStimestamp_add_interval(&d, intvl, &e);
100+
100101
c++;
101102

102103
EXEC SQL insert into history
103104
(customerid, timestamp, action_taken, narrative)
104-
values(:c, :d, 'test', 'test');
105+
values(:c, :e, 'test', 'test');
105106
sql_check("main", "update", 0);
106107

107108
EXEC SQL commit;

‎src/interfaces/ecpg/test/complex/header_test.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/test/complex/header_test.h,v 1.1 2006/08/02 14:14:02 meskes Exp $ */
2-
31
#include"stdlib.h"
42

53
staticvoid

‎src/interfaces/ecpg/test/complex/test5.pgc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ main (void)
9191

9292
EXEC SQL CLOSE B;
9393

94-
i=a.t[0];
95-
a.t[0]=a.t[1];
96-
a.t[1]=i;
97-
9894
printf ("name=%s, accs=%d byte=", empl.name, a.accs);
9995
for (i=0; i<20; i++)
10096
{

‎src/interfaces/ecpg/test/errors/init.pgc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ int main(void)
7373
long long iax /* = 40000000000LL */ ;
7474
exec sql end declare section;
7575

76-
ECPGdebug(1, stderr);
77-
7876
int f=fa();
7977

8078
#ifdef _cplusplus
@@ -83,6 +81,8 @@ int main(void)
8381
exec sql end declare section;
8482
#endif
8583

84+
ECPGdebug(1, stderr);
85+
8686
exec sql whenever sqlerror do fa();
8787
exec sql select now();
8888
exec sql whenever sqlerror do fb(20);

‎src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ int main(void)
142142

143143

144144

145+
145146

146147
#line 49 "test_informix2.pgc"
147148
intc ;
@@ -150,16 +151,21 @@ int main(void)
150151
timestampd ;
151152

152153
#line 51 "test_informix2.pgc"
153-
timestampmaxd ;
154+
timestampe ;
154155

155156
#line 52 "test_informix2.pgc"
157+
timestampmaxd ;
158+
159+
#line 53 "test_informix2.pgc"
156160
chardbname [30 ] ;
157161
/* exec sql end declare section */
158-
#line53 "test_informix2.pgc"
162+
#line54 "test_informix2.pgc"
159163

160164

165+
interval*intvl;
166+
161167
/* exec sql whenever sqlerror sqlprint ; */
162-
#line55 "test_informix2.pgc"
168+
#line58 "test_informix2.pgc"
163169

164170

165171
ECPGdebug(1,stderr);
@@ -170,36 +176,36 @@ int main(void)
170176
*/
171177
strcpy(dbname,"regress1");
172178
{ECPGconnect(__LINE__,1,dbname ,NULL,NULL ,NULL,0);
173-
#line64 "test_informix2.pgc"
179+
#line67 "test_informix2.pgc"
174180

175181
if (sqlca.sqlcode<0)sqlprint();}
176-
#line64 "test_informix2.pgc"
182+
#line67 "test_informix2.pgc"
177183

178184
sql_check("main","connect",0);
179185

180186
{ECPGdo(__LINE__,1,0,NULL,"create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) ",ECPGt_EOIT,ECPGt_EORT);
181-
#line67 "test_informix2.pgc"
187+
#line70 "test_informix2.pgc"
182188

183189
if (sqlca.sqlcode<0)sqlprint();}
184-
#line67 "test_informix2.pgc"
190+
#line70 "test_informix2.pgc"
185191

186192
sql_check("main","create",0);
187193

188194
{ECPGdo(__LINE__,1,0,NULL,"insert into history ( customerid , timestamp , action_taken , narrative ) values( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' )",ECPGt_EOIT,ECPGt_EORT);
189-
#line72 "test_informix2.pgc"
195+
#line75 "test_informix2.pgc"
190196

191197
if (sqlca.sqlcode<0)sqlprint();}
192-
#line72 "test_informix2.pgc"
198+
#line75 "test_informix2.pgc"
193199

194200
sql_check("main","insert",0);
195201

196202
{ECPGdo(__LINE__,1,0,NULL,"select max ( timestamp ) from history ",ECPGt_EOIT,
197203
ECPGt_timestamp,&(maxd),(long)1,(long)1,sizeof(timestamp),
198204
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
199-
#line77 "test_informix2.pgc"
205+
#line80 "test_informix2.pgc"
200206

201207
if (sqlca.sqlcode<0)sqlprint();}
202-
#line77 "test_informix2.pgc"
208+
#line80 "test_informix2.pgc"
203209

204210
sql_check("main","select max",100);
205211

@@ -216,61 +222,59 @@ if (sqlca.sqlcode < 0) sqlprint();}
216222
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
217223
ECPGt_timestamp,&(d),(long)1,(long)1,sizeof(timestamp),
218224
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
219-
#line90 "test_informix2.pgc"
225+
#line93 "test_informix2.pgc"
220226

221227
if (sqlca.sqlcode<0)sqlprint();}
222-
#line90 "test_informix2.pgc"
228+
#line93 "test_informix2.pgc"
223229

224230
sql_check("main","select",0);
225231

226232
printf("Read in customer %d\n",c);
227-
228-
/* Adding 1 to d adds 1 second. So:
229-
60 1 minute
230-
3600 1 hour
231-
86400 1 day */
232-
d=d+86400;
233+
234+
intvl=PGTYPESinterval_from_asc("1 day 2 hours 24 minutes 65 seconds",NULL);
235+
PGTYPEStimestamp_add_interval(&d,intvl,&e);
236+
233237
c++;
234238

235239
{ECPGdo(__LINE__,1,0,NULL,"insert into history ( customerid , timestamp , action_taken , narrative ) values( ? , ? , 'test' , 'test' )",
236240
ECPGt_int,&(c),(long)1,(long)1,sizeof(int),
237241
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
238-
ECPGt_timestamp,&(d),(long)1,(long)1,sizeof(timestamp),
242+
ECPGt_timestamp,&(e),(long)1,(long)1,sizeof(timestamp),
239243
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
240-
#line104 "test_informix2.pgc"
244+
#line105 "test_informix2.pgc"
241245

242246
if (sqlca.sqlcode<0)sqlprint();}
243-
#line104 "test_informix2.pgc"
247+
#line105 "test_informix2.pgc"
244248

245249
sql_check("main","update",0);
246250

247251
{ECPGtrans(__LINE__,NULL,"commit");
248-
#line107 "test_informix2.pgc"
252+
#line108 "test_informix2.pgc"
249253

250254
if (sqlca.sqlcode<0)sqlprint();}
251-
#line107 "test_informix2.pgc"
255+
#line108 "test_informix2.pgc"
252256

253257

254258
{ECPGdo(__LINE__,1,0,NULL,"drop table history ",ECPGt_EOIT,ECPGt_EORT);
255-
#line109 "test_informix2.pgc"
259+
#line110 "test_informix2.pgc"
256260

257261
if (sqlca.sqlcode<0)sqlprint();}
258-
#line109 "test_informix2.pgc"
262+
#line110 "test_informix2.pgc"
259263

260264
sql_check("main","drop",0);
261265

262266
{ECPGtrans(__LINE__,NULL,"commit");
263-
#line112 "test_informix2.pgc"
267+
#line113 "test_informix2.pgc"
264268

265269
if (sqlca.sqlcode<0)sqlprint();}
266-
#line112 "test_informix2.pgc"
270+
#line113 "test_informix2.pgc"
267271

268272

269273
{ECPGdisconnect(__LINE__,"CURRENT");
270-
#line114 "test_informix2.pgc"
274+
#line115 "test_informix2.pgc"
271275

272276
if (sqlca.sqlcode<0)sqlprint();}
273-
#line114 "test_informix2.pgc"
277+
#line115 "test_informix2.pgc"
274278

275279
sql_check("main","disconnect",0);
276280

‎src/interfaces/ecpg/test/expected/compat_informix-test_informix2.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22
[NO_PID]: sqlca: code: 0, state: 00000
33
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
44
[NO_PID]: sqlca: code: 0, state: 00000
5-
[NO_PID]: ECPGexecute line67: QUERY: create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) on connection regress1
5+
[NO_PID]: ECPGexecute line70: QUERY: create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) on connection regress1
66
[NO_PID]: sqlca: code: 0, state: 00000
7-
[NO_PID]: ECPGexecute line67 Ok: CREATE TABLE
7+
[NO_PID]: ECPGexecute line70 Ok: CREATE TABLE
88
[NO_PID]: sqlca: code: 0, state: 00000
9-
[NO_PID]: ECPGexecute line70: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) on connection regress1
9+
[NO_PID]: ECPGexecute line73: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) on connection regress1
1010
[NO_PID]: sqlca: code: 0, state: 00000
11-
[NO_PID]: ECPGexecute line70 Ok: INSERT 0 1
11+
[NO_PID]: ECPGexecute line73 Ok: INSERT 0 1
1212
[NO_PID]: sqlca: code: 0, state: 00000
13-
[NO_PID]: ECPGexecute line75: QUERY: select max ( timestamp ) from history on connection regress1
13+
[NO_PID]: ECPGexecute line78: QUERY: select max ( timestamp ) from history on connection regress1
1414
[NO_PID]: sqlca: code: 0, state: 00000
15-
[NO_PID]: ECPGexecute line75: Correctly got 1 tuples with 1 fields
15+
[NO_PID]: ECPGexecute line78: Correctly got 1 tuples with 1 fields
1616
[NO_PID]: sqlca: code: 0, state: 00000
17-
[NO_PID]: ECPGget_data line75: RESULT: Wed May 07 13:28:34 2003 offset: 8 array: Yes
17+
[NO_PID]: ECPGget_data line78: RESULT: Wed May 07 13:28:34 2003 offset: 8 array: Yes
1818
[NO_PID]: sqlca: code: 0, state: 00000
19-
[NO_PID]: ECPGexecute line86: QUERY: select customerid , timestamp from history where timestamp = timestamp '2003-05-07 13:28:34' limit 1 on connection regress1
19+
[NO_PID]: ECPGexecute line89: QUERY: select customerid , timestamp from history where timestamp = timestamp '2003-05-07 13:28:34' limit 1 on connection regress1
2020
[NO_PID]: sqlca: code: 0, state: 00000
21-
[NO_PID]: ECPGexecute line86: Correctly got 1 tuples with 2 fields
21+
[NO_PID]: ECPGexecute line89: Correctly got 1 tuples with 2 fields
2222
[NO_PID]: sqlca: code: 0, state: 00000
23-
[NO_PID]: ECPGget_data line86: RESULT: 1 offset: 4 array: Yes
23+
[NO_PID]: ECPGget_data line89: RESULT: 1 offset: 4 array: Yes
2424
[NO_PID]: sqlca: code: 0, state: 00000
25-
[NO_PID]: ECPGget_data line86: RESULT: Wed May 07 13:28:34 2003 offset: 8 array: Yes
25+
[NO_PID]: ECPGget_data line89: RESULT: Wed May 07 13:28:34 2003 offset: 8 array: Yes
2626
[NO_PID]: sqlca: code: 0, state: 00000
27-
[NO_PID]: ECPGexecute line102: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values( 2 , timestamp '2003-05-0813:28:34' , 'test' , 'test' ) on connection regress1
27+
[NO_PID]: ECPGexecute line103: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values( 2 , timestamp '2003-05-0815:53:39' , 'test' , 'test' ) on connection regress1
2828
[NO_PID]: sqlca: code: 0, state: 00000
29-
[NO_PID]: ECPGexecute line102 Ok: INSERT 0 1
29+
[NO_PID]: ECPGexecute line103 Ok: INSERT 0 1
3030
[NO_PID]: sqlca: code: 0, state: 00000
31-
[NO_PID]: ECPGtrans line107 action = commit connection = regress1
31+
[NO_PID]: ECPGtrans line108 action = commit connection = regress1
3232
[NO_PID]: sqlca: code: 0, state: 00000
33-
[NO_PID]: ECPGexecute line109: QUERY: drop table history on connection regress1
33+
[NO_PID]: ECPGexecute line110: QUERY: drop table history on connection regress1
3434
[NO_PID]: sqlca: code: 0, state: 00000
35-
[NO_PID]: ECPGexecute line109 Ok: DROP TABLE
35+
[NO_PID]: ECPGexecute line110 Ok: DROP TABLE
3636
[NO_PID]: sqlca: code: 0, state: 00000
37-
[NO_PID]: ECPGtrans line112 action = commit connection = regress1
37+
[NO_PID]: ECPGtrans line113 action = commit connection = regress1
3838
[NO_PID]: sqlca: code: 0, state: 00000
3939
[NO_PID]: ecpg_finish: Connection regress1 closed.
4040
[NO_PID]: sqlca: code: 0, state: 00000

‎src/interfaces/ecpg/test/expected/complex-test2.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313

1414
#line 1 "./header_test.h"
15-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/test/expected/complex-test2.c,v 1.1 2006/08/02 14:14:02 meskes Exp $ */
16-
1715
#include"stdlib.h"
1816

1917
staticvoid
@@ -24,19 +22,19 @@ Finish(char *msg)
2422

2523
/* finish transaction */
2624
{ECPGtrans(__LINE__,NULL,"rollback");}
27-
#line12 "./header_test.h"
25+
#line10 "./header_test.h"
2826

2927

3028
/* and remove test table */
3129
{ECPGdo(__LINE__,0,1,NULL,"drop table meskes ",ECPGt_EOIT,ECPGt_EORT);}
32-
#line15 "./header_test.h"
30+
#line13 "./header_test.h"
3331

3432
{ECPGtrans(__LINE__,NULL,"commit");}
35-
#line16 "./header_test.h"
33+
#line14 "./header_test.h"
3634

3735

3836
{ECPGdisconnect(__LINE__,"CURRENT");}
39-
#line18 "./header_test.h"
37+
#line16 "./header_test.h"
4038

4139

4240
exit(-1);
@@ -49,10 +47,10 @@ warn(void)
4947
}
5048

5149
/* exec sql whenever sqlerror do Finish ( msg ) ; */
52-
#line31 "./header_test.h"
50+
#line29 "./header_test.h"
5351

5452
/* exec sql whenever sql_warning do warn ( ) ; */
55-
#line34 "./header_test.h"
53+
#line32 "./header_test.h"
5654

5755

5856
#line 4 "test2.pgc"

‎src/interfaces/ecpg/test/expected/complex-test3.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
/*--------------------------------------------------------------------------*/
1313

1414
#line 1 "./header_test.h"
15-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/test/expected/complex-test3.c,v 1.1 2006/08/02 14:14:02 meskes Exp $ */
16-
1715
#include"stdlib.h"
1816

1917
staticvoid
@@ -24,19 +22,19 @@ Finish(char *msg)
2422

2523
/* finish transaction */
2624
{ECPGtrans(__LINE__,NULL,"rollback");}
27-
#line12 "./header_test.h"
25+
#line10 "./header_test.h"
2826

2927

3028
/* and remove test table */
3129
{ECPGdo(__LINE__,0,1,NULL,"drop table meskes ",ECPGt_EOIT,ECPGt_EORT);}
32-
#line15 "./header_test.h"
30+
#line13 "./header_test.h"
3331

3432
{ECPGtrans(__LINE__,NULL,"commit");}
35-
#line16 "./header_test.h"
33+
#line14 "./header_test.h"
3634

3735

3836
{ECPGdisconnect(__LINE__,"CURRENT");}
39-
#line18 "./header_test.h"
37+
#line16 "./header_test.h"
4038

4139

4240
exit(-1);
@@ -49,10 +47,10 @@ warn(void)
4947
}
5048

5149
/* exec sql whenever sqlerror do Finish ( msg ) ; */
52-
#line31 "./header_test.h"
50+
#line29 "./header_test.h"
5351

5452
/* exec sql whenever sql_warning do warn ( ) ; */
55-
#line34 "./header_test.h"
53+
#line32 "./header_test.h"
5654

5755

5856
#line 4 "test3.pgc"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp