Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6bccf64

Browse files
committed
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
1 parent f9322c6 commit 6bccf64

25 files changed

+1792
-1644
lines changed

src/interfaces/ecpg/ChangeLog

+40
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,43 @@ Mon Apr 27 14:26:55 CEST 1998
149149
and :foo.bar as variables.
150150
- Set version to 2.2.0
151151

152+
Tue Apr 28 14:48:41 CEST 1998
153+
154+
- Put operator "->" back into parser. Note that :foo->bar means the
155+
C term, but :foo ->bar means the operator "->".
156+
157+
Tue Apr 28 15:49:07 CEST 1998
158+
159+
- Added exec sql disconnect command.
160+
- Allow varchar in C to be written in uppercase too.
161+
- Added whenever option "do break;"
162+
163+
Wed Apr 29 09:17:53 CEST 1998
164+
165+
- Corrected parsing of C comments.
166+
- Also allow C++ style comments.
167+
- Make sure not found is only checked after commands that could
168+
return it.
169+
- Added error codes, see ecpgerror.h for details.
170+
- Added "exec sql <TransactionStmt> release" as disconnect statement
171+
for compatibility issues.
172+
173+
Thu Apr 30 10:42:10 CEST 1998
174+
175+
- Added a -t option to disable automatic transaction start.
176+
- Added sqlerrd[] to sqlca struct.
177+
- Give back number of tuples affect in sqlca.sqlerrd[2].
178+
179+
Thu Apr 30 13:36:02 CEST 1998
180+
181+
- Make the return code different in case of different errors.
182+
183+
Wed May 6 11:42:48 CEST 1998
184+
185+
- Free memory if possible
186+
- Some bugfixes for bugs I found while changing the memory
187+
allocation code
188+
- Now able to fill complete array with one call (see test1.pgc for
189+
an example)
190+
- Set version to 2.3.0
191+
- Set library version to 2.1

src/interfaces/ecpg/TODO

+5-46
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,14 @@
1-
This list is still from Linus. MM
2-
3-
The variables should be static.
4-
5-
There should be different error numbers for the different errors instead of
6-
just -1 for them all.
7-
8-
Missing library functions to_date et al.
9-
10-
Oracle has array operations that enhances speed. When implementing it in
11-
ecpg it is done for compatibility reasons only. For them to improve speed
12-
would require a lot more insight in the postgres internal mechanisms than I
13-
possess.
14-
15-
As well as complex types like records and arrays, typedefs would be a good
16-
thing to take care of.
17-
18-
To set up a database you need a few scripts with table definitions and other
19-
configuration parameters. If you have these scripts for an old database you
20-
would like to just apply them to get a postgres database that works in the
21-
same way. The functionality could be accomplished with some conversion
22-
scripts. Speed will never be accomplished in this way. To do this you need a
23-
bigger insight in the database construction and the use of the database than
24-
could be realised in a script.
25-
26-
Now comes my list (MM):
27-
28-
The return code is alway -1 in case of an error. You cannot see which error
29-
occured by examining the return code.
30-
311
ecpg does not understand enum datatypes.
322

33-
There is no exec sql prepare statement.
34-
353
The complete structure definition has to be listed inside the declare
36-
section for ecpg to be able to understand it.
4+
section of the structure variable for ecpg to be able to understand it.
375

38-
There is no way yet to fill a complete array with one call except arrays of
39-
[unsigned] char which are considered strings.
6+
Variable type bool has to be checked. I never used it so far.
407

418
ecpg cannot use pointer variables except [unsigned] char *
429

43-
give back the number of tuples affected via sqlca
10+
There is no exec sql type statement which is the SQL version of a typedef.
4411

45-
exec sql disconnect {current|default|all|connectionname|connection_hostvar};
46-
oder <disconnect statement> ::=
47-
DISCONNECT <disconnect object>
48-
49-
<disconnect object> ::=
50-
<connection object>
51-
| ALL
52-
| CURRENT
53-
commit release|commit work release auch disconnect
12+
There is no exec sql prepare statement.
5413

55-
It is not neccessary to check for "not found" after all commands.
14+
There is no SQLSTATE

src/interfaces/ecpg/include/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ all clean::
66
@echo Nothing to be done.
77

88
install::
9+
$(INSTALL) $(INSTLOPTS) ecpgerrno.h $(DESTDIR)$(HEADERDIR)
910
$(INSTALL) $(INSTLOPTS) ecpglib.h $(DESTDIR)$(HEADERDIR)
1011
$(INSTALL) $(INSTLOPTS) ecpgtype.h $(DESTDIR)$(HEADERDIR)
1112
$(INSTALL) $(INSTLOPTS) sqlca.h $(DESTDIR)$(HEADERDIR)
1213

1314
uninstall::
15+
rm -f $(DESTDIR)$(HEADERDIR)/ecpgerrno.h
1416
rm -f $(DESTDIR)$(HEADERDIR)/ecpglib.h
1517
rm -f $(DESTDIR)$(HEADERDIR)/ecpgtype.h
1618
rm -f $(DESTDIR)$(HEADERDIR)/sqlca.h
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef _ECPG_ERROR_H
2+
#define _ECPG_ERROR_H
3+
4+
/* This is a list of all error codes the embedded SQL program can return */
5+
#define ECPG_NO_ERROR 0
6+
#define ECPG_NOT_FOUND 100
7+
8+
#define ECPG_PGSQL -1
9+
#define ECPG_UNSUPPORTED -2
10+
#define ECPG_TOO_MANY_ARGUMENTS -3
11+
#define ECPG_TOO_FEW_ARGUMENTS -4
12+
#define ECPG_TRANS -5
13+
#define ECPG_TOO_MANY_MATCHES -6
14+
#define ECPG_INT_FORMAT -7
15+
#define ECPG_UINT_FORMAT -8
16+
#define ECPG_FLOAT_FORMAT -9
17+
#define ECPG_CONVERT_BOOL -10
18+
#define ECPG_EMPTY -11
19+
#define ECPG_CONNECT -12
20+
#define ECPG_DISCONNECT -13
21+
22+
#endif /* !_ECPG_ERROR_H */

src/interfaces/ecpg/include/ecpglib.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ extern "C" {
55
#endif
66

77
void ECPGdebug(int, FILE *);
8-
bool ECPGconnect(const char *dbname);
8+
bool ECPGconnect(const char *);
99
bool ECPGdo(int, char *,...);
1010
bool ECPGtrans(int, const char *);
1111
bool ECPGfinish(void);
12-
bool ECPGstatus(void);
12+
bool ECPGdisconnect(const char *);
1313

1414
void ECPGlog(const char *format,...);
1515

@@ -39,3 +39,5 @@ void sqlprint(void);
3939
#ifdef __cplusplus
4040
}
4141
#endif
42+
43+
#include <ecpgerrno.h>

src/interfaces/ecpg/include/sqlca.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ struct sqlca
1010
int sqlcode;
1111
struct
1212
{
13-
int sqlerrml;
13+
int sqlerrml;
1414
char sqlerrmc[1000];
1515
} sqlerrm;
16-
} sqlca;
16+
long sqlerrd[6];
17+
} sqlca;
1718

1819
#endif
1920

src/interfaces/ecpg/lib/Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include $(SRCDIR)/Makefile.global
44
PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq
55

66
SO_MAJOR_VERSION=2
7-
SO_MINOR_VERSION=0
7+
SO_MINOR_VERSION=1
88

99
PORTNAME=@PORTNAME@
1010

0 commit comments

Comments
 (0)