Michael Meskes írta:
>> diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/compat_informix-struct.c
pgsql.4.1/src/interfaces/ecpg/test/expected/compat_informix-struct.c
>> ...
>> + /* Test DECLARE ... SELECT ... INTO with struct type */
>> +
>> + ECPGset_var( 0, &( myvar ), __LINE__);\
>> + ECPGset_var( 1, &( mynullvar ), __LINE__);\
>> + ECPG_informix_reset_sqlca(); /* declare mycur cursor for select * from a1 */
>> + #line 45 "struct.pgc"
>> +
>> + { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur cursor for select * from a1", ECPGt_EOIT,
>> + ECPGt_int,&(myvar.id),(long)1,(long)1,sizeof(int),
>> ...
>>
>
> Why does the preproc spit out ECPGset_var's but no ECPGget_var's in this test case?
>
Because there's no ECPGget_var()s emitted for
- global variables
- variables in the same function
ECPGget_var() is only used in case the cursor declaration
used INTO/USING and it's in a different function from
the one where OPEN/FETCH/CLOSE reside. But this
cannot be determined easily, e.g. short of making ECPG
a two-pass precompiler, so ECPGset_var() is always used.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/