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

Commit 32a4c30

Browse files
author
Michael Meskes
committed
Added Christof's patches.
1 parent ebb9332 commit 32a4c30

File tree

16 files changed

+281
-200
lines changed

16 files changed

+281
-200
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,5 +1146,9 @@ Sun Oct 21 14:19:42 CEST 2001
11461146
Fri Nov 2 16:16:25 CET 2001
11471147

11481148
- Synced preproc.y with gram.y.
1149+
1150+
Wed Nov 14 11:50:27 CET 2001
1151+
1152+
- Added several patches by Christof Petig <christof.petig@wtal.de>.
11491153
- Set ecpg version to 2.9.0.
11501154
- Set library version to 3.3.0.

src/interfaces/ecpg/README.dynSQL

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
descriptor statements have the following shortcomings
22

3-
- up to now the only reasonable statement is
4-
FETCH ... INTO SQL DESCRIPTOR <name>
5-
no input variables allowed!
3+
- input descriptors (USING DESCRIPTOR <name>) are not supported
64

75
Reason: to fully support dynamic SQL the frontend/backend communication
86
should change to recognize input parameters.
97
Since this is not likely to happen in the near future and you
108
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
9+
(using s[n]printf), I'll leave the work to someone else.
2010

src/interfaces/ecpg/include/ecpglib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ void ECPGraise(int line, int code, const char *str);
6767
bool ECPGget_desc_header(int, char *, int *);
6868
bool ECPGget_desc(int, char *, int,...);
6969

70+
/* dynamic result allocation */
71+
void ECPGfree_auto_mem(void);
7072

7173
#ifdef __cplusplus
7274
}

src/interfaces/ecpg/lib/connect.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/connect.c,v 1.14 2001/10/31 04:49:44 momjian Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/connect.c,v 1.15 2001/11/14 11:11:49 meskes Exp $ */
22

33
#include "postgres_fe.h"
44

@@ -12,7 +12,7 @@ static struct connection *all_connections = NULL,
1212
*actual_connection = NULL;
1313

1414
struct connection *
15-
get_connection(const char *connection_name)
15+
ECPGget_connection(const char *connection_name)
1616
{
1717
struct connection *con = all_connections;
1818

@@ -63,10 +63,10 @@ ecpg_finish(struct connection * act)
6363
bool
6464
ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
6565
{
66-
struct connection *con = get_connection(connection_name);
66+
struct connection *con = ECPGget_connection(connection_name);
6767
PGresult *results;
6868

69-
if (!ecpg_init(con, connection_name, lineno))
69+
if (!ECPGinit(con, connection_name, lineno))
7070
return (false);
7171

7272
ECPGlog("ECPGsetcommit line %d action = %s connection = %s\n", lineno, mode, con->name);
@@ -106,9 +106,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
106106
bool
107107
ECPGsetconn(int lineno, const char *connection_name)
108108
{
109-
struct connection *con = get_connection(connection_name);
109+
struct connection *con = ECPGget_connection(connection_name);
110110

111-
if (!ecpg_init(con, connection_name, lineno))
111+
if (!ECPGinit(con, connection_name, lineno))
112112
return (false);
113113

114114
actual_connection = con;
@@ -269,9 +269,9 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd,
269269
*realname = NULL,
270270
*options = NULL;
271271

272-
init_sqlca();
272+
ECPGinit_sqlca();
273273

274-
if ((this = (struct connection *) ecpg_alloc(sizeof(struct connection), lineno)) == NULL)
274+
if ((this = (struct connection *) ECPGalloc(sizeof(struct connection), lineno)) == NULL)
275275
return false;
276276

277277
if (dbname == NULL && connection_name == NULL)
@@ -393,9 +393,9 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd,
393393

394394
/* add connection to our list */
395395
if (connection_name != NULL)
396-
this->name = ecpg_strdup(connection_name, lineno);
396+
this->name = ECPGstrdup(connection_name, lineno);
397397
else
398-
this->name = ecpg_strdup(realname, lineno);
398+
this->name = ECPGstrdup(realname, lineno);
399399

400400
this->cache_head = NULL;
401401

@@ -465,7 +465,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
465465

466466
if (strcmp(connection_name, "ALL") == 0)
467467
{
468-
init_sqlca();
468+
ECPGinit_sqlca();
469469
for (con = all_connections; con;)
470470
{
471471
struct connection *f = con;
@@ -476,9 +476,9 @@ ECPGdisconnect(int lineno, const char *connection_name)
476476
}
477477
else
478478
{
479-
con = get_connection(connection_name);
479+
con = ECPGget_connection(connection_name);
480480

481-
if (!ecpg_init(con, connection_name, lineno))
481+
if (!ECPGinit(con, connection_name, lineno))
482482
return (false);
483483
else
484484
ecpg_finish(con);

src/interfaces/ecpg/lib/data.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/data.c,v 1.18 2001/11/05 17:46:37 momjian Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/data.c,v 1.19 2001/11/14 11:11:49 meskes Exp $ */
22

33
#include "postgres_fe.h"
44

@@ -12,14 +12,14 @@
1212
#include "sqlca.h"
1313

1414
bool
15-
get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
15+
ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
1616
enum ECPGttype type, enum ECPGttype ind_type,
1717
void *var, void *ind, long varcharsize, long offset,
1818
bool isarray)
1919
{
2020
char *pval = (char *) PQgetvalue(results, act_tuple, act_field);
2121

22-
ECPGlog("get_data line %d: RESULT: %s\n", lineno, pval ? pval : "");
22+
ECPGlog("ECPGget_data line %d: RESULT: %s\n", lineno, pval ? pval : "");
2323

2424
/* pval is a pointer to the value */
2525
/* let's check is it really is an array if it should be one */

0 commit comments

Comments
 (0)