Skip to content

Commit db921be

Browse files
committed
From: "Dr. Michael Meskes" <meskes@online-club.de> + Thu Jul 2 20:30:14 CEST 1998 + + - Changed new style db name to allow connection types "tcp" and + "unix" only + + Tue Jul 7 15:14:14 CEST 1998 + + - Fixed some bugs in preproc.y + - Set version to 2.3.4
1 parent f8a4746 commit db921be

File tree

6 files changed

+32
-4
lines changed

6 files changed

+32
-4
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,13 @@ Wed Jun 3 13:38:57 CEST 1998
248248
CREATE RULE
249249
- Set library version to 2.3
250250
- Set version to 2.3.3
251+
252+
Thu Jul 2 20:30:14 CEST 1998
253+
254+
- Changed new style db name to allow connection types "tcp" and
255+
"unix" only
256+
257+
Tue Jul 7 15:14:14 CEST 1998
258+
259+
- Fixed some bugs in preproc.y
260+
- Set version to 2.3.4

src/interfaces/ecpg/lib/ecpglib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,9 @@ ECPGdisconnect(int lineno, const char *connection_name)
895895
return false;
896896
}
897897
else
898+
{
898899
ECPGfinish(con);
900+
}
899901
}
900902

901903
return true;

src/interfaces/ecpg/preproc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
33

44
MAJOR_VERSION=2
55
MINOR_VERSION=3
6-
PATCHLEVEL=3
6+
PATCHLEVEL=4
77

88
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
99
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4032,12 +4032,24 @@ connection_target: database_name opt_server opt_port
40324032
}
40334033
| db_prefix server opt_port '/' database_name opt_options
40344034
{
4035-
/* new style: esql:postgresql://server[:port][/dbname] */
4035+
/* new style: <tcp|unix>:postgresql://server[:port][/dbname] */
40364036
if (strncmp($2, "://", 3) != 0)
40374037
{
40384038
sprintf(errortext, "parse error at or near '%s'", $2);
40394039
yyerror(errortext);
40404040
}
4041+
4042+
if (strncmp($1, "unix", 4) == 0 && strncmp($2, "localhost", 9) != 0)
4043+
{
4044+
sprintf(errortext, "unix domain sockets only work on 'localhost'");
4045+
yyerror(errortext);
4046+
}
4047+
4048+
if (strncmp($1, "unix", 4) != 0 && strncmp($1, "tcp", 3) != 0)
4049+
{
4050+
sprintf(errortext, "only protocols 'tcp' and 'unix' are supported");
4051+
yyerror(errortext);
4052+
}
40414053

40424054
$$ = make4_str(make5_str(make1_str("\""), $1, $2, $3, make1_str("/")), $5, $6, make1_str("\""));
40434055
}
@@ -4061,7 +4073,7 @@ db_prefix: ident cvariable
40614073
yyerror(errortext);
40624074
}
40634075

4064-
if (strcmp($1, "esql") != 0 && strcmp($1, "ecpg") != 0 && strcmp($1, "sql") != 0 && strcmp($1, "isql") != 0 && strcmp($1, "proc") != 0)
4076+
if (strcmp($1, "tcp") != 0 && strcmp($1, "unix") != 0)
40654077
{
40664078
sprintf(errortext, "Illegal connection type %s", $1);
40674079
yyerror(errortext);

src/interfaces/ecpg/preproc/type.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ ECPGdump_a_struct(FILE *o, const char *name, const char * ind_name, long arrsiz,
291291
offset = obuf;
292292
}
293293
else
294+
{
294295
offset = offsetarg;
296+
}
295297

296298
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);
297299
prefix = pbuf;
@@ -347,7 +349,9 @@ ECPGfree_type(struct ECPGtype * typ)
347349
free(typ->u.members);
348350
}
349351
else
352+
{
350353
abort();
354+
}
351355
}
352356
free(typ);
353357
}

src/interfaces/ecpg/test/test2.pgc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exec sql end declare section;
2626
ECPGdebug(1, dbgs);
2727

2828
strcpy(msg, "connect");
29-
exec sql connect to mm;
29+
exec sql connect to tcp:postgresql://localhost:5432/mm;
3030

3131
strcpy(msg, "create");
3232
exec sql create table meskes(name char(8), born integer, age smallint, married char(8));

0 commit comments

Comments
 (0)