Re: Split-up ECPG patches

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Michael Meskes <michael(at)fam-meskes(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, hs(at)cybertec(dot)at
Subject: Re: Split-up ECPG patches
Date: 2009-08-11 16:02:35
Message-ID: 4A81961B.6020409@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Boszormenyi Zoltan írta:
> But I have the following problem. When this is in ecpg.addon:
> ===============================
> ...
> ECPG: FetchStmtFETCHfetch_args addon
> ECPG: FetchStmtMOVEfetch_args addon
> add_additional_variables(current_cursor, false);
> free(current_cursor);
> current_cursor = NULL;
> ...
> ECPG: FetchStmtMOVEfetch_args rule
> | FETCH fetch_args ecpg_into
> {
> add_additional_variables(current_cursor, false);
> free(current_cursor);
> current_cursor = NULL;
> $$ = cat2_str(make_str("fetch"), $2);
> }
> ...
> ===============================
>
> After running parse.pl, I get this in preproc.y for FetchStmt:
>
> ===============================
> FetchStmt:
> FETCH fetch_args
> {
> add_additional_variables(current_cursor, false);
> free(current_cursor);
> current_cursor = NULL;
>
> $$ = cat_str(2,make_str("fetch"),$2);
> }
> | MOVE fetch_args
> {
> add_additional_variables(current_cursor, false);
> free(current_cursor);
> current_cursor = NULL;
> { // THIS IS AN EXTRA "{"
> $$ = cat_str(2,make_str("move"),$2);
> }
> ...
> ===============================
>
> With this code, I can prevent the extra "{" emitted:
>
> ===============================
> ECPG: FetchStmtMOVEfetch_args block
> {
> add_additional_variables(current_cursor, false);
> free(current_cursor);
> current_cursor = NULL;
> $$ = cat2_str(make_str("move"), $2);
> }
> | FETCH fetch_args ecpg_into
> {
> add_additional_variables(current_cursor, false);
> free(current_cursor);
> current_cursor = NULL;
> $$ = cat2_str(make_str("fetch"), $2);
> }
> ...
> ===============================
>

Any word on the above? If no, I can accept this construct being legal...

Anyway, I adapted the remaining two patches (SQLDA and
DESCRIBE) to the previously sent dynamic cursor code
and also added regression tests. Please, review.

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/

Attachment Content-Type Size
pg85-sqlda-6-ctxdiff.patch text/x-patch 64.8 KB
pg85-describe-5-ctxdiff.patch text/x-patch 62.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2009-08-11 16:08:05 Re: "Hot standby"?
Previous Message Joshua D. Drake 2009-08-11 15:58:00 Re: "Hot standby"?