Skip to content

Commit 35ba9de

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent 988d53e commit 35ba9de

File tree

16 files changed

+1002
-22
lines changed

16 files changed

+1002
-22
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,5 +809,10 @@ Tue Feb 15 17:39:19 CET 2000
809809
Wed Feb 16 11:57:02 CET 2000
810810

811811
- Fixed library to be able to input complete arrays.
812+
813+
Wed Feb 16 17:04:41 CET 2000
814+
815+
- Apply patch by Christof Petig <christof.petig@wtal.de> that adds
816+
descriptors.
812817
- Set library version to 3.1.0.
813818
- Set ecpg version to 2.7.0.

src/interfaces/ecpg/README.dynSQL

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
descriptor statements have the following shortcomings
2+
3+
- up to now the only reasonable statement is
4+
FETCH ... INTO SQL DESCRIPTOR <name>
5+
no input variables allowed!
6+
7+
Reason: to fully support dynamic SQL the frontend/backend communication
8+
should change to recognize input parameters.
9+
Since this is not likely to happen in the near future and you
10+
can cover the same functionality with the existing infrastructure
11+
I'll leave the work to someone else.
12+
13+
- string buffer overflow does not always generate warnings
14+
(beware: terminating 0 may be missing because strncpy is used)
15+
:var=data sets sqlwarn accordingly (but not indicator)
16+
17+
- char variables pointing to NULL are not allocated on demand
18+
19+
- string truncation does not show up in indicator
20+

src/interfaces/ecpg/TODO

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ cvariable for an array var
1818

1919
How can one insert arrays from c variables?
2020

21-
support for dynamic SQL with unknown number of variables with DESCRIPTORS
22-
2321
What happens to the output variable during read if there was an
2422
indicator-error?
2523

src/interfaces/ecpg/include/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ install::
1010
$(INSTALL) $(INSTLOPTS) ecpglib.h $(HEADERDIR)
1111
$(INSTALL) $(INSTLOPTS) ecpgtype.h $(HEADERDIR)
1212
$(INSTALL) $(INSTLOPTS) sqlca.h $(HEADERDIR)
13+
$(INSTALL) $(INSTLOPTS) sql3types.h $(HEADERDIR)
1314

1415
uninstall::
1516
rm -f $(HEADERDIR)/ecpgerrno.h
1617
rm -f $(HEADERDIR)/ecpglib.h
1718
rm -f $(HEADERDIR)/ecpgtype.h
1819
rm -f $(HEADERDIR)/sqlca.h
20+
rm -f $(HEADERDIR)/sql3types.h
1921

2022
dep depend:

src/interfaces/ecpg/include/ecpgerrno.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929

3030
#define ECPG_INVALID_STMT -230
3131

32+
/* dynamic SQL related */
33+
#define ECPG_UNKNOWN_DESCRIPTOR -240
34+
#define ECPG_INVALID_DESCRIPTOR_INDEX -241
35+
3236
/* finally the backend error messages, they start at 400 */
3337
#define ECPG_PGSQL -400
3438
#define ECPG_TRANS -401

src/interfaces/ecpg/include/ecpglib.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <postgres.h>
2+
#include <libpq-fe.h>
23

34
#ifdef __cplusplus
45
extern "C"
@@ -49,6 +50,17 @@ extern "C"
4950

5051
#define SQLCODE sqlca.sqlcode
5152

53+
/* dynamic SQL */
54+
55+
unsigned int ECPGDynamicType(Oid type);
56+
unsigned int ECPGDynamicType_DDT(Oid type);
57+
PGresult * ECPGresultByDescriptor(int line,const char *name);
58+
bool ECPGdo_descriptor(int line,const char *connection,
59+
const char *descriptor,const char *query);
60+
bool ECPGdeallocate_desc(int line,const char *name);
61+
bool ECPGallocate_desc(int line,const char *name);
62+
void ECPGraise(int line,int code);
63+
5264
#ifdef __cplusplus
5365
}
5466

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* SQL3 dynamic type codes
2+
*
3+
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
4+
*
5+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/include/sql3types.h,v 1.1 2000/02/16 16:18:03 meskes Exp $
6+
*/
7+
8+
/* chapter 13.1 table 2: Codes used for SQL data types in Dynamic SQL */
9+
10+
enum { SQL3_CHARACTER=1,
11+
SQL3_NUMERIC,
12+
SQL3_DECIMAL,
13+
SQL3_INTEGER,
14+
SQL3_SMALLINT,
15+
SQL3_FLOAT,
16+
SQL3_REAL,
17+
SQL3_DOUBLE_PRECISION,
18+
SQL3_DATE_TIME_TIMESTAMP,
19+
SQL3_INTERVAL, //10
20+
SQL3_CHARACTER_VARYING=12,
21+
SQL3_ENUMERATED,
22+
SQL3_BIT,
23+
SQL3_BIT_VARYING,
24+
SQL3_BOOLEAN,
25+
SQL3_abstract
26+
// the rest is xLOB stuff
27+
};
28+
29+
/* chapter 13.1 table 3: Codes associated with datetime data types in Dynamic SQL */
30+
31+
enum { SQL3_DDT_DATE=1,
32+
SQL3_DDT_TIME,
33+
SQL3_DDT_TIMESTAMP,
34+
SQL3_DDT_TIME_WITH_TIME_ZONE,
35+
SQL3_DDT_TIMESTAMP_WITH_TIME_ZONE,
36+
37+
SQL3_DDT_ILLEGAL /* not a datetime data type (not part of standard) */
38+
};

src/interfaces/ecpg/lib/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1994, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.57 2000/02/16 11:52:24 meskes Exp $
9+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.58 2000/02/16 16:18:05 meskes Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -36,7 +36,7 @@ include $(SRCDIR)/Makefile.shlib
3636
install: install-lib $(install-shlib-dep)
3737

3838
# Handmade dependencies in case make depend not done
39-
ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h
39+
ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h dynamic.c
4040
typename.o : typename.c ../include/ecpgtype.h
4141

4242

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy