head	1.45;
access;
symbols
	REL7_2_BETA1:1.44
	REL7_1_2:1.44
	REL7_1_STABLE:1.44.0.2
	REL7_1_BETA:1.44
	REL7_1_BETA3:1.44
	REL7_1_BETA2:1.44
	REL7_1:1.44
	REL7_0_PATCHES:1.41.0.2
	REL7_0:1.41
	REL6_5_PATCHES:1.28.0.2
	REL6_5:1.28
	REL6_4:1.20.0.2
	release-6-3:1.9;
locks; strict;
comment	@# @;


1.45
date	2001.11.02.15.04.03;	author meskes;	state dead;
branches;
next	1.44;

1.44
date	2000.10.17.15.38.24;	author meskes;	state Exp;
branches;
next	1.43;

1.43
date	2000.09.26.11.41.43;	author meskes;	state Exp;
branches;
next	1.42;

1.42
date	2000.09.19.11.47.11;	author meskes;	state Exp;
branches;
next	1.41;

1.41
date	2000.03.01.12.49.38;	author meskes;	state Exp;
branches;
next	1.40;

1.40
date	2000.02.22.19.57.03;	author meskes;	state Exp;
branches;
next	1.39;

1.39
date	2000.02.18.14.33.59;	author meskes;	state Exp;
branches;
next	1.38;

1.38
date	2000.02.17.19.48.40;	author meskes;	state Exp;
branches;
next	1.37;

1.37
date	2000.02.16.16.18.01;	author meskes;	state Exp;
branches;
next	1.36;

1.36
date	2000.02.16.11.52.23;	author meskes;	state Exp;
branches;
next	1.35;

1.35
date	2000.01.18.13.03.46;	author meskes;	state Exp;
branches;
next	1.34;

1.34
date	99.12.23.12.33.18;	author meskes;	state Exp;
branches;
next	1.33;

1.33
date	99.12.08.09.52.28;	author meskes;	state Exp;
branches;
next	1.32;

1.32
date	99.11.22.12.48.45;	author meskes;	state Exp;
branches;
next	1.31;

1.31
date	99.10.15.19.02.08;	author meskes;	state Exp;
branches;
next	1.30;

1.30
date	99.09.15.08.29.03;	author meskes;	state Exp;
branches;
next	1.29;

1.29
date	99.07.19.12.37.45;	author meskes;	state Exp;
branches;
next	1.28;

1.28
date	99.06.29.09.25.21;	author meskes;	state Exp;
branches;
next	1.27;

1.27
date	99.06.16.18.35.51;	author meskes;	state Exp;
branches;
next	1.26;

1.26
date	99.06.16.18.25.49;	author meskes;	state Exp;
branches;
next	1.25;

1.25
date	99.03.24.20.05.06;	author meskes;	state Exp;
branches;
next	1.24;

1.24
date	99.03.05.09.25.34;	author meskes;	state Exp;
branches;
next	1.23;

1.23
date	99.02.28.07.25.26;	author scrappy;	state Exp;
branches;
next	1.22;

1.22
date	99.02.23.12.56.53;	author scrappy;	state Exp;
branches;
next	1.21;

1.21
date	99.02.20.07.00.47;	author scrappy;	state Exp;
branches;
next	1.20;

1.20
date	98.08.25.11.55.26;	author scrappy;	state Exp;
branches;
next	1.19;

1.19
date	98.08.11.18.33.23;	author momjian;	state Exp;
branches;
next	1.18;

1.18
date	98.08.05.04.47.40;	author scrappy;	state Exp;
branches;
next	1.17;

1.17
date	98.06.03.13.54.52;	author scrappy;	state Exp;
branches;
next	1.16;

1.16
date	98.05.26.13.43.31;	author scrappy;	state Exp;
branches;
next	1.15;

1.15
date	98.05.21.03.52.34;	author scrappy;	state Exp;
branches;
next	1.14;

1.14
date	98.05.06.12.56.46;	author scrappy;	state Exp;
branches;
next	1.13;

1.13
date	98.04.27.14.35.07;	author scrappy;	state Exp;
branches;
next	1.12;

1.12
date	98.04.24.12.09.07;	author scrappy;	state Exp;
branches;
next	1.11;

1.11
date	98.04.21.13.21.49;	author scrappy;	state Exp;
branches;
next	1.10;

1.10
date	98.03.20.03.07.00;	author momjian;	state Exp;
branches;
next	1.9;

1.9
date	98.02.27.12.56.48;	author scrappy;	state Exp;
branches;
next	1.8;

1.8
date	98.02.27.02.31.07;	author scrappy;	state Exp;
branches;
next	1.7;

1.7
date	98.02.24.15.51.32;	author scrappy;	state Exp;
branches;
next	1.6;

1.6
date	98.02.19.13.51.20;	author scrappy;	state Exp;
branches;
next	1.5;

1.5
date	98.02.17.01.47.24;	author scrappy;	state Exp;
branches;
next	1.4;

1.4
date	98.02.12.14.01.38;	author scrappy;	state Exp;
branches;
next	1.3;

1.3
date	98.02.11.15.17.55;	author scrappy;	state Exp;
branches;
next	1.2;

1.2
date	98.02.10.16.36.55;	author scrappy;	state Exp;
branches;
next	1.1;

1.1
date	98.02.05.15.42.58;	author scrappy;	state Exp;
branches;
next	;


desc
@@


1.45
log
@Sync parser yet again.
@
text
@The complete structure definition has to be listed inside the declare
section of the structure variable for ecpg to be able to understand it.

sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified in a SET
DESCRIPTOR statement will be ignored.

The error handling has to be improved by adding additional error-rules to
the parser.

it would be nice to be able to use :var[:index] or :var[<integer>] as
cvariable for an array var

What happens to the output variable during read if there was an
indicator-error? 

Add a semantic check level, e.g. check if a table really exists.

It would be nice if there was a alternative library using SPI functions
instead of libpq so we can write backend functions using ecpg.

remove space_or_nl and line_end from pgc.l

nested C comments do not work

Missing features:
 - SQLSTATE
@


1.44
log
@Fixed some bugs in C language parsing.
@
text
@@


1.43
log
@- Synced preproc.y with gram.y.
- Synced keyword.c.
- Added patch by Christof Petig <christof.petig@@wtal.de> to fix NOT
  FOUND problem on update/insert/delete.
@
text
@d23 2
@


1.42
log
@*** empty log message ***
@
text
@a3 3
The error message for "no data" in an exec sql insert select from statement
has to be 100.

a6 3
If a NOTICE message is given by the backend it should not be printed to
stderr. Instead it should be listed as a warning.

a24 1
 - LONG LONG datatype
@


1.41
log
@*** empty log message ***
@
text
@d29 1
a29 1
Missing statements:
d31 1
@


1.40
log
@*** empty log message ***
@
text
@a18 2
How can one insert arrays from c variables?

a26 2
make ECPGnumeric_lvalue more accurate by using something like ECPGdump_a_*

a29 1
 - exec sql ifdef
@


1.39
log
@*** empty log message ***
@
text
@d31 2
@


1.38
log
@*** empty log message ***
@
text
@d29 2
@


1.37
log
@*** empty log message ***
@
text
@d26 3
a30 2
 - exec sql allocate
 - exec sql deallocate
@


1.36
log
@*** empty log message ***
@
text
@a20 2
support for dynamic SQL with unknown number of variables with DESCRIPTORS

@


1.35
log
@*** empty log message ***
@
text
@d16 2
a17 1
it would be nice to be able to use :var[:index] as cvariable for an array var
@


1.34
log
@*** empty log message ***
@
text
@d16 3
a18 1
it would be nice to be able to use :var[:index] as cvariable
a21 2
The line numbering is not exact.

a25 2

How can one insert arrays from c variables?
@


1.33
log
@*** empty log message ***
@
text
@d27 1
a27 1
How can on insert arrays from c variables?
@


1.32
log
@*** empty log message ***
@
text
@d13 3
@


1.31
log
@*** empty log message ***
@
text
@d10 3
d23 2
@


1.30
log
@*** empty log message ***
@
text
@d16 5
d22 1
a22 1
 - exec slq ifdef
@


1.29
log
@*** empty log message ***
@
text
@d17 1
@


1.28
log
@*** empty log message ***
@
text
@a15 2
Inside an SQL statement quoting only works with SQL92 style double quotes: ''. 

@


1.27
log
@*** empty log message ***
@
text
@d16 2
@


1.26
log
@*** empty log message ***
@
text
@a13 4
Allow INTO clause in cursor definition instead of FETCH clause. (Informix
does this, Oracle not. But does it work with standard syntax? Or is it even
standard?)

@


1.25
log
@*** empty log message ***
@
text
@d14 4
@


1.24
log
@*** empty log message ***
@
text
@a3 2
Variable type bool has to be tested. I never used it so far.

d14 2
d18 1
@


1.23
log
@
From: Michael Meskes <Michael_Meskes@@topmail.de>

+
+ Tue Feb 23 17:32:25 CET 1999
+
+       - Other than a struct a union itself cannot be specified as variable.
+
+ Fri Feb 26 07:18:25 CET 1999
+
+       - Synced preproc.y with gram.y.
+
+ Sat Feb 27 20:30:03 CET 1999
+
+       - Added automatic allocating for NULL pointers.
@
text
@d14 1
a14 5
it would also be nice to be able to work with varchar * (inculding automatic
allocating)

support for dynamic SQL with unknown number of variables with SQLDA structure
or something similar
@


1.22
log
@
From: Michael Meskes <Michael_Meskes@@topmail.de>

+
+ Son Feb 21 14:10:47 CET 1999
+
+       - Fixed variable detection in libecpg.
+
+ Mon Feb 22 19:47:45 CET 1999
+
+       - Added 'at <db_connection>' option to all commands it is apllicable
+         to. Due to changing the API of some libecpg functions this
+         requires me to increase the major version number.
+       - Synced pgc.l with scan.l.
+       - Added support for unions.
+       - Set library version to 3.0.0
+       - Set ecpg version to 3.0.0
@
text
@d14 3
d18 1
a18 2

allocate memory for pointers as C input variables
@


1.21
log
@
From: Michael Meskes <Michael_Meskes@@topmail.de>

See Changes file...
@
text
@d14 1
a14 1
'at DB connection' is missing for several commands (is this standard?)
d16 1
a16 1
support for unions
@


1.20
log
@
From: Michael Meskes <meskes@@online-club.de>

+
+ Fri Aug 14 12:44:21 CEST 1998
+
+       - Added EXEC SQL DEFINE statement
+       - Set version to 2.4.0
+
+ Tue Aug 18 09:24:15 CEST 1998
+
+       - Removed keyword IS from DEFINE statement
+       - Added latest changes from gram.y
+       - Removed duplicate symbols from preproc.y
+       - Initialize sqlca structure
+       - Added check for connection to ecpglib
+       - Set version to 2.4.1
+
+ Thu Aug 20 15:31:29 CEST 1998
+
+       - Cleaned up memory allocation in ecpglib.c
+       - Set library version to 2.6
+
@
text
@d14 4
a18 2
 - exec sql type
 - exec sql prepare
a19 1
 - exqc sql free
a20 1
 - exec sql whenever sqlwarning
@


1.19
log
@This one cleans the cursor problems ecpg had so far. It is now able
to understand cursors with variables.

Michael
@
text
@a15 1
 - exec sql define
@


1.18
log
@
From: Dr. Michael Meskes <meskes@@online-club.de>

So this should finally get cursors working. There was an ugly bug in it.
@
text
@a0 2
What happens to a cursor declaration with variables?

d4 1
a4 1
Variable type bool has to be checked. I never used it so far.
@


1.17
log
@
From: Michael Meskes <meskes@@topsystem.de>

+ Wed Jun  3 13:38:57 CEST 1998
+
+       - Made sqlca struct compatible with other systems.
+       - Give back a warning in case of truncation
+       - Changed the handling of OptimizableStmt since the old one broke
+         CREATE RULE
+       - Set library version to 2.3
+       - Set version to 2.3.3
@
text
@d1 2
@


1.16
log
@
From: Michael Meskes <meskes@@topsystem.de>

+Wed May 20 10:46:48 CEST 1998
+
+       - Fixed handling of preprocessor directives and variable
+         initialization.
+       - Added enum datatype.
        - Set version to 2.3.2
@
text
@d6 8
d21 1
@


1.15
log
@
From: Michael Meskes <meskes@@topsystem.de>

+ Tue May 19 11:49:34 CEST 1998
+
+       - Tested (and fixed) 'set connection'
+       - Fixed string notation in C
+       - Set version to 2.3.2
@
text
@a0 2
ecpg does not understand enum datatypes.

@


1.14
log
@From: Michael Meskes <meskes@@topsystem.de>

Tue Apr 28 14:48:41 CEST 1998

      - Put operator "->" back into parser. Note that :foo->bar means the
        C term, but :foo ->bar means the operator "->".

Tue Apr 28 15:49:07 CEST 1998

      - Added exec sql disconnect command.
      - Allow varchar in C to be written in uppercase too.
      - Added whenever option "do break;"

Wed Apr 29 09:17:53 CEST 1998

      - Corrected parsing of C comments.
      - Also allow C++ style comments.
      - Make sure not found is only checked after commands that could
          return it.
      - Added error codes, see ecpgerror.h for details.
      - Added "exec sql <TransactionStmt> release" as disconnect statement
        for compatibility issues.

Thu Apr 30 10:42:10 CEST 1998

      - Added a -t option to disable automatic transaction start.
      - Added sqlerrd[] to sqlca struct.
      - Give back number of tuples affect in sqlca.sqlerrd[2].

Thu Apr 30 13:36:02 CEST 1998

      - Make the return code different in case of different errors.

Wed May  6 11:42:48 CEST 1998

      - Free memory if possible
      - Some bugfixes for bugs I found while changing the memory
          allocation code
      - Now able to fill complete array with one call (see test1.pgc for
          an example)
      - Set version to 2.3.0
      - Set library version to 2.1
@
text
@d8 7
a14 7
ecpg cannot use pointer variables except [unsigned] char *

There is no exec sql type statement which is the SQL version of a typedef.

There is no exec sql prepare statement.

There is no SQLSTATE
@


1.13
log
@From: Michael Meskes <meskes@@topsystem.de>

And the next update. Now you can use only parts of a struct like this:

exec sql select a into :struct.string from foo;
@
text
@a0 30
This list is still from Linus. MM

The variables should be static.

There should be different error numbers for the different errors instead of
just -1 for them all.
    
Missing library functions to_date et al.
    
Oracle has array operations that enhances speed. When implementing it in
ecpg it is done for compatibility reasons only. For them to improve speed
would require a lot more insight in the postgres internal mechanisms than I
possess.
    
As well as complex types like records and arrays, typedefs would be a good
thing to take care of.
    
To set up a database you need a few scripts with table definitions and other
configuration parameters. If you have these scripts for an old database you
would like to just apply them to get a postgres database that works in the
same way. The functionality could be accomplished with some conversion
scripts. Speed will never be accomplished in this way. To do this you need a
bigger insight in the database construction and the use of the database than
could be realised in a script.

Now comes my list (MM):

The return code is alway -1 in case of an error. You cannot see which error
occured by examining the return code.

a2 2
There is no exec sql prepare statement.

d4 1
a4 1
section for ecpg to be able to understand it.
d6 1
a6 2
There is no way yet to fill a complete array with one call except arrays of
[unsigned] char which are considered strings.
d10 1
a10 1
give back the number of tuples affected via sqlca
d12 1
a12 9
exec sql disconnect {current|default|all|connectionname|connection_hostvar};
 oder <disconnect statement> ::=
    DISCONNECT <disconnect object>

 <disconnect object> ::=
      <connection object>
    | ALL
    | CURRENT
 commit release|commit work release auch disconnect
d14 1
a14 1
It is not neccessary to check for "not found" after all commands.
@


1.12
log
@From: Michael Meskes <meskes@@topsystem.de>

+ Thu Apr 23 09:27:16 CEST 1998
+
+       - Also allow call in whenever statement with the same functionality
+         as do.
+
+ Thu Apr 23 12:29:28 CEST 1998
+
+       - Also rewrote variable declaration part. It is now possible to
+         declare more than one variable per line.
+       - Set version to 2.1.0
+
+ Fri Apr 24 13:50:15 CEST 1998
+
+       - Fixed some bugs.
+       - Set version to 2.1.1
@
text
@a55 3

It would be nice to be able to specify parts of a structure like :foo.bar or
:foo->bar.
@


1.11
log
@Upgrade ECPG to 2.0

Michael Meskes <meskes@@topsystem.de>
@
text
@a37 2
Each variable has to be defined on a line on its own.

d55 4
a58 1
It is not neccessary to check for sql not found after all commands.
@


1.10
log
@Here's my next patch to bring ecpg to version 1.1. It now correctly
handles all transaction commands and the exec sql include command.

Michael Meskes
@
text
@a3 9
    
Preprocessor cannot do syntax checking on your SQL statements Whatever you
write is copied more or less exactly to the PostgreSQL and you will not be
able to locate your errors until run-time.
    
No restriction to strings only The PQ interface, and most of all the PQexec
function, that is used by the ecpg relies on that the request is built up as
a string. In some cases, like when the data contains the null character,
this will be a serious problem.
a14 6
Oracle has indicator variables that tell if a value is null or if it is
empty. This largely simplifies array operations and provides for a way to
hack around some design flaws in the handling of VARCHAR2 (like that an
empty string isn't distinguishable from a null value). I am not sure if this
is an Oracle extension or part of the ANSI standard.
    
a30 2
The cursor is opened when the declare statement is issued.

d45 11
a55 2
List all commands as sqlcommand, not just S_SYMBOL or even better rewrite
pareser to be equivalent to backends parser.
d57 1
a57 1
Set standard include paths.
@


1.9
log
@From: Michael Meskes <meskes@@topsystem.de>

No more shift/reduce conflicts. Also all other bugs I know about are fixed.
@
text
@d62 4
a65 1
List all commands as sqlcommand, not just S_SYMBOL
@


1.8
log
@From: Michael Meskes <meskes@@topsystem.de>
Subject: [PATCHES] ecpg: correct whenever statement
@
text
@d62 1
@


1.7
log
@+ Sat Feb 21 19:10:55 CET 1998
+
+       - use char[] as string not as array of bytes that is integers
+
+ Sun Feb 22 16:37:36 CET 1998
+
+       - use long for all size variables
+       - added execute immediate statement
+
+ Sun Feb 22 20:41:32 CET 1998
+
+       - use varcharsize = 1 for all simple types, 0 means pointer, > 1
+         means array if type is char resp. unsigned char
+
+ Thu Feb 24 12:26:12 CET 1998
+
+       - allow 'go to' in whenever statement as well as 'goto'
+       - new argument 'stop' for whenever statement

From: Michael Meskes <meskes@@topsystem.de>
@
text
@d50 1
a50 1
The is no exec sql prepare statement.
@


1.6
log
@From: Michael Meskes <meskes@@topsystem.de>

Here's my next patch. this one should fix some more bugs. ecpg now fully
understands the whenever statement.
@
text
@d43 2
a44 1
What do we do with enum data types?
d46 3
a48 1
The cursor is opened when the declare statement is issued. 
d51 11
@


1.5
log
@Major update of ecpg preprocessor

From: Michael Meskes <meskes@@topsystem.de>
@
text
@d6 1
a6 1
write is copied more or less exactly to the postgres95 and you will not be
d45 3
a47 1
'signed' isn't understood so far
@


1.4
log
@From: Michael Meskes <meskes@@topsystem.de>

Here's the ecpg patch for the local variables bug I reported earlier:
@
text
@a18 4
Possibility to define records or structs in the declare section in a way
that the record can be filled from one row in the database. This is a
simpler way to handle an entire row at a time.
    
d43 1
a43 1
Variable definitions containing static/volatile have to be possible.
d45 1
@


1.3
log
@From: Michael Meskes <meskes@@topsystem.de>

Cleanups for ecpg, as well as a missing patch so that its configured in
@
text
@a46 3
Ecpg should remove variables from its list as soon as they are undefined and
not rely on cc to report an error.

@


1.2
log
@Updated ECPG From: Michael Meskes <meskes@@topsystem.de>
@
text
@a4 4
The preprocessor interface is strange, to say the least It would be better
with a consistant unix arguments interface, perhaps builtin default
filenames so they won't have to be given all the time. (Done: MM 2/5/98)
    
d47 4
a50 1
libecpg should be made a shared library.
a51 1
Makefiles have to able to correctly install and clean.
@


1.1
log
@From: Michael Meskes <meskes@@topsystem.de>

Well this is not really a patch. But I mananged to get Linus' old Postgres95
precompiler to compile and work with PostgreSQL. The next step would be to
collect bug/missing feature reports and to put it into the distribution so
that it is made with the standard make procedure.

Warning! So far it is not tested much and it does not install correctly. But
I was able to create a small binary with it.
@
text
@d7 1
a7 1
filenames so they won't have to be given all the time.
d49 5
@
