mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Merge pull request #49558 from ClickHouse/rs/writeAnyEscapedString
Fix writeAnyEscapedString if quote_character is a meta character
This commit is contained in:
commit
a1c98303a7
@ -316,6 +316,15 @@ void writeAnyEscapedString(const char * begin, const char * end, WriteBuffer & b
|
||||
pos = next_pos;
|
||||
switch (*pos)
|
||||
{
|
||||
case quote_character:
|
||||
{
|
||||
if constexpr (escape_quote_with_quote)
|
||||
writeChar(quote_character, buf);
|
||||
else
|
||||
writeChar('\\', buf);
|
||||
writeChar(quote_character, buf);
|
||||
break;
|
||||
}
|
||||
case '\b':
|
||||
writeChar('\\', buf);
|
||||
writeChar('b', buf);
|
||||
@ -344,15 +353,6 @@ void writeAnyEscapedString(const char * begin, const char * end, WriteBuffer & b
|
||||
writeChar('\\', buf);
|
||||
writeChar('\\', buf);
|
||||
break;
|
||||
case quote_character:
|
||||
{
|
||||
if constexpr (escape_quote_with_quote)
|
||||
writeChar(quote_character, buf);
|
||||
else
|
||||
writeChar('\\', buf);
|
||||
writeChar(quote_character, buf);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
writeChar(*pos, buf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user