Re: ECPG patch 4.1, out-of-scope cursor support in native mode

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org, Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Subject: Re: ECPG patch 4.1, out-of-scope cursor support in native mode
Date: 2010-01-22 17:11:51
Message-ID: 4B59DC57.5000102@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Devrim GÜNDÜZ 2010-01-22 17:13:02 Re: [COMMITTERS] pgsql: Replace ALTER TABLE ...
Previous Message Tom Lane 2010-01-22 17:08:04 Re: Access to dynamic SQL in PL/pgSQL