ECPG enhancements / fixes

From: Christof Petig <christof(at)petig-baender(dot)de>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: ECPG enhancements / fixes
Date: 2001-08-14 20:08:35
Message-ID: 3B798543.352AA64E@petig-baender.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Hi Michael,

I have been on holiday for three weeks and spent a part of the evenings
with my computer. So here are a couple of patches against 3 weeks ago's
CVS. If these patches are too outdated and you would like me to generate
a patch against current sources, please drop me a note. Since I have
been out of reach for any TCP/IP packet, I'm totally unaware of recent
changes ;-)

(Apply the patches in order to avoid conflicts)

0. This patch allows empty function calls in variable initializations.
This is really common for C++ code (e.g. string::c_str() ) and we had to
put nearly 50% of all initializations outside the declare section
because of this unnecessary limitation.

1. This patch implements 'cardinality' of descriptors (number of rows is
a result)

2. This patch implements support for arrays for storing results ('data',
'indicator') via get descriptor. (without this functionaly #1 is only of
informative value).

3. This bigger patch implements support for host variables containing
the descriptor name in all descriptor related commands.

4. This patch implements 'execute STATEMENT [using :VAR] into :VAR'.
Clearly a nice thing to have (understatement, it hurts badly to have
not).

5. This patch implements the syntax for 'execute into descriptor' and
'select into descriptor'. Making descriptors really neat. This patch
makes no sense without #6.

6. This patch implements the library support for #5. Actually
descriptors become like a special kind of host variables.

7. This patch cleans up the code duplication created by the first
descriptor implementation. And renders the old public library function
for descriptor results 'ECPGdo_descriptor' to unnecessary compatibility
code.

I have the patches separated into small pieces, so they can be
viewed/applied separately - but I see no reason of omitting any of them.
And please (if possible) could #0 and #4 also get applied to STABLE
(7.1)?

My opinion is that the functionality implemented by these patches is so
basic that they would justify dumping the 7.2 tree of ecpg into the
STABLE tree even if this means that ecpg accepts syntact constructs not
accepted by the 7.1 backend (because they are implemented in 7.2).
Considering an ecpg which lacks most of the functionality of the SQL
standard as stable is nonsense IMHO.
(Oh sorry, no offense meant to you, since you are the maintainer, I just
wanted to explain the status quo to people not so familiar to ecpg's
development.)

Yours
Christof

PS: On my to do list:
- implementing array allocation by 'get descriptor' ( by taking the code
out of ECPGexecute into a new function which copies _one_ column of a
result into _one_ variable) This would allow 'get descriptor' and
'ECPGexecute' to share code again.

- implementing host variables for cursor names, table names etc. Since
these things require a different quoting (" instead of ') a new Variable
type / flag is necessary.

- writing a new documentation which covers recent ecpg development (last
two years :-( )

Perhaps later on I might find some time / interest to implement the
following: (next year?)
- set descriptor / using descriptor : this functionality is covered by
snprintf.

Attachment Content-Type Size
0_allow_empty_calls_within_initializers.patch.gz application/x-gzip 250 bytes
1_recognize_cardinality.patch.gz application/x-gzip 1.1 KB
2_recognize_arrays.patch.gz application/x-gzip 1.4 KB
3_stringvar_for_desc_names.patch.gz application/x-gzip 1.8 KB
4_execute_into.patch.gz application/x-gzip 665 bytes
5_parse_into_descriptor.patch.gz application/x-gzip 1.8 KB
6_into_descriptor_implementation.patch.gz application/x-gzip 2.6 KB
7_cleanup.patch.gz application/x-gzip 2.5 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2001-08-14 20:54:03 Re: Patch: use SCM_CREDS authentication over PF_LOCAL sockets
Previous Message Mikhail Terekhov 2001-08-14 18:58:43 Re: libpgtcl for tcl >= 8.0 (Unix & Windows)