Commit db921be3 authored by Marc G. Fournier's avatar Marc G. Fournier

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
parent f8a47462
...@@ -248,3 +248,13 @@ Wed Jun 3 13:38:57 CEST 1998 ...@@ -248,3 +248,13 @@ Wed Jun 3 13:38:57 CEST 1998
CREATE RULE CREATE RULE
- Set library version to 2.3 - Set library version to 2.3
- Set version to 2.3.3 - Set version to 2.3.3
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
...@@ -895,7 +895,9 @@ ECPGdisconnect(int lineno, const char *connection_name) ...@@ -895,7 +895,9 @@ ECPGdisconnect(int lineno, const char *connection_name)
return false; return false;
} }
else else
{
ECPGfinish(con); ECPGfinish(con);
}
} }
return true; return true;
......
...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global ...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION=2 MAJOR_VERSION=2
MINOR_VERSION=3 MINOR_VERSION=3
PATCHLEVEL=3 PATCHLEVEL=4
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
......
...@@ -4032,12 +4032,24 @@ connection_target: database_name opt_server opt_port ...@@ -4032,12 +4032,24 @@ connection_target: database_name opt_server opt_port
} }
| db_prefix server opt_port '/' database_name opt_options | db_prefix server opt_port '/' database_name opt_options
{ {
/* new style: esql:postgresql://server[:port][/dbname] */ /* new style: <tcp|unix>:postgresql://server[:port][/dbname] */
if (strncmp($2, "://", 3) != 0) if (strncmp($2, "://", 3) != 0)
{ {
sprintf(errortext, "parse error at or near '%s'", $2); sprintf(errortext, "parse error at or near '%s'", $2);
yyerror(errortext); yyerror(errortext);
} }
if (strncmp($1, "unix", 4) == 0 && strncmp($2, "localhost", 9) != 0)
{
sprintf(errortext, "unix domain sockets only work on 'localhost'");
yyerror(errortext);
}
if (strncmp($1, "unix", 4) != 0 && strncmp($1, "tcp", 3) != 0)
{
sprintf(errortext, "only protocols 'tcp' and 'unix' are supported");
yyerror(errortext);
}
$$ = make4_str(make5_str(make1_str("\""), $1, $2, $3, make1_str("/")), $5, $6, make1_str("\"")); $$ = make4_str(make5_str(make1_str("\""), $1, $2, $3, make1_str("/")), $5, $6, make1_str("\""));
} }
...@@ -4061,7 +4073,7 @@ db_prefix: ident cvariable ...@@ -4061,7 +4073,7 @@ db_prefix: ident cvariable
yyerror(errortext); yyerror(errortext);
} }
if (strcmp($1, "esql") != 0 && strcmp($1, "ecpg") != 0 && strcmp($1, "sql") != 0 && strcmp($1, "isql") != 0 && strcmp($1, "proc") != 0) if (strcmp($1, "tcp") != 0 && strcmp($1, "unix") != 0)
{ {
sprintf(errortext, "Illegal connection type %s", $1); sprintf(errortext, "Illegal connection type %s", $1);
yyerror(errortext); yyerror(errortext);
......
...@@ -291,7 +291,9 @@ ECPGdump_a_struct(FILE *o, const char *name, const char * ind_name, long arrsiz, ...@@ -291,7 +291,9 @@ ECPGdump_a_struct(FILE *o, const char *name, const char * ind_name, long arrsiz,
offset = obuf; offset = obuf;
} }
else else
{
offset = offsetarg; offset = offsetarg;
}
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name); sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);
prefix = pbuf; prefix = pbuf;
...@@ -347,7 +349,9 @@ ECPGfree_type(struct ECPGtype * typ) ...@@ -347,7 +349,9 @@ ECPGfree_type(struct ECPGtype * typ)
free(typ->u.members); free(typ->u.members);
} }
else else
{
abort(); abort();
}
} }
free(typ); free(typ);
} }
...@@ -26,7 +26,7 @@ exec sql end declare section; ...@@ -26,7 +26,7 @@ exec sql end declare section;
ECPGdebug(1, dbgs); ECPGdebug(1, dbgs);
strcpy(msg, "connect"); strcpy(msg, "connect");
exec sql connect to mm; exec sql connect to tcp:postgresql://localhost:5432/mm;
strcpy(msg, "create"); strcpy(msg, "create");
exec sql create table meskes(name char(8), born integer, age smallint, married char(8)); exec sql create table meskes(name char(8), born integer, age smallint, married char(8));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment