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

Commitc02aae4

Browse files
committed
Fix "pg_bench -C -M prepared".
This didn't work because when we dropped and re-established a databaseconnection, we did not bother to reset session-specific state such asthe statements-are-prepared flags.The st->prepared[] array certainly needs to be flushed, and I cleared acouple of other fields as well that couldn't possibly retain meaningfulstate for a new connection.In passing, fix some bogus comments and strange field order choices.Per report from Robins Tharakan.
1 parentcfc5357 commitc02aae4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎contrib/pgbench/pgbench.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ typedef struct
201201
intstate;/* state No. */
202202
intcnt;/* xacts count */
203203
intecnt;/* error count */
204-
intlisten;/*0 indicates that an async query has been
204+
intlisten;/*1 indicates that an async query has been
205205
* sent */
206206
intsleeping;/* 1 indicates that the client is napping */
207207
int64until;/* napping until (usec) */
@@ -1115,6 +1115,11 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
11151115
}
11161116
INSTR_TIME_SET_CURRENT(end);
11171117
INSTR_TIME_ACCUM_DIFF(*conn_time,end,start);
1118+
1119+
/* Reset session-local state */
1120+
st->listen=0;
1121+
st->sleeping=0;
1122+
memset(st->prepared,0,sizeof(st->prepared));
11181123
}
11191124

11201125
/* Record transaction start time if logging is enabled */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp