public inbox for [email protected]help / color / mirror / Atom feed
Compatibility modes supported in ECPG 7+ messages / 2 participants [nested] [flat]
* Compatibility modes supported in ECPG @ 2018-01-10 11:44 Ashutosh Sharma <[email protected]> 0 siblings, 1 reply; 7+ messages in thread From: Ashutosh Sharma @ 2018-01-10 11:44 UTC (permalink / raw) To: pgsql-interfaces Hi All, As per the documentation of ecpg, currently we support only two types of compatibility modes with ecpg and they are 1) INFORMIX and 2) INFORMIX_SE. However, it does accept any compatibility mode option that starts with INFORMIX*. For e.g. let us say, if i pass 'INFORMIX_BAD_COMPAT_MODE' as a compatibility mode, it still accepts it. [ashu@localhost bin]$ ./ecpg -C INFORMIX_BAD_COMPAT_MODE test_compat_modes.pc [ashu@localhost bin]$ Shouldn't we throw an error for this, instead of accepting it and assuming it as INFORMIX_SE mode. Thoughts? -- With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Compatibility modes supported in ECPG @ 2018-01-10 12:29 Michael Meskes <[email protected]> parent: Ashutosh Sharma <[email protected]> 0 siblings, 1 reply; 7+ messages in thread From: Michael Meskes @ 2018-01-10 12:29 UTC (permalink / raw) To: Ashutosh Sharma <[email protected]>; +Cc: pgsql-interfaces Hi, > Shouldn't we throw an error for this, instead of accepting it and > assuming it as INFORMIX_SE mode. Thoughts? Yes, I'd say that would be better. :) Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org Jabber: michael at xmpp dot meskes dot org VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Compatibility modes supported in ECPG @ 2018-01-10 15:40 Ashutosh Sharma <[email protected]> parent: Michael Meskes <[email protected]> 0 siblings, 1 reply; 7+ messages in thread From: Ashutosh Sharma @ 2018-01-10 15:40 UTC (permalink / raw) To: Ashutosh Sharma <[email protected]>; pgsql-interfaces On Wed, Jan 10, 2018 at 5:59 PM, Michael Meskes <[email protected]> wrote: > Hi, > >> Shouldn't we throw an error for this, instead of accepting it and >> assuming it as INFORMIX_SE mode. Thoughts? > > Yes, I'd say that would be better. :) > Thanks Michael. Shall i submit a patch for it. Also, what about making the compatibility modes case insensitive. Currently, ecpg accepts compatibility mode only in capital letters. In case if the INFORMIX or INFORMIX_SE is entered in small or mixed type letter, ecpg throws an error. Shouldn't that be handled as well? -- With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com > Michael > -- > Michael Meskes > Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) > Meskes at (Debian|Postgresql) dot Org > Jabber: michael at xmpp dot meskes dot org > VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Compatibility modes supported in ECPG @ 2018-01-11 11:04 Michael Meskes <[email protected]> parent: Ashutosh Sharma <[email protected]> 0 siblings, 1 reply; 7+ messages in thread From: Michael Meskes @ 2018-01-11 11:04 UTC (permalink / raw) To: [email protected] > Thanks Michael. Shall i submit a patch for it. Also, what about Yes, please. > making > the compatibility modes case insensitive. Currently, ecpg accepts > compatibility mode only in capital letters. In case if the INFORMIX > or > INFORMIX_SE is entered in small or mixed type letter, ecpg throws an > error. Shouldn't that be handled as well? Actually I don't mind either way. There is definitely an advantage of having it case insensitive, but then options are known to be case sensitive often enough. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org Jabber: michael at xmpp dot meskes dot org VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Compatibility modes supported in ECPG @ 2018-01-11 12:43 Ashutosh Sharma <[email protected]> parent: Michael Meskes <[email protected]> 0 siblings, 1 reply; 7+ messages in thread From: Ashutosh Sharma @ 2018-01-11 12:43 UTC (permalink / raw) To: Michael Meskes <[email protected]>; +Cc: [email protected] On Thu, Jan 11, 2018 at 4:34 PM, Michael Meskes <[email protected]> wrote: >> Thanks Michael. Shall i submit a patch for it. Also, what about > > Yes, please. > Thanks. Attached are the patches 'Allow_ecpg_to_throw_error_for_wrong_compat_modes_v1' and 'Allow_ecpg_to_throw_error_for_wrong_compat_modes_v2' that fixes the reported issues. >> making >> the compatibility modes case insensitive. Currently, ecpg accepts >> compatibility mode only in capital letters. In case if the INFORMIX >> or >> INFORMIX_SE is entered in small or mixed type letter, ecpg throws an >> error. Shouldn't that be handled as well? > > Actually I don't mind either way. There is definitely an advantage of > having it case insensitive, but then options are known to be case > sensitive often enough. > I feel we should make them case insensitive. The reason being, other embedded SQL programming languages for e.g. Pro*C accepts case insensitive options. So, why can't we make our ecpg options case insensitive as well. Thoughts? -- With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com > Michael > -- > Michael Meskes > Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) > Meskes at (Debian|Postgresql) dot Org > Jabber: michael at xmpp dot meskes dot org > VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL > Attachments: [text/x-patch] Allow_ecpg_to_throw_error_for_wrong_compat_modes_v1.patch (535B, ../../CAE9k0PneuT62kyqDbhEdeod3rd6PZiLJum=3S6Vo4f6-htSPUQ@mail.gmail.com/2-Allow_ecpg_to_throw_error_for_wrong_compat_modes_v1.patch) download | inline diff: diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 8a14572..badf042 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -198,7 +198,7 @@ main(int argc, char *const argv[]) system_includes = true; break; case 'C': - if (strncmp(optarg, "INFORMIX", strlen("INFORMIX")) == 0) + if (strcmp(optarg, "INFORMIX") == 0 || strcmp(optarg, "INFORMIX_SE") == 0) { char pkginclude_path[MAXPGPATH]; char informix_path[MAXPGPATH]; [text/x-patch] Allow_ecpg_to_throw_error_for_wrong_compat_modes_v2.patch (934B, ../../CAE9k0PneuT62kyqDbhEdeod3rd6PZiLJum=3S6Vo4f6-htSPUQ@mail.gmail.com/3-Allow_ecpg_to_throw_error_for_wrong_compat_modes_v2.patch) download | inline diff: diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 8a14572..cd770c8 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -198,12 +198,12 @@ main(int argc, char *const argv[]) system_includes = true; break; case 'C': - if (strncmp(optarg, "INFORMIX", strlen("INFORMIX")) == 0) + if (pg_strcasecmp(optarg, "INFORMIX") == 0 || pg_strcasecmp(optarg, "INFORMIX_SE") == 0) { char pkginclude_path[MAXPGPATH]; char informix_path[MAXPGPATH]; - compat = (strcmp(optarg, "INFORMIX") == 0) ? ECPG_COMPAT_INFORMIX : ECPG_COMPAT_INFORMIX_SE; + compat = (pg_strcasecmp(optarg, "INFORMIX") == 0) ? ECPG_COMPAT_INFORMIX : ECPG_COMPAT_INFORMIX_SE; get_pkginclude_path(my_exec_path, pkginclude_path); snprintf(informix_path, MAXPGPATH, "%s/informix/esql", pkginclude_path); add_include_path(informix_path); ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Compatibility modes supported in ECPG @ 2018-01-12 15:01 Michael Meskes <[email protected]> parent: Ashutosh Sharma <[email protected]> 0 siblings, 1 reply; 7+ messages in thread From: Michael Meskes @ 2018-01-12 15:01 UTC (permalink / raw) To: Ashutosh Sharma <[email protected]>; +Cc: [email protected] > Thanks. Attached are the patches > 'Allow_ecpg_to_throw_error_for_wrong_compat_modes_v1' and > 'Allow_ecpg_to_throw_error_for_wrong_compat_modes_v2' that fixes the > reported issues. Thanks, I just committed the case insensitive version. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org Jabber: michael at xmpp dot meskes dot org VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Compatibility modes supported in ECPG @ 2018-01-12 15:06 Ashutosh Sharma <[email protected]> parent: Michael Meskes <[email protected]> 0 siblings, 0 replies; 7+ messages in thread From: Ashutosh Sharma @ 2018-01-12 15:06 UTC (permalink / raw) To: Michael Meskes <[email protected]>; +Cc: [email protected] On Jan 12, 2018 20:31, "Michael Meskes" <[email protected]> wrote: > Thanks. Attached are the patches > 'Allow_ecpg_to_throw_error_for_wrong_compat_modes_v1' and > 'Allow_ecpg_to_throw_error_for_wrong_compat_modes_v2' that fixes the > reported issues. Thanks, I just committed the case insensitive version. Thank you :) Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org Jabber: michael at xmpp dot meskes dot org VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-01-12 15:06 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-01-10 11:44 Compatibility modes supported in ECPG Ashutosh Sharma <[email protected]> 2018-01-10 12:29 ` Michael Meskes <[email protected]> 2018-01-10 15:40 ` Ashutosh Sharma <[email protected]> 2018-01-11 11:04 ` Michael Meskes <[email protected]> 2018-01-11 12:43 ` Ashutosh Sharma <[email protected]> 2018-01-12 15:01 ` Michael Meskes <[email protected]> 2018-01-12 15:06 ` Ashutosh Sharma <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox