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

Commiteb88926

Browse files
committed
Avoid performing encoding conversion on command tag strings during EndCommand.
Since all current and foreseeable future command tags will be pure ASCII,there is no need to do conversion on them. This saves a few cycles and alsoavoids polluting otherwise-pristine subtransaction memory contexts, whichis the cause of the backend memory leak exhibited in bug #5302. (Somedaywe'll probably want to have a better method of determining whethersubtransaction contexts need to be kept around, but today is not that day.)Backpatch to 8.0. The cycle-shaving aspect of this would work in 7.4too, but without subtransactions the memory-leak aspect doesn't apply,so it doesn't seem worth touching 7.4.
1 parent07be293 commiteb88926

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/backend/tcop/dest.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/dest.c,v 1.76 2010/01/02 16:57:52 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/dest.c,v 1.77 2010/01/30 20:09:53 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -142,7 +142,11 @@ EndCommand(const char *commandTag, CommandDest dest)
142142
{
143143
caseDestRemote:
144144
caseDestRemoteExecute:
145-
pq_puttextmessage('C',commandTag);
145+
/*
146+
* We assume the commandTag is plain ASCII and therefore
147+
* requires no encoding conversion.
148+
*/
149+
pq_putmessage('C',commandTag,strlen(commandTag)+1);
146150
break;
147151

148152
caseDestNone:
@@ -183,7 +187,7 @@ NullCommand(CommandDest dest)
183187
if (PG_PROTOCOL_MAJOR(FrontendProtocol) >=3)
184188
pq_putemptymessage('I');
185189
else
186-
pq_puttextmessage('I',"");
190+
pq_putmessage('I',"",1);
187191
break;
188192

189193
caseDestNone:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp