You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[client-v2, jdbc-v2] Fix handling strings with special characters #2781
Bug Fix (user-visible misbehavior in an official stable release)
Changelog entry:
Named String query parameters containing literal tab (0x09) or newline (0x0a) bytes fail with BAD_QUERY_PARAMETER ("isn't parsed completely") when sent via the native TCP protocol.
Bug description
When a String named query parameter contains a literal tab or newline character, the server throws:
Value hello world cannot be parsed as String for query parameter 'param_x'
because it isn't parsed completely: only 5 of 11 bytes was parsed: hello
Root cause
There is a format mismatch across three layers in the native TCP parameter path:
Settings::toNameToNameMap() (src/Core/Settings.cpp:8217) decodes the Field dump format to raw bytes via readQuoted — so a tab stored as \t in the dump becomes a literal 0x09 byte in query_parameters.
ReplaceQueryParameterVisitor::visitQueryParameter() (src/Interpreters/ReplaceQueryParameterVisitor.cpp:143) then passes this raw value to deserializeTextEscaped.
deserializeTextEscaped → readEscapedStringIntoImpl (src/IO/ReadHelpers.cpp:659) treats raw 0x09 (tab) and 0x0a (newline) as TSV field delimiters, stopping the parse early. The remaining bytes cause the !read_buffer.eof() check at line 151 to throw.
The same bug exists for the HTTP interface when the parameter value is URL-encoded as %09 or %0A.
Workaround
Double-escape the character on the client side — pass \\t (backslash + t) instead of a literal tab. The extra backslash survives the Field dump round-trip as a single backslash, giving deserializeTextEscaped the two-char \t sequence it expects.
Test
The test includes:
A baseline (simple string, works)
The \\t workaround (works)
Two cases demonstrating the bug (tab and newline, currently fail with the error above)
Two cases showing the expected behaviour after the fix (currently failing — these should pass once the server-side bug is fixed)
Activity
kishansinghifs1 commentedon Jun 16, 2026
Hiii @chernser can I work on this ?
mshustov commentedon Jul 27, 2026
@polyglotAI-bot please fix this
Fix client-v2: escape special characters in scalar String query param…