diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index 6e289b57845..8c8f58e65c8 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -28,9 +28,10 @@ #include #include -#include -#include #include +#include +#include +#include #include #include @@ -39,6 +40,8 @@ #include #include +#include + #include #include @@ -829,6 +832,20 @@ bool Client::processWithFuzzing(const String & full_query) WriteBufferFromOStream ast_buf(std::cout, 4096); formatAST(*query, ast_buf, false /*highlight*/); ast_buf.next(); + if (const auto * insert = query->as()) + { + /// For inserts with data it's really useful to have the data itself available in the logs, as formatAST doesn't print it + if (insert->hasInlinedData()) + { + String bytes; + { + auto read_buf = getReadBufferFromASTInsertQuery(query); + WriteBufferFromString write_buf(bytes); + copyData(*read_buf, write_buf); + } + std::cout << std::endl << bytes; + } + } std::cout << std::endl << std::endl; try diff --git a/tests/queries/0_stateless/02482_value_block_parsing.sh b/tests/queries/0_stateless/02482_value_block_parsing.sh index 7aedd4bfbea..b74d3f395f0 100755 --- a/tests/queries/0_stateless/02482_value_block_parsing.sh +++ b/tests/queries/0_stateless/02482_value_block_parsing.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# Tags: long CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh