Commit Graph

1 Commits

Author SHA1 Message Date
Kevin Michel
edbeeaf6ec
Fix invalid JSON in column names
If the column name contains invalid UTF-8 sequences
and the output data types are all considered safe,
then the output will not be sanitized and the generated
JSON will be invalid.

A minimal reproduction case is :
`SELECT length('\x80') FORMAT JSONCompact`
where we auto-generate a non-UTF-8 column name with only
integer outputs, whereas :
`SELECT '\x80' FORMAT JSONCompact`
would be sanitized because the column type is String and
will trigger UTF-8 sanitization over the entire document.
2021-11-20 12:35:41 +01:00