Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 28fff0e

Browse files
author
Michael Meskes
committed
Fix descriptor output in ECPG.
While working on most platforms the old way sometimes created alignment problems. This should fix it. Also the regresion tests were updated to test for the reported case. Report and fix by MauMau <maumau307@gmail.com>
1 parent 47ac447 commit 28fff0e

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

src/interfaces/ecpg/preproc/type.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
368368
fprintf(o, "\n\tECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ");
369369
else if (type == ECPGt_descriptor)
370370
/* remember that name here already contains quotes (if needed) */
371-
fprintf(o, "\n\tECPGt_descriptor, %s, 0L, 0L, 0L, ", name);
371+
fprintf(o, "\n\tECPGt_descriptor, %s, 1L, 1L, 1L, ", name);
372372
else if (type == ECPGt_sqlda)
373373
fprintf(o, "\n\tECPGt_sqlda, &%s, 0L, 0L, 0L, ", name);
374374
else

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ if (sqlca.sqlcode < 0) exit (1);}
174174

175175
strcpy(msg, "describe");
176176
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id1",
177-
ECPGt_descriptor, "desc1", 0L, 0L, 0L,
177+
ECPGt_descriptor, "desc1", 1L, 1L, 1L,
178178
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
179179
#line 60 "describe.pgc"
180180

181181
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id1",
182-
ECPGt_descriptor, "desc2", 0L, 0L, 0L,
182+
ECPGt_descriptor, "desc2", 1L, 1L, 1L,
183183
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
184184
#line 61 "describe.pgc"
185185

@@ -336,12 +336,12 @@ if (sqlca.sqlcode < 0) exit (1);}
336336

337337
strcpy(msg, "describe");
338338
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id2",
339-
ECPGt_descriptor, "desc1", 0L, 0L, 0L,
339+
ECPGt_descriptor, "desc1", 1L, 1L, 1L,
340340
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
341341
#line 146 "describe.pgc"
342342

343343
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id2",
344-
ECPGt_descriptor, "desc2", 0L, 0L, 0L,
344+
ECPGt_descriptor, "desc2", 1L, 1L, 1L,
345345
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
346346
#line 147 "describe.pgc"
347347

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
134134

135135

136136
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo1",
137-
ECPGt_descriptor, "indesc", 0L, 0L, 0L,
137+
ECPGt_descriptor, "indesc", 1L, 1L, 1L,
138138
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
139139
#line 35 "desc.pgc"
140140

@@ -161,7 +161,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
161161

162162

163163
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo1",
164-
ECPGt_descriptor, "indesc", 0L, 0L, 0L,
164+
ECPGt_descriptor, "indesc", 1L, 1L, 1L,
165165
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
166166
#line 40 "desc.pgc"
167167

@@ -188,7 +188,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
188188

189189

190190
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "Foo-1",
191-
ECPGt_descriptor, "indesc", 0L, 0L, 0L,
191+
ECPGt_descriptor, "indesc", 1L, 1L, 1L,
192192
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
193193
#line 45 "desc.pgc"
194194

@@ -222,9 +222,9 @@ if (sqlca.sqlcode < 0) sqlprint();}
222222

223223

224224
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo2",
225-
ECPGt_descriptor, "indesc", 0L, 0L, 0L,
225+
ECPGt_descriptor, "indesc", 1L, 1L, 1L,
226226
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
227-
ECPGt_descriptor, "outdesc", 0L, 0L, 0L,
227+
ECPGt_descriptor, "outdesc", 1L, 1L, 1L,
228228
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
229229
#line 52 "desc.pgc"
230230

@@ -248,7 +248,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
248248
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c1 cursor for $1",
249249
ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
250250
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
251-
ECPGt_descriptor, "indesc", 0L, 0L, 0L,
251+
ECPGt_descriptor, "indesc", 1L, 1L, 1L,
252252
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
253253
#line 58 "desc.pgc"
254254

@@ -298,7 +298,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
298298
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c2 cursor for $1",
299299
ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo3", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
300300
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
301-
ECPGt_descriptor, "indesc", 0L, 0L, 0L,
301+
ECPGt_descriptor, "indesc", 1L, 1L, 1L,
302302
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
303303
#line 70 "desc.pgc"
304304

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ if (sqlca.sqlcode < 0) exit (1);}
172172

173173
strcpy(msg, "describe");
174174
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id1",
175-
ECPGt_descriptor, "desc1", 0L, 0L, 0L,
175+
ECPGt_descriptor, "desc1", 1L, 1L, 1L,
176176
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
177177
#line 60 "describe.pgc"
178178

179179
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id1",
180-
ECPGt_descriptor, "desc2", 0L, 0L, 0L,
180+
ECPGt_descriptor, "desc2", 1L, 1L, 1L,
181181
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
182182
#line 61 "describe.pgc"
183183

@@ -334,12 +334,12 @@ if (sqlca.sqlcode < 0) exit (1);}
334334

335335
strcpy(msg, "describe");
336336
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id2",
337-
ECPGt_descriptor, "desc1", 0L, 0L, 0L,
337+
ECPGt_descriptor, "desc1", 1L, 1L, 1L,
338338
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
339339
#line 146 "describe.pgc"
340340

341341
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id2",
342-
ECPGt_descriptor, "desc2", 0L, 0L, 0L,
342+
ECPGt_descriptor, "desc2", 1L, 1L, 1L,
343343
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
344344
#line 147 "describe.pgc"
345345

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );
210210
#line 41 "dynalloc.pgc"
211211

212212
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select a , b , c , d , e , f , g , h , i from test order by a", ECPGt_EOIT,
213-
ECPGt_descriptor, "mydesc", 0L, 0L, 0L,
213+
ECPGt_descriptor, "mydesc", 1L, 1L, 1L,
214214
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
215215
#line 42 "dynalloc.pgc"
216216

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );
188188
#line 32 "dynalloc2.pgc"
189189

190190
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from test", ECPGt_EOIT,
191-
ECPGt_descriptor, "mydesc", 0L, 0L, 0L,
191+
ECPGt_descriptor, "mydesc", 1L, 1L, 1L,
192192
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
193193
#line 33 "dynalloc2.pgc"
194194

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ if (sqlca.sqlcode < 0) error ( );}
273273
while (1)
274274
{
275275
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch in MYCURS", ECPGt_EOIT,
276-
ECPGt_descriptor, "MYDESC", 0L, 0L, 0L,
276+
ECPGt_descriptor, "MYDESC", 1L, 1L, 1L,
277277
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
278278
#line 64 "dyntest.pgc"
279279

0 commit comments

Comments
 (0)