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

Commitf7bd0a3

Browse files
committed
Prevent CRLF conversion of inputs in json_parser test module
Do this by opening the file in PG_BINARY_R mode. This prevents us fromgetting wrong byte count from stat().Per complaint from Andres FreundDiscussion:https://postgr.es/m/20240707052030.r77hbdkid3mwksop@awork3.anarazel.deBackpatch to rlease 17 where this code was introduced
1 parent896cd26 commitf7bd0a3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/test/modules/test_json_parser/test_json_parser_incremental.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ main(int argc, char **argv)
124124
makeJsonLexContextIncremental(&lex,PG_UTF8,need_strings);
125125
initStringInfo(&json);
126126

127-
if ((json_file=fopen(testfile,"r"))==NULL)
127+
if ((json_file=fopen(testfile,PG_BINARY_R))==NULL)
128128
pg_fatal("error opening input: %m");
129129

130130
if (fstat(fileno(json_file),&statbuf)!=0)

‎src/test/modules/test_json_parser/test_json_parser_perf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ main(int argc, char **argv)
5555

5656
sscanf(argv[1],"%d",&iter);
5757

58-
if ((json_file=fopen(argv[2],"r"))==NULL)
58+
if ((json_file=fopen(argv[2],PG_BINARY_R))==NULL)
5959
pg_fatal("Could not open input file '%s': %m",argv[2]);
6060

6161
while ((n_read=fread(buff,1,6000,json_file))>0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp