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

Commit47211af

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 parent5db5146 commit47211af

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/bin/pgbench/pgbench.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ typedef struct
230230
intid;/* client No. */
231231
intstate;/* state No. */
232232
boollisten;/* whether an async query has been sent */
233-
boolis_throttled;/* whether transaction throttling is done */
234233
boolsleeping;/* whether the client is napping */
235234
boolthrottling;/* whether nap is for throttling */
235+
boolis_throttled;/* whether transaction throttling is done */
236236
Variable*variables;/* array of variable definitions */
237237
intnvariables;
238238
int64txn_scheduled;/* scheduled start time of transaction (usec) */
@@ -1522,6 +1522,13 @@ doCustom(TState *thread, CState *st, StatsData *agg)
15221522
}
15231523
INSTR_TIME_SET_CURRENT(end);
15241524
INSTR_TIME_ACCUM_DIFF(thread->conn_time,end,start);
1525+
1526+
/* Reset session-local state */
1527+
st->listen= false;
1528+
st->sleeping= false;
1529+
st->throttling= false;
1530+
st->is_throttled= false;
1531+
memset(st->prepared,0,sizeof(st->prepared));
15251532
}
15261533

15271534
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp