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

Commit9a94629

Browse files
committed
Don't dump core if pq_comm_reset() is called before pq_init().
This can happen if an error occurs in a standalone backend. This bugwas introduced by commit2bd9e41.Reported by Álvaro Herrera.
1 parent5ede3a3 commit9a94629

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ char *Unix_socket_group;
105105
/* Where the Unix socket files are (list of palloc'd strings) */
106106
staticList*sock_paths=NIL;
107107

108-
PQcommMethods*PqCommMethods;
109-
110-
111108
/*
112109
* Buffers for low-level I/O.
113110
*
@@ -154,8 +151,6 @@ static intLock_AF_UNIX(char *unixSocketDir, char *unixSocketPath);
154151
staticintSetup_AF_UNIX(char*sock_path);
155152
#endif/* HAVE_UNIX_SOCKETS */
156153

157-
PQcommMethodsPQcommSocketMethods;
158-
159154
staticPQcommMethodsPqCommSocketMethods= {
160155
socket_comm_reset,
161156
socket_flush,
@@ -167,6 +162,9 @@ static PQcommMethods PqCommSocketMethods = {
167162
socket_endcopyout
168163
};
169164

165+
PQcommMethods*PqCommMethods=&PqCommSocketMethods;
166+
167+
170168

171169
/* --------------------------------
172170
*pq_init - initialize libpq at backend startup
@@ -175,7 +173,6 @@ static PQcommMethods PqCommSocketMethods = {
175173
void
176174
pq_init(void)
177175
{
178-
PqCommMethods=&PqCommSocketMethods;
179176
PqSendBufferSize=PQ_SEND_BUFFER_SIZE;
180177
PqSendBuffer=MemoryContextAlloc(TopMemoryContext,PqSendBufferSize);
181178
PqSendPointer=PqSendStart=PqRecvPointer=PqRecvLength=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp