In case of multiple writes File() engine will set doNotWritePrefix(),
and this will avoid serializations initilization, move this to do this
always.
Fixes: #31004
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.
* clarify that cannot show create table of system's tables
* clarify that cannot show create table of system's tables in the document
* bypass test style-check for required `database=currentDatabase()` because `show create table` do not have condition
* rename supportsShowCreateTable to isSystemStorage
* build fake create query for show create table of system's tables
* fix tests for show create table on system's table:
1. only build fake create query when cannot get real query
2. only test rocksdb when it's enabled.
* fix test for show create table system.tables
* fix test for ASTCreateQuery set table and database
* change to LOGICAL_ERROR when cannot get in_memory metadata
Co-authored-by: tavplubix <tavplubix@gmail.com>
* implement common getCreateQueryFromStorage
Co-authored-by: tavplubix <tavplubix@gmail.com>
quotes are superfluous, and after shell wrapper had been removed it had
been broken:
24484 execve("/src/ch/clickhouse/tests/queries/0_stateless\"/01610_client_spawn_editor_open.editor\"", ["/src/ch/clickhouse/tests/queries/0_stateless\"/01610_client_spawn_editor_open.editor\"", "clickhouse_replxx_GWyu5Y.sql"], 0x7fffffffcf90 /* 100 vars */) = -1 ENOENT (No such file or directory)
24484 write(1, "Cannot execute /src/ch/clickhouse/tests/queries/0_stateless\"/01610_client_spawn_editor_open.editor\": errno: 2, strerror: No such file or directory\n", 147) = 147
24484 exit_group(-1) = ?