Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e76b4c

Browse files
author
Michael Meskes
committed
And one more:
Connection identifier has to be unique
1 parent72ba3cb commit9e76b4c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,5 +2050,6 @@ Fr Jul 28 11:00:51 CEST 2006
20502050
- Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
20512051
- SHOW statement puts result into a variable
20522052
- COPY TO STDOUT works
2053+
- Connection identifier has to be unique
20532054
- Set ecpg library version to 5.2.
20542055
- Set ecpg version to 4.2.1.

‎src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.30 2006/06/21 11:38:07 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.31 2006/07/28 10:10:42 meskes Exp $ */
22

33
#definePOSTGRES_ECPG_INTERNAL
44
#include"postgres_fe.h"
@@ -295,12 +295,21 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
295295

296296
}
297297

298-
if ((this= (structconnection*)ECPGalloc(sizeof(structconnection),lineno))==NULL)
299-
return false;
300-
301298
if (dbname==NULL&&connection_name==NULL)
302299
connection_name="DEFAULT";
303300

301+
/* check if the identifier is unique */
302+
if (ECPGget_connection(connection_name))
303+
{
304+
ECPGfree(dbname);
305+
ECPGlog("connect: connection identifier %s is already in use\n",
306+
connection_name);
307+
return false;
308+
}
309+
310+
if ((this= (structconnection*)ECPGalloc(sizeof(structconnection),lineno))==NULL)
311+
return false;
312+
304313
if (dbname!=NULL)
305314
{
306315
/* get the detail information out of dbname */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp