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

Commit803d9c3

Browse files
author
Michael Meskes
committed
Changing a test case also changes the output that is expected.
Float/Long aliasing doesn't work on all architecures.
1 parent1d1868d commit803d9c3

File tree

5 files changed

+151
-157
lines changed

5 files changed

+151
-157
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ exec sql begin declare section;
3232
exec sql end declare section;
3333

3434
exec sql char *married = NULL;
35-
exec sqlfloat ind_married;
35+
exec sqllong ind_married;
3636
exec sql ind children;
3737

38-
exec sql var ind_married is long;
39-
4038
char msg[128];
4139

4240
ECPGdebug(1, stderr);
@@ -73,7 +71,7 @@ exec sql end declare section;
7371
printf(", born %ld", personal.birth.born);
7472
if (i->ind_birth.age >= 0)
7573
printf(", age = %d", personal.birth.age);
76-
if ((long)ind_married >= 0)
74+
if (ind_married >= 0)
7775
printf(", married %s", married);
7876
if (ind_children.smallint >= 0)
7977
printf(", children = %d", children.integer);
@@ -103,7 +101,7 @@ exec sql end declare section;
103101
printf(", born %ld", personal.birth.born);
104102
if (ind_personal.ind_birth.age >= 0)
105103
printf(", age = %d", personal.birth.age);
106-
if ((long)ind_married >= 0)
104+
if (ind_married >= 0)
107105
printf(", married %s", married);
108106
if (ind_children.smallint >= 0)
109107
printf(", children = %d", children.integer);

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

Lines changed: 67 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ main (void)
148148

149149

150150
#line 35 "test2.pgc"
151-
floatind_married ;
151+
longind_married ;
152152

153153
#line 35 "test2.pgc"
154154

@@ -159,107 +159,103 @@ main (void)
159159
#line 36 "test2.pgc"
160160

161161

162-
/* exec sql var ind_married is long */
163-
#line 38 "test2.pgc"
164-
165-
166162
charmsg[128];
167163

168164
ECPGdebug(1,stderr);
169165

170166
strcpy(msg,"connect");
171167
{ECPGconnect(__LINE__,0,"regress1" ,NULL,NULL ,NULL,0);
172-
#line45 "test2.pgc"
168+
#line43 "test2.pgc"
173169

174170
if (sqlca.sqlwarn[0]=='W')warn ( );
175-
#line45 "test2.pgc"
171+
#line43 "test2.pgc"
176172

177173
if (sqlca.sqlcode<0)Finish (msg );}
178-
#line45 "test2.pgc"
174+
#line43 "test2.pgc"
179175

180176

181177
strcpy(msg,"create");
182178
{ECPGdo(__LINE__,0,1,NULL,"create table meskes ( name char ( 8 ) , born integer , age smallint , married date , children integer ) ",ECPGt_EOIT,ECPGt_EORT);
183-
#line48 "test2.pgc"
179+
#line46 "test2.pgc"
184180

185181
if (sqlca.sqlwarn[0]=='W')warn ( );
186-
#line48 "test2.pgc"
182+
#line46 "test2.pgc"
187183

188184
if (sqlca.sqlcode<0)Finish (msg );}
189-
#line48 "test2.pgc"
185+
#line46 "test2.pgc"
190186

191187

192188
strcpy(msg,"insert");
193-
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , married , children ) values( 'Petra' , '19900404' , 3 ) ",ECPGt_EOIT,ECPGt_EORT);
194-
#line51 "test2.pgc"
189+
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , married , children ) values( 'Petra' , '19900404' , 3 ) ",ECPGt_EOIT,ECPGt_EORT);
190+
#line49 "test2.pgc"
195191

196192
if (sqlca.sqlwarn[0]=='W')warn ( );
197-
#line51 "test2.pgc"
193+
#line49 "test2.pgc"
198194

199195
if (sqlca.sqlcode<0)Finish (msg );}
200-
#line51 "test2.pgc"
196+
#line49 "test2.pgc"
201197

202-
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 ) ",ECPGt_EOIT,ECPGt_EORT);
203-
#line52 "test2.pgc"
198+
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 ) ",ECPGt_EOIT,ECPGt_EORT);
199+
#line50 "test2.pgc"
204200

205201
if (sqlca.sqlwarn[0]=='W')warn ( );
206-
#line52 "test2.pgc"
202+
#line50 "test2.pgc"
207203

208204
if (sqlca.sqlcode<0)Finish (msg );}
209-
#line52 "test2.pgc"
205+
#line50 "test2.pgc"
210206

211-
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 ) ",ECPGt_EOIT,ECPGt_EORT);
212-
#line53 "test2.pgc"
207+
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 ) ",ECPGt_EOIT,ECPGt_EORT);
208+
#line51 "test2.pgc"
213209

214210
if (sqlca.sqlwarn[0]=='W')warn ( );
215-
#line53 "test2.pgc"
211+
#line51 "test2.pgc"
216212

217213
if (sqlca.sqlcode<0)Finish (msg );}
218-
#line53 "test2.pgc"
214+
#line51 "test2.pgc"
219215

220-
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 ) ",ECPGt_EOIT,ECPGt_EORT);
221-
#line54 "test2.pgc"
216+
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 ) ",ECPGt_EOIT,ECPGt_EORT);
217+
#line52 "test2.pgc"
222218

223219
if (sqlca.sqlwarn[0]=='W')warn ( );
224-
#line54 "test2.pgc"
220+
#line52 "test2.pgc"
225221

226222
if (sqlca.sqlcode<0)Finish (msg );}
227-
#line54 "test2.pgc"
223+
#line52 "test2.pgc"
228224

229-
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 ) ",ECPGt_EOIT,ECPGt_EORT);
230-
#line55 "test2.pgc"
225+
{ECPGdo(__LINE__,0,1,NULL,"insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 ) ",ECPGt_EOIT,ECPGt_EORT);
226+
#line53 "test2.pgc"
231227

232228
if (sqlca.sqlwarn[0]=='W')warn ( );
233-
#line55 "test2.pgc"
229+
#line53 "test2.pgc"
234230

235231
if (sqlca.sqlcode<0)Finish (msg );}
236-
#line55 "test2.pgc"
232+
#line53 "test2.pgc"
237233

238234

239235
strcpy(msg,"commit");
240236
{ECPGtrans(__LINE__,NULL,"commit");
241-
#line58 "test2.pgc"
237+
#line56 "test2.pgc"
242238

243239
if (sqlca.sqlwarn[0]=='W')warn ( );
244-
#line58 "test2.pgc"
240+
#line56 "test2.pgc"
245241

246242
if (sqlca.sqlcode<0)Finish (msg );}
247-
#line58 "test2.pgc"
243+
#line56 "test2.pgc"
248244

249245

250246
strcpy(msg,"open");
251247
{ECPGdo(__LINE__,0,1,NULL,"declare cur cursor for select name , born , age , married , children from meskes ",ECPGt_EOIT,ECPGt_EORT);
252-
#line61 "test2.pgc"
248+
#line59 "test2.pgc"
253249

254250
if (sqlca.sqlwarn[0]=='W')warn ( );
255-
#line61 "test2.pgc"
251+
#line59 "test2.pgc"
256252

257253
if (sqlca.sqlcode<0)Finish (msg );}
258-
#line61 "test2.pgc"
254+
#line59 "test2.pgc"
259255

260256

261257
/* exec sql whenever not found break ; */
262-
#line63 "test2.pgc"
258+
#line61 "test2.pgc"
263259

264260

265261
p=&personal;
@@ -278,23 +274,23 @@ if (sqlca.sqlcode < 0) Finish ( msg );}
278274
ECPGt_long,&(ind_married),(long)1,(long)1,sizeof(long),
279275
ECPGt_int,&(children.integer),(long)1,(long)1,sizeof(int),
280276
ECPGt_short,&(ind_children.smallint),(long)1,(long)1,sizeof(short),ECPGt_EORT);
281-
#line70 "test2.pgc"
277+
#line68 "test2.pgc"
282278

283279
if (sqlca.sqlcode==ECPG_NOT_FOUND)break;
284-
#line70 "test2.pgc"
280+
#line68 "test2.pgc"
285281

286282
if (sqlca.sqlwarn[0]=='W')warn ( );
287-
#line70 "test2.pgc"
283+
#line68 "test2.pgc"
288284

289285
if (sqlca.sqlcode<0)Finish (msg );}
290-
#line70 "test2.pgc"
286+
#line68 "test2.pgc"
291287

292288
printf("%8.8s",personal.name.arr);
293289
if (i->ind_birth.born >=0)
294290
printf(", born %ld",personal.birth.born);
295291
if (i->ind_birth.age >=0)
296292
printf(", age = %d",personal.birth.age);
297-
if ((long)ind_married >=0)
293+
if (ind_married >=0)
298294
printf(", married %s",married);
299295
if (ind_children.smallint >=0)
300296
printf(", children = %d",children.integer);
@@ -306,27 +302,27 @@ if (sqlca.sqlcode < 0) Finish ( msg );}
306302

307303
strcpy(msg,"close");
308304
{ECPGdo(__LINE__,0,1,NULL,"close cur",ECPGt_EOIT,ECPGt_EORT);
309-
#line87 "test2.pgc"
305+
#line85 "test2.pgc"
310306

311307
if (sqlca.sqlwarn[0]=='W')warn ( );
312-
#line87 "test2.pgc"
308+
#line85 "test2.pgc"
313309

314310
if (sqlca.sqlcode<0)Finish (msg );}
315-
#line87 "test2.pgc"
311+
#line85 "test2.pgc"
316312

317313

318314
/* and now a same query with prepare */
319315
{ECPGprepare(__LINE__,"MM" ,query);
320-
#line90 "test2.pgc"
316+
#line88 "test2.pgc"
321317

322318
if (sqlca.sqlwarn[0]=='W')warn ( );
323-
#line90 "test2.pgc"
319+
#line88 "test2.pgc"
324320

325321
if (sqlca.sqlcode<0)Finish (msg );}
326-
#line90 "test2.pgc"
322+
#line88 "test2.pgc"
327323

328324
/* declare prep cursor for ? */
329-
#line91 "test2.pgc"
325+
#line89 "test2.pgc"
330326

331327

332328
strcpy(msg,"open");
@@ -335,17 +331,17 @@ if (sqlca.sqlcode < 0) Finish ( msg );}
335331
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
336332
ECPGt_const,"'Petra'",(long)7,(long)1,strlen("'Petra'"),
337333
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
338-
#line94 "test2.pgc"
334+
#line92 "test2.pgc"
339335

340336
if (sqlca.sqlwarn[0]=='W')warn ( );
341-
#line94 "test2.pgc"
337+
#line92 "test2.pgc"
342338

343339
if (sqlca.sqlcode<0)Finish (msg );}
344-
#line94 "test2.pgc"
340+
#line92 "test2.pgc"
345341

346342

347343
/* exec sql whenever not found break ; */
348-
#line96 "test2.pgc"
344+
#line94 "test2.pgc"
349345

350346

351347
while (1) {
@@ -361,23 +357,23 @@ if (sqlca.sqlcode < 0) Finish ( msg );}
361357
ECPGt_long,&(ind_married),(long)1,(long)1,sizeof(long),
362358
ECPGt_int,&(children.integer),(long)1,(long)1,sizeof(int),
363359
ECPGt_short,&(ind_children.smallint),(long)1,(long)1,sizeof(short),ECPGt_EORT);
364-
#line100 "test2.pgc"
360+
#line98 "test2.pgc"
365361

366362
if (sqlca.sqlcode==ECPG_NOT_FOUND)break;
367-
#line100 "test2.pgc"
363+
#line98 "test2.pgc"
368364

369365
if (sqlca.sqlwarn[0]=='W')warn ( );
370-
#line100 "test2.pgc"
366+
#line98 "test2.pgc"
371367

372368
if (sqlca.sqlcode<0)Finish (msg );}
373-
#line100 "test2.pgc"
369+
#line98 "test2.pgc"
374370

375371
printf("%8.8s",personal.name.arr);
376372
if (ind_personal.ind_birth.born >=0)
377373
printf(", born %ld",personal.birth.born);
378374
if (ind_personal.ind_birth.age >=0)
379375
printf(", age = %d",personal.birth.age);
380-
if ((long)ind_married >=0)
376+
if (ind_married >=0)
381377
printf(", married %s",married);
382378
if (ind_children.smallint >=0)
383379
printf(", children = %d",children.integer);
@@ -388,46 +384,46 @@ if (sqlca.sqlcode < 0) Finish ( msg );}
388384

389385
strcpy(msg,"close");
390386
{ECPGdo(__LINE__,0,1,NULL,"close prep",ECPGt_EOIT,ECPGt_EORT);
391-
#line116 "test2.pgc"
387+
#line114 "test2.pgc"
392388

393389
if (sqlca.sqlwarn[0]=='W')warn ( );
394-
#line116 "test2.pgc"
390+
#line114 "test2.pgc"
395391

396392
if (sqlca.sqlcode<0)Finish (msg );}
397-
#line116 "test2.pgc"
393+
#line114 "test2.pgc"
398394

399395

400396
strcpy(msg,"drop");
401397
{ECPGdo(__LINE__,0,1,NULL,"drop table meskes ",ECPGt_EOIT,ECPGt_EORT);
402-
#line119 "test2.pgc"
398+
#line117 "test2.pgc"
403399

404400
if (sqlca.sqlwarn[0]=='W')warn ( );
405-
#line119 "test2.pgc"
401+
#line117 "test2.pgc"
406402

407403
if (sqlca.sqlcode<0)Finish (msg );}
408-
#line119 "test2.pgc"
404+
#line117 "test2.pgc"
409405

410406

411407
strcpy(msg,"commit");
412408
{ECPGtrans(__LINE__,NULL,"commit");
413-
#line122 "test2.pgc"
409+
#line120 "test2.pgc"
414410

415411
if (sqlca.sqlwarn[0]=='W')warn ( );
416-
#line122 "test2.pgc"
412+
#line120 "test2.pgc"
417413

418414
if (sqlca.sqlcode<0)Finish (msg );}
419-
#line122 "test2.pgc"
415+
#line120 "test2.pgc"
420416

421417

422418
strcpy(msg,"disconnect");
423419
{ECPGdisconnect(__LINE__,"CURRENT");
424-
#line125 "test2.pgc"
420+
#line123 "test2.pgc"
425421

426422
if (sqlca.sqlwarn[0]=='W')warn ( );
427-
#line125 "test2.pgc"
423+
#line123 "test2.pgc"
428424

429425
if (sqlca.sqlcode<0)Finish (msg );}
430-
#line125 "test2.pgc"
426+
#line123 "test2.pgc"
431427

432428

433429
return (0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp