-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.
Description
Describe the unexpected behaviour
Backslashes in a string query parameter seem to be interpreted in an inconsistent way. This behavior exhibits on version 24.7.1.
A single backslash \ results in an error:
% clickhouse-client --param_message="hello\\" --query="SELECT {message: String}"
Received exception from server (version 24.7.1):
Code: 25. DB::Exception: Received from localhost:9000. DB::Exception: Cannot par
se escape sequence: value hello\ cannot be parsed as String for query parameter
'message'. (CANNOT_PARSE_ESCAPE_SEQUENCE)
(query: SELECT {message: String})
A double backslash \\ is left unchanged:
% clickhouse-client --param_message="hello\\\\" --query="SELECT {message: String}"
hello\\
A sequence of two characters \ and n is left unchanged too:
% clickhouse-client --param_message="hello\\n" --query="SELECT {message: String}"
hello\n
Expected behavior
I don't know what to expect here, i.e. I don't know whether escape sequences in string query parameters should be interpreted or not. But at least there should be a consistency. One cannot enter a string with a single \ as a query parameter currently.
Mirraz and anton-ko
Metadata
Metadata
Assignees
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.