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

Commita68a894

Browse files
committed
Fix setvbuf()-induced crash in libpq_pipeline
Windows doesn't like setvbuf(..., _IOLBF) and crashes if you use it,which has been causing the libpq_pipeline failures all along ... and ourown port.h has known about it for a long time: it offers PG_IOLBF that'sdefined to _IONBF on that platform. Follow its advice.While at it, get rid of a bogus bitshift that used a constant of thewrong size. Decorate the constant as LL to fix. While at it, remove apointless addition that only confused matters.All as diagnosed by Tom Lane.Discussion:https://postgr.es/m/3458958.1617302154@sss.pgh.pa.us
1 parent3b6c125 commita68a894

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/test/modules/libpq_pipeline/libpq_pipeline.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,8 @@ test_pipelined_insert(PGconn *conn, int n_rows)
724724
if (send_step==BI_INSERT_ROWS)
725725
{
726726
snprintf(insert_param_0,MAXINTLEN,"%d",rows_to_send);
727-
snprintf(insert_param_1,MAXINT8LEN,"%lld",
728-
(1L <<62)+ (long long)rows_to_send);
727+
/* use up some buffer space with a wide value */
728+
snprintf(insert_param_1,MAXINT8LEN,"%lld",1LL <<62);
729729

730730
if (PQsendQueryPrepared(conn,"my_insert",
731731
2,insert_params,NULL,NULL,0)==1)
@@ -1324,7 +1324,7 @@ main(int argc, char **argv)
13241324
pg_fatal("could not open file \"%s\": %m",tracefile);
13251325

13261326
/* Make it line-buffered */
1327-
setvbuf(trace,NULL,_IOLBF,0);
1327+
setvbuf(trace,NULL,PG_IOLBF,0);
13281328

13291329
PQtrace(conn,trace);
13301330
PQtraceSetFlags(conn,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp