public inbox for [email protected]
help / color / mirror / Atom feedFrom: Ashutosh Sharma <[email protected]>
To: Michael Meskes <[email protected]>
Cc: [email protected]
Subject: Re: Compatibility modes supported in ECPG
Date: Thu, 11 Jan 2018 18:13:15 +0530
Message-ID: <CAE9k0PneuT62kyqDbhEdeod3rd6PZiLJum=3S6Vo4f6-htSPUQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAE9k0P=5jSNUw5NSO6xcbxTzfNo7Wrmc8TFFv2qVxKLAR-T6dQ@mail.gmail.com>
<20180110122916.GA1160@feivel>
<CAE9k0PnL0JCaKKWqFZY9x5Ar5+=ChUn-thf=CedAOV6LsdfDnQ@mail.gmail.com>
<[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);
view thread (7+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Compatibility modes supported in ECPG
In-Reply-To: <CAE9k0PneuT62kyqDbhEdeod3rd6PZiLJum=3S6Vo4f6-htSPUQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox