diff options
-rw-r--r-- | src/backend/commands/copy.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index a5528f8307f..b52081f1e96 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -3994,7 +3994,7 @@ CopyReadLineText(CopyState cstate) break; } else if (!cstate->csv_mode) - + { /* * If we are here, it means we found a backslash followed by * something other than a period. In non-CSV mode, anything @@ -4005,8 +4005,16 @@ CopyReadLineText(CopyState cstate) * backslashes are not special, so we want to process the * character after the backslash just like a normal character, * so we don't increment in those cases. + * + * Set 'c' to skip whole character correctly in multi-byte + * encodings. If we don't have the whole character in the + * buffer yet, we might loop back to process it, after all, + * but that's OK because multi-byte characters cannot have any + * special meaning. */ raw_buf_ptr++; + c = c2; + } } /* |