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

Commit434762b

Browse files
committed
Here is a patch.
I have changed to call pg_exec_query_dest() instead of pg_exec_query().Thanks.Hiroshi Inoue
1 parent7877860 commit434762b

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

‎src/backend/commands/dbcommands.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.31 1999/03/15 14:07:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.32 1999/03/16 03:24:16 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -24,13 +24,13 @@
2424
#include"catalog/catname.h"
2525
#include"catalog/pg_database.h"
2626
#include"catalog/pg_shadow.h"
27-
#include"commands/dbcommands.h"
2827
#include"fmgr.h"
2928
#include"miscadmin.h"/* for DataDir */
3029
#include"storage/bufmgr.h"
3130
#include"storage/fd.h"
3231
#include"storage/lmgr.h"
3332
#include"tcop/tcopprot.h"
33+
#include"commands/dbcommands.h"
3434
#include"utils/rel.h"
3535
#include"utils/syscache.h"
3636

@@ -42,7 +42,7 @@ static HeapTuple get_pg_dbtup(char *command, char *dbname, Relation dbrel);
4242
staticvoidstop_vacuum(char*dbpath,char*dbname);
4343

4444
void
45-
createdb(char*dbname,char*dbpath,intencoding)
45+
createdb(char*dbname,char*dbpath,intencoding,CommandDestdest)
4646
{
4747
Oiddb_id;
4848
int4user_id;
@@ -87,11 +87,11 @@ createdb(char *dbname, char *dbpath, int encoding)
8787
"insert into pg_database (datname, datdba, encoding, datpath)"
8888
" values ('%s', '%d', '%d', '%s');",dbname,user_id,encoding,loc);
8989

90-
pg_exec_query(buf);
90+
pg_exec_query_dest(buf,dest, false);
9191
}
9292

9393
void
94-
destroydb(char*dbname)
94+
destroydb(char*dbname,CommandDestdest)
9595
{
9696
int4user_id;
9797
Oiddb_id;
@@ -123,7 +123,7 @@ destroydb(char *dbname)
123123
*/
124124
snprintf(buf,512,
125125
"delete from pg_database where pg_database.oid = \'%d\'::oid",db_id);
126-
pg_exec_query(buf);
126+
pg_exec_query_dest(buf ,dest, false);
127127

128128
/* drop pages for this database that are in the shared buffer cache */
129129
DropBuffers(db_id);

‎src/backend/commands/user.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: user.c,v 1.24 1999/02/13 23:15:11 momjian Exp $
8+
* $Id: user.c,v 1.25 1999/03/16 03:24:16 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -46,7 +46,7 @@ static void CheckPgUserAclNotNull(void);
4646
*/
4747
static
4848
void
49-
UpdatePgPwdFile(char*sql)
49+
UpdatePgPwdFile(char*sql,CommandDestdest)
5050
{
5151

5252
char*filename,
@@ -71,7 +71,7 @@ UpdatePgPwdFile(char *sql)
7171
snprintf(sql,SQL_LENGTH,
7272
"copy %s to '%s' using delimiters %s",
7373
ShadowRelationName,tempname,CRYPT_PWD_FILE_SEPCHAR);
74-
pg_exec_query(sql);
74+
pg_exec_query_dest(sql,dest, false);
7575
rename(tempname,filename);
7676
pfree((void*)tempname);
7777

@@ -92,7 +92,7 @@ UpdatePgPwdFile(char *sql)
9292
*---------------------------------------------------------------------
9393
*/
9494
void
95-
DefineUser(CreateUserStmt*stmt)
95+
DefineUser(CreateUserStmt*stmt,CommandDestdest)
9696
{
9797

9898
char*pg_shadow,
@@ -175,13 +175,13 @@ DefineUser(CreateUserStmt *stmt)
175175
stmt->password ?stmt->password :"''",
176176
stmt->validUntil ?stmt->validUntil :"");
177177

178-
pg_exec_query(sql);
178+
pg_exec_query_dest(sql,dest, false);
179179

180180
/*
181181
* Add the stuff here for groups.
182182
*/
183183

184-
UpdatePgPwdFile(sql);
184+
UpdatePgPwdFile(sql,dest);
185185

186186
/*
187187
* This goes after the UpdatePgPwdFile to be certain that two backends
@@ -196,7 +196,7 @@ DefineUser(CreateUserStmt *stmt)
196196

197197

198198
externvoid
199-
AlterUser(AlterUserStmt*stmt)
199+
AlterUser(AlterUserStmt*stmt,CommandDestdest)
200200
{
201201

202202
char*pg_shadow,
@@ -282,11 +282,11 @@ AlterUser(AlterUserStmt *stmt)
282282

283283
snprintf(sql,SQL_LENGTH,"%s where usename = '%s'",sql,stmt->user);
284284

285-
pg_exec_query(sql);
285+
pg_exec_query_dest(sql,dest, false);
286286

287287
/* do the pg_group stuff here */
288288

289-
UpdatePgPwdFile(sql);
289+
UpdatePgPwdFile(sql,dest);
290290

291291
UnlockRelation(pg_shadow_rel,AccessExclusiveLock);
292292
heap_close(pg_shadow_rel);
@@ -297,7 +297,7 @@ AlterUser(AlterUserStmt *stmt)
297297

298298

299299
externvoid
300-
RemoveUser(char*user)
300+
RemoveUser(char*user,CommandDestdest)
301301
{
302302

303303
char*pg_shadow;
@@ -390,7 +390,7 @@ RemoveUser(char *user)
390390
elog(NOTICE,"Dropping database %s",dbase[ndbase]);
391391
snprintf(sql,SQL_LENGTH,"drop database %s",dbase[ndbase]);
392392
pfree((void*)dbase[ndbase]);
393-
pg_exec_query(sql);
393+
pg_exec_query_dest(sql,dest, false);
394394
}
395395
if (dbase)
396396
pfree((void*)dbase);
@@ -418,9 +418,9 @@ RemoveUser(char *user)
418418
*/
419419
snprintf(sql,SQL_LENGTH,
420420
"delete from %s where usename = '%s'",ShadowRelationName,user);
421-
pg_exec_query(sql);
421+
pg_exec_query_dest(sql,dest, false);
422422

423-
UpdatePgPwdFile(sql);
423+
UpdatePgPwdFile(sql,dest);
424424

425425
UnlockRelation(pg_shadow_rel,AccessExclusiveLock);
426426
heap_close(pg_shadow_rel);

‎src/backend/tcop/utility.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.57 1999/02/25 17:25:47 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.58 1999/03/16 03:24:17 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -56,9 +56,9 @@
5656
#include"utils/syscache.h"
5757
#endif
5858

59-
voidDefineUser(CreateUserStmt*stmt);
60-
voidAlterUser(AlterUserStmt*stmt);
61-
voidRemoveUser(char*username);
59+
voidDefineUser(CreateUserStmt*stmt,CommandDest);
60+
voidAlterUser(AlterUserStmt*stmt,CommandDest);
61+
voidRemoveUser(char*username,CommandDest);
6262

6363
/* ----------------
6464
*CHECK_IF_ABORTED() is used to avoid doing unnecessary
@@ -557,7 +557,7 @@ ProcessUtility(Node *parsetree,
557557

558558
PS_SET_STATUS(commandTag="CREATEDB");
559559
CHECK_IF_ABORTED();
560-
createdb(stmt->dbname,stmt->dbpath,stmt->encoding);
560+
createdb(stmt->dbname,stmt->dbpath,stmt->encoding,dest);
561561
}
562562
break;
563563

@@ -567,7 +567,7 @@ ProcessUtility(Node *parsetree,
567567

568568
PS_SET_STATUS(commandTag="DESTROYDB");
569569
CHECK_IF_ABORTED();
570-
destroydb(stmt->dbname);
570+
destroydb(stmt->dbname,dest);
571571
}
572572
break;
573573

@@ -749,21 +749,21 @@ ProcessUtility(Node *parsetree,
749749
PS_SET_STATUS(commandTag="CREATE USER");
750750
CHECK_IF_ABORTED();
751751

752-
DefineUser((CreateUserStmt*)parsetree);
752+
DefineUser((CreateUserStmt*)parsetree,dest);
753753
break;
754754

755755
caseT_AlterUserStmt:
756756
PS_SET_STATUS(commandTag="ALTER USER");
757757
CHECK_IF_ABORTED();
758758

759-
AlterUser((AlterUserStmt*)parsetree);
759+
AlterUser((AlterUserStmt*)parsetree,dest);
760760
break;
761761

762762
caseT_DropUserStmt:
763763
PS_SET_STATUS(commandTag="DROP USER");
764764
CHECK_IF_ABORTED();
765765

766-
RemoveUser(((DropUserStmt*)parsetree)->user);
766+
RemoveUser(((DropUserStmt*)parsetree)->user,dest);
767767
break;
768768

769769
caseT_LockStmt:

‎src/include/commands/dbcommands.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: dbcommands.h,v 1.7 1999/02/13 23:21:18 momjian Exp $
9+
* $Id: dbcommands.h,v 1.8 1999/03/16 03:24:18 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -19,7 +19,7 @@
1919
*/
2020
#defineSIGKILLDAEMON1SIGTERM
2121

22-
externvoidcreatedb(char*dbname,char*dbpath,intencoding);
23-
externvoiddestroydb(char*dbname);
22+
externvoidcreatedb(char*dbname,char*dbpath,intencoding,CommandDest);
23+
externvoiddestroydb(char*dbname,CommandDest);
2424

2525
#endif/* DBCOMMANDS_H */

‎src/include/commands/user.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#ifndefUSER_H
1111
#defineUSER_H
1212

13-
externvoidDefineUser(CreateUserStmt*stmt);
14-
externvoidAlterUser(AlterUserStmt*stmt);
15-
externvoidRemoveUser(char*user);
13+
externvoidDefineUser(CreateUserStmt*stmt,CommandDest);
14+
externvoidAlterUser(AlterUserStmt*stmt,CommandDest);
15+
externvoidRemoveUser(char*user,CommandDest);
1616

1717
#endif/* USER_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp