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

Commita598385

Browse files
committed
Our code had:
if (c == '\\' && cstate->line_buf.len == 0)The problem with that is the because of the input and _output_buffering, cstate->line_buf.len could be zero even if we are not on thefirst character of a line. In fact, for a typical line, it is zero forall characters on the line. The proper solution is to introduce aboolean, first_char_in_line, that we set as we enter the loop and clearonce we process a character.I have restructured the line-reading code in copy.c by: o merging the CSV/non-CSV functions into a single function o used macros to centralize and clarify the buffering code o updated comments o renamed client_encoding_only to encoding_embeds_ascii o added a high-bit test to the encoding_embeds_ascii test for performance o in CSV mode, allow a backslash followed by a non-period to continue being processed as a data valueThere should be no performance impact from this patch because it isfunctionally equivalent. If you apply the patch you will see copy.c ismuch clearer in this area now and might suggest additionaloptimizations.I have also attached a 8.1-only patch to fix the CSV \. handling bugwith no code restructuring.
1 parenta4a4b8b commita598385

File tree

1 file changed

+258
-454
lines changed

1 file changed

+258
-454
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp