mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
And one more:
Connection identifier has to be unique
This commit is contained in:
parent
72ba3cb50f
commit
9e76b4c7c5
@ -2050,5 +2050,6 @@ Fr Jul 28 11:00:51 CEST 2006
|
|||||||
- Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
|
- Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
|
||||||
- SHOW statement puts result into a variable
|
- SHOW statement puts result into a variable
|
||||||
- COPY TO STDOUT works
|
- COPY TO STDOUT works
|
||||||
|
- Connection identifier has to be unique
|
||||||
- Set ecpg library version to 5.2.
|
- Set ecpg library version to 5.2.
|
||||||
- Set ecpg version to 4.2.1.
|
- Set ecpg version to 4.2.1.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.30 2006/06/21 11:38:07 meskes Exp $ */
|
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.31 2006/07/28 10:10:42 meskes Exp $ */
|
||||||
|
|
||||||
#define POSTGRES_ECPG_INTERNAL
|
#define POSTGRES_ECPG_INTERNAL
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
@ -295,12 +295,21 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((this = (struct connection *) ECPGalloc(sizeof(struct connection), lineno)) == NULL)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (dbname == NULL && connection_name == NULL)
|
if (dbname == NULL && connection_name == NULL)
|
||||||
connection_name = "DEFAULT";
|
connection_name = "DEFAULT";
|
||||||
|
|
||||||
|
/* check if the identifier is unique */
|
||||||
|
if (ECPGget_connection(connection_name))
|
||||||
|
{
|
||||||
|
ECPGfree(dbname);
|
||||||
|
ECPGlog("connect: connection identifier %s is already in use\n",
|
||||||
|
connection_name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((this = (struct connection *) ECPGalloc(sizeof(struct connection), lineno)) == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (dbname != NULL)
|
if (dbname != NULL)
|
||||||
{
|
{
|
||||||
/* get the detail information out of dbname */
|
/* get the detail information out of dbname */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user