Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connection in ECPG - Mailing list pgsql-hackers

From Haribabu Kommi
Subject Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connection in ECPG
Date
Msg-id CAJrrPGdcj+DgiRCuDjaCHdQ3eps540wAvcnx3kTLOpRtydbLLA@mail.gmail.com
Whole thread Raw
In response to Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connectionin ECPG  ("Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>)
Responses Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connection in ECPG  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connectionin ECPG  ("Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>)
List pgsql-hackers


On Tue, Mar 7, 2017 at 4:09 PM, Ideriha, Takeshi <ideriha.takeshi@jp.fujitsu.com> wrote:

Attached 004_declareStmt_test_v5.patch is a rebased one.
The rest of patches are same as older version.

Thanks for the update patch. I started reviewing the patches.

There was a minor conflict in applying 004_declareXX patch.

Some comments in 001_declareStmt_preproc_v5.patch:

+ if (INFORMIX_MODE)
+ {
+ if (pg_strcasecmp(stmt+strlen("close "), "database") == 0)
+ {
+ if (connection)
+ mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CLOSE DATABASE statement");
+
+ fprintf(base_yyout, "{ ECPGdisconnect(__LINE__, \"CURRENT\");");
+ whenever_action(2);
+ free(stmt);
+ break;
+ }
+ }

The same code block is present in the stmtClosePortalStmt condition to verify the close
statement. Because of the above code addition, the code present in stmtClosePortalStmt
is a dead code. So remove the code present in stmtClosePortalStmt or try to reuse it.


+static void
+output_cursor_name(char *str)

This function needs some comments to explain the code flow for better understanding.

+/*
+ * Translate the EXEC SQL DECLARE STATEMENT into ECPGdeclare function
+ */

How about using Transform instead of Translate? (similar references also)


I am yet to review the other patches.

Regards,
Hari Babu
Fujitsu Australia

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Questionable tag usage
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Unacccented Fractions