Skip to content

Commit 84844ba

Browse files
author
Michael Meskes
committed
More SoC stuff
1 parent fb9e56e commit 84844ba

18 files changed

+308
-240
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,5 +2103,9 @@ Fr 18. Aug 17:32:54 CEST 2006
21032103
- Synced parser and keyword list.
21042104
- Fixed parsing of CONNECT statement so it accepts a C string again.
21052105
- Fixed a buffer overrun that was masked on Linux systems.
2106+
2107+
Sa 19. Aug 14:11:32 CEST 2006
2108+
2109+
- More SoC stuff.
21062110
- Set ecpg library version to 5.2.
21072111
- Set ecpg version to 4.2.1.

src/interfaces/ecpg/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ clean distclean maintainer-clean:
1818
-$(MAKE) -C preproc $@
1919
-$(MAKE) -C test clean
2020

21-
check checktcp: all
21+
check checktcp installcheck: all
2222
$(MAKE) -C test $@

src/interfaces/ecpg/test/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.57 2006/08/08 19:43:11 tgl Exp $
1+
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.58 2006/08/19 13:42:40 meskes Exp $
22

33
subdir = src/interfaces/ecpg/test
44
top_builddir = ../../../..
@@ -61,3 +61,5 @@ check: all pg_regress.inc.sh
6161
checktcp: all pg_regress.inc.sh
6262
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) --listen-on-tcp
6363

64+
installcheck: all pg_regress.inc.sh
65+
sh ./pg_regress.sh --dbname=regress1 --debug --top-builddir=$(top_builddir) --load-language=plpgsql $(NOLOCALE)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ int main(void)
6363
EXEC SQL connect to :dbname;
6464
sql_check("main", "connect", 0);
6565

66+
EXEC SQL SET DateStyle TO 'DMY';
67+
6668
EXEC SQL create table history (customerid integer, timestamp timestamp without time zone, action_taken char(5), narrative varchar(100));
6769
sql_check("main", "create", 0);
6870

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

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -179,29 +179,36 @@ if (sqlca.sqlcode < 0) sqlprint();}
179179

180180
sql_check("main", "connect", 0);
181181

182-
{ ECPGdo(__LINE__, 1, 1, NULL, "create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) ", ECPGt_EOIT, ECPGt_EORT);
182+
{ ECPGdo(__LINE__, 1, 1, NULL, "set DateStyle to 'DMY'", ECPGt_EOIT, ECPGt_EORT);
183183
#line 66 "test_informix2.pgc"
184184

185185
if (sqlca.sqlcode < 0) sqlprint();}
186186
#line 66 "test_informix2.pgc"
187187

188+
189+
{ ECPGdo(__LINE__, 1, 1, NULL, "create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) ", ECPGt_EOIT, ECPGt_EORT);
190+
#line 68 "test_informix2.pgc"
191+
192+
if (sqlca.sqlcode < 0) sqlprint();}
193+
#line 68 "test_informix2.pgc"
194+
188195
sql_check("main", "create", 0);
189196

190197
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into history ( customerid , timestamp , action_taken , narrative ) values( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' )", ECPGt_EOIT, ECPGt_EORT);
191-
#line 71 "test_informix2.pgc"
198+
#line 73 "test_informix2.pgc"
192199

193200
if (sqlca.sqlcode < 0) sqlprint();}
194-
#line 71 "test_informix2.pgc"
201+
#line 73 "test_informix2.pgc"
195202

196203
sql_check("main", "insert", 0);
197204

198205
{ ECPGdo(__LINE__, 1, 1, NULL, "select max ( timestamp ) from history ", ECPGt_EOIT,
199206
ECPGt_timestamp,&(maxd),(long)1,(long)1,sizeof(timestamp),
200207
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
201-
#line 76 "test_informix2.pgc"
208+
#line 78 "test_informix2.pgc"
202209

203210
if (sqlca.sqlcode < 0) sqlprint();}
204-
#line 76 "test_informix2.pgc"
211+
#line 78 "test_informix2.pgc"
205212

206213
sql_check("main", "select max", 100);
207214

@@ -212,10 +219,10 @@ if (sqlca.sqlcode < 0) sqlprint();}
212219
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
213220
ECPGt_timestamp,&(d),(long)1,(long)1,sizeof(timestamp),
214221
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
215-
#line 83 "test_informix2.pgc"
222+
#line 85 "test_informix2.pgc"
216223

217224
if (sqlca.sqlcode < 0) sqlprint();}
218-
#line 83 "test_informix2.pgc"
225+
#line 85 "test_informix2.pgc"
219226

220227
sql_check("main", "select", 0);
221228

@@ -231,40 +238,40 @@ if (sqlca.sqlcode < 0) sqlprint();}
231238
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
232239
ECPGt_timestamp,&(e),(long)1,(long)1,sizeof(timestamp),
233240
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
234-
#line 95 "test_informix2.pgc"
241+
#line 97 "test_informix2.pgc"
235242

236243
if (sqlca.sqlcode < 0) sqlprint();}
237-
#line 95 "test_informix2.pgc"
244+
#line 97 "test_informix2.pgc"
238245

239246
sql_check("main", "update", 0);
240247

241248
{ ECPGtrans(__LINE__, NULL, "commit");
242-
#line 98 "test_informix2.pgc"
249+
#line 100 "test_informix2.pgc"
243250

244251
if (sqlca.sqlcode < 0) sqlprint();}
245-
#line 98 "test_informix2.pgc"
252+
#line 100 "test_informix2.pgc"
246253

247254

248255
{ ECPGdo(__LINE__, 1, 1, NULL, "drop table history ", ECPGt_EOIT, ECPGt_EORT);
249-
#line 100 "test_informix2.pgc"
256+
#line 102 "test_informix2.pgc"
250257

251258
if (sqlca.sqlcode < 0) sqlprint();}
252-
#line 100 "test_informix2.pgc"
259+
#line 102 "test_informix2.pgc"
253260

254261
sql_check("main", "drop", 0);
255262

256263
{ ECPGtrans(__LINE__, NULL, "commit");
257-
#line 103 "test_informix2.pgc"
264+
#line 105 "test_informix2.pgc"
258265

259266
if (sqlca.sqlcode < 0) sqlprint();}
260-
#line 103 "test_informix2.pgc"
267+
#line 105 "test_informix2.pgc"
261268

262269

263270
{ ECPGdisconnect(__LINE__, "CURRENT");
264-
#line 105 "test_informix2.pgc"
271+
#line 107 "test_informix2.pgc"
265272

266273
if (sqlca.sqlcode < 0) sqlprint();}
267-
#line 105 "test_informix2.pgc"
274+
#line 107 "test_informix2.pgc"
268275

269276
sql_check("main", "disconnect", 0);
270277

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

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,43 @@
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 line 66: 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 line 66: QUERY: set DateStyle to 'DMY' on connection regress1
66
[NO_PID]: sqlca: code: 0, state: 00000
7-
[NO_PID]: ECPGexecute line 66 Ok: CREATE TABLE
7+
[NO_PID]: ECPGexecute line 66 Ok: SET
88
[NO_PID]: sqlca: code: 0, state: 00000
9-
[NO_PID]: ECPGexecute line 69: 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 line 68: QUERY: create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) on connection regress1
1010
[NO_PID]: sqlca: code: 0, state: 00000
11-
[NO_PID]: ECPGexecute line 69 Ok: INSERT 0 1
11+
[NO_PID]: ECPGexecute line 68 Ok: CREATE TABLE
1212
[NO_PID]: sqlca: code: 0, state: 00000
13-
[NO_PID]: ECPGexecute line 74: QUERY: select max ( timestamp ) from history on connection regress1
13+
[NO_PID]: ECPGexecute line 71: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) on connection regress1
1414
[NO_PID]: sqlca: code: 0, state: 00000
15-
[NO_PID]: ECPGexecute line 74: Correctly got 1 tuples with 1 fields
15+
[NO_PID]: ECPGexecute line 71 Ok: INSERT 0 1
1616
[NO_PID]: sqlca: code: 0, state: 00000
17-
[NO_PID]: ECPGget_data line 74: RESULT: Wed May 07 13:28:34 2003 offset: -1 array: Yes
17+
[NO_PID]: ECPGexecute line 76: QUERY: select max ( timestamp ) from history on connection regress1
1818
[NO_PID]: sqlca: code: 0, state: 00000
19-
[NO_PID]: ECPGexecute line 79: QUERY: select customerid , timestamp from history where timestamp = timestamp '2003-05-07 13:28:34' limit 1 on connection regress1
19+
[NO_PID]: ECPGexecute line 76: Correctly got 1 tuples with 1 fields
2020
[NO_PID]: sqlca: code: 0, state: 00000
21-
[NO_PID]: ECPGexecute line 79: Correctly got 1 tuples with 2 fields
21+
[NO_PID]: ECPGget_data line 76: RESULT: Wed 07 May 13:28:34 2003 offset: -1 array: Yes
2222
[NO_PID]: sqlca: code: 0, state: 00000
23-
[NO_PID]: ECPGget_data line 79: RESULT: 1 offset: -1 array: Yes
23+
[NO_PID]: ECPGexecute line 81: QUERY: select customerid , timestamp from history where timestamp = timestamp '2003-05-07 13:28:34' limit 1 on connection regress1
2424
[NO_PID]: sqlca: code: 0, state: 00000
25-
[NO_PID]: ECPGget_data line 79: RESULT: Wed May 07 13:28:34 2003 offset: -1 array: Yes
25+
[NO_PID]: ECPGexecute line 81: Correctly got 1 tuples with 2 fields
2626
[NO_PID]: sqlca: code: 0, state: 00000
27-
[NO_PID]: ECPGexecute line 93: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values( 2 , timestamp '2003-05-08 15:53:39' , 'test' , 'test' ) on connection regress1
27+
[NO_PID]: ECPGget_data line 81: RESULT: 1 offset: -1 array: Yes
2828
[NO_PID]: sqlca: code: 0, state: 00000
29-
[NO_PID]: ECPGexecute line 93 Ok: INSERT 0 1
29+
[NO_PID]: ECPGget_data line 81: RESULT: Wed 07 May 13:28:34 2003 offset: -1 array: Yes
3030
[NO_PID]: sqlca: code: 0, state: 00000
31-
[NO_PID]: ECPGtrans line 98 action = commit connection = regress1
31+
[NO_PID]: ECPGexecute line 95: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values( 2 , timestamp '2003-05-08 15:53:39' , 'test' , 'test' ) on connection regress1
3232
[NO_PID]: sqlca: code: 0, state: 00000
33-
[NO_PID]: ECPGexecute line 100: QUERY: drop table history on connection regress1
33+
[NO_PID]: ECPGexecute line 95 Ok: INSERT 0 1
3434
[NO_PID]: sqlca: code: 0, state: 00000
35-
[NO_PID]: ECPGexecute line 100 Ok: DROP TABLE
35+
[NO_PID]: ECPGtrans line 100 action = commit connection = regress1
3636
[NO_PID]: sqlca: code: 0, state: 00000
37-
[NO_PID]: ECPGtrans line 103 action = commit connection = regress1
37+
[NO_PID]: ECPGexecute line 102: QUERY: drop table history on connection regress1
38+
[NO_PID]: sqlca: code: 0, state: 00000
39+
[NO_PID]: ECPGexecute line 102 Ok: DROP TABLE
40+
[NO_PID]: sqlca: code: 0, state: 00000
41+
[NO_PID]: ECPGtrans line 105 action = commit connection = regress1
3842
[NO_PID]: sqlca: code: 0, state: 00000
3943
[NO_PID]: ecpg_finish: Connection regress1 closed.
4044
[NO_PID]: sqlca: code: 0, state: 00000

src/interfaces/ecpg/test/expected/sql-dynalloc.c

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -177,112 +177,119 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
177177
#line 33 "dynalloc.pgc"
178178

179179

180-
{ ECPGdo(__LINE__, 0, 1, NULL, "create table test ( a serial , b numeric ( 12 , 3 ) , c varchar , d varchar ( 3 ) , e char ( 4 ) , f timestamptz , g boolean , h box , i inet ) ", ECPGt_EOIT, ECPGt_EORT);
180+
{ ECPGdo(__LINE__, 0, 1, NULL, "set datestyle to mdy", ECPGt_EOIT, ECPGt_EORT);
181181
#line 35 "dynalloc.pgc"
182182

183183
if (sqlca.sqlcode < 0) sqlprint ( );}
184184
#line 35 "dynalloc.pgc"
185185

186+
187+
{ ECPGdo(__LINE__, 0, 1, NULL, "create table test ( a serial , b numeric ( 12 , 3 ) , c varchar , d varchar ( 3 ) , e char ( 4 ) , f timestamptz , g boolean , h box , i inet ) ", ECPGt_EOIT, ECPGt_EORT);
188+
#line 37 "dynalloc.pgc"
189+
190+
if (sqlca.sqlcode < 0) sqlprint ( );}
191+
#line 37 "dynalloc.pgc"
192+
186193
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( b , c , d , e , f , g , h , i ) values( 23.456 , 'varchar' , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , true , '(1,2,3,4)' , '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128' )", ECPGt_EOIT, ECPGt_EORT);
187-
#line 36 "dynalloc.pgc"
194+
#line 38 "dynalloc.pgc"
188195

189196
if (sqlca.sqlcode < 0) sqlprint ( );}
190-
#line 36 "dynalloc.pgc"
197+
#line 38 "dynalloc.pgc"
191198

192199
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( b , c , d , e , f , g , h , i ) values( 2.446456 , null , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , false , null , null )", ECPGt_EOIT, ECPGt_EORT);
193-
#line 37 "dynalloc.pgc"
200+
#line 39 "dynalloc.pgc"
194201

195202
if (sqlca.sqlcode < 0) sqlprint ( );}
196-
#line 37 "dynalloc.pgc"
203+
#line 39 "dynalloc.pgc"
197204

198205

199206
ECPGallocate_desc(__LINE__, "mydesc");
200-
#line 39 "dynalloc.pgc"
207+
#line 41 "dynalloc.pgc"
201208

202209
if (sqlca.sqlcode < 0) sqlprint ( );
203-
#line 39 "dynalloc.pgc"
210+
#line 41 "dynalloc.pgc"
204211

205212
{ ECPGdo(__LINE__, 0, 1, NULL, "select a , b , c , d , e , f , g , h , i from test order by a", ECPGt_EOIT,
206213
ECPGt_descriptor, "mydesc", 0L, 0L, 0L,
207214
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
208-
#line 40 "dynalloc.pgc"
215+
#line 42 "dynalloc.pgc"
209216

210217
if (sqlca.sqlcode < 0) sqlprint ( );}
211-
#line 40 "dynalloc.pgc"
218+
#line 42 "dynalloc.pgc"
212219

213220
{ ECPGget_desc(__LINE__, "mydesc", 1,ECPGd_indicator,
214221
ECPGt_int,&(i1),(long)1,(long)0,sizeof(int), ECPGd_data,
215222
ECPGt_int,&(d1),(long)1,(long)0,sizeof(int), ECPGd_EODT);
216223

217-
#line 41 "dynalloc.pgc"
224+
#line 43 "dynalloc.pgc"
218225

219226
if (sqlca.sqlcode < 0) sqlprint ( );}
220-
#line 41 "dynalloc.pgc"
227+
#line 43 "dynalloc.pgc"
221228

222229
{ ECPGget_desc(__LINE__, "mydesc", 2,ECPGd_indicator,
223230
ECPGt_int,&(i2),(long)1,(long)0,sizeof(int), ECPGd_data,
224231
ECPGt_double,&(d2),(long)1,(long)0,sizeof(double), ECPGd_EODT);
225232

226-
#line 42 "dynalloc.pgc"
233+
#line 44 "dynalloc.pgc"
227234

228235
if (sqlca.sqlcode < 0) sqlprint ( );}
229-
#line 42 "dynalloc.pgc"
236+
#line 44 "dynalloc.pgc"
230237

231238
{ ECPGget_desc(__LINE__, "mydesc", 3,ECPGd_indicator,
232239
ECPGt_int,&(i3),(long)1,(long)0,sizeof(int), ECPGd_data,
233240
ECPGt_char,&(d3),(long)0,(long)0,(1)*sizeof(char), ECPGd_EODT);
234241

235-
#line 43 "dynalloc.pgc"
242+
#line 45 "dynalloc.pgc"
236243

237244
if (sqlca.sqlcode < 0) sqlprint ( );}
238-
#line 43 "dynalloc.pgc"
245+
#line 45 "dynalloc.pgc"
239246

240247
{ ECPGget_desc(__LINE__, "mydesc", 4,ECPGd_indicator,
241248
ECPGt_int,&(i4),(long)1,(long)0,sizeof(int), ECPGd_data,
242249
ECPGt_char,&(d4),(long)0,(long)0,(1)*sizeof(char), ECPGd_EODT);
243250

244-
#line 44 "dynalloc.pgc"
251+
#line 46 "dynalloc.pgc"
245252

246253
if (sqlca.sqlcode < 0) sqlprint ( );}
247-
#line 44 "dynalloc.pgc"
254+
#line 46 "dynalloc.pgc"
248255

249256
{ ECPGget_desc(__LINE__, "mydesc", 5,ECPGd_indicator,
250257
ECPGt_int,&(i5),(long)1,(long)0,sizeof(int), ECPGd_data,
251258
ECPGt_char,&(d5),(long)0,(long)0,(1)*sizeof(char), ECPGd_EODT);
252259

253-
#line 45 "dynalloc.pgc"
260+
#line 47 "dynalloc.pgc"
254261

255262
if (sqlca.sqlcode < 0) sqlprint ( );}
256-
#line 45 "dynalloc.pgc"
263+
#line 47 "dynalloc.pgc"
257264

258265
{ ECPGget_desc(__LINE__, "mydesc", 6,ECPGd_indicator,
259266
ECPGt_int,&(i6),(long)1,(long)0,sizeof(int), ECPGd_data,
260267
ECPGt_char,&(d6),(long)0,(long)0,(1)*sizeof(char), ECPGd_EODT);
261268

262-
#line 46 "dynalloc.pgc"
269+
#line 48 "dynalloc.pgc"
263270

264271
if (sqlca.sqlcode < 0) sqlprint ( );}
265-
#line 46 "dynalloc.pgc"
272+
#line 48 "dynalloc.pgc"
266273

267274
{ ECPGget_desc(__LINE__, "mydesc", 7,ECPGd_indicator,
268275
ECPGt_int,&(i7),(long)1,(long)0,sizeof(int), ECPGd_data,
269276
ECPGt_char,&(d7),(long)0,(long)0,(1)*sizeof(char), ECPGd_EODT);
270277

271-
#line 47 "dynalloc.pgc"
278+
#line 49 "dynalloc.pgc"
272279

273280
if (sqlca.sqlcode < 0) sqlprint ( );}
274-
#line 47 "dynalloc.pgc"
281+
#line 49 "dynalloc.pgc"
275282

276283
/* skip box for now */
277284
/* exec sql get descriptor mydesc value 8 :d8=DATA, :i8=INDICATOR; */
278285
{ ECPGget_desc(__LINE__, "mydesc", 9,ECPGd_indicator,
279286
ECPGt_int,&(i9),(long)1,(long)0,sizeof(int), ECPGd_data,
280287
ECPGt_char,&(d9),(long)0,(long)0,(1)*sizeof(char), ECPGd_EODT);
281288

282-
#line 50 "dynalloc.pgc"
289+
#line 52 "dynalloc.pgc"
283290

284291
if (sqlca.sqlcode < 0) sqlprint ( );}
285-
#line 50 "dynalloc.pgc"
292+
#line 52 "dynalloc.pgc"
286293

287294

288295
printf("Result:\n");
@@ -318,16 +325,16 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
318325
printf("\n");
319326

320327
ECPGdeallocate_desc(__LINE__, "mydesc");
321-
#line 84 "dynalloc.pgc"
328+
#line 86 "dynalloc.pgc"
322329

323330
if (sqlca.sqlcode < 0) sqlprint ( );
324-
#line 84 "dynalloc.pgc"
331+
#line 86 "dynalloc.pgc"
325332

326333
{ ECPGdisconnect(__LINE__, "CURRENT");
327-
#line 85 "dynalloc.pgc"
334+
#line 87 "dynalloc.pgc"
328335

329336
if (sqlca.sqlcode < 0) sqlprint ( );}
330-
#line 85 "dynalloc.pgc"
337+
#line 87 "dynalloc.pgc"
331338

332339
return 0;
333340
}

0 commit comments

Comments
 (0)