mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix crash in JSONColumnsWithMetadata format over http
This commit is contained in:
parent
e029021696
commit
743f2410c1
@ -60,7 +60,7 @@ void registerInputFormatJSONColumnsWithMetadata(FormatFactory & factory)
|
||||
factory.registerInputFormat(
|
||||
"JSONColumnsWithMetadata",
|
||||
[](ReadBuffer & buf,
|
||||
const Block &sample,
|
||||
const Block & sample,
|
||||
const RowInputFormatParams &,
|
||||
const FormatSettings & settings)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
bool checkChunkEnd() override;
|
||||
|
||||
private:
|
||||
const Block & header;
|
||||
const Block header;
|
||||
const bool validate_types_from_metadata;
|
||||
};
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
1 4
|
||||
2 5
|
||||
3 6
|
14
tests/queries/0_stateless/02982_json_columns_with_metadata_http.sh
Executable file
14
tests/queries/0_stateless/02982_json_columns_with_metadata_http.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "drop table if exists test"
|
||||
$CLICKHOUSE_CLIENT -q "create table test(x UInt32, y UInt32) engine=Memory"
|
||||
|
||||
echo -ne '{"meta":[{"name":"x","type":"UInt32"}, {"name":"y", "type":"UInt32"}],"data":{"x":[1,2,3],"y":[4,5,6]}}\n' | ${CLICKHOUSE_CURL} -sS "{$CLICKHOUSE_URL}&query=INSERT%20INTO%20test%20FORMAT%20JSONColumnsWithMetadata" --data-binary @-
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "select * from test"
|
||||
$CLICKHOUSE_CLIENT -q "drop table test"
|
||||
|
Loading…
Reference in New Issue
Block a user