mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Allow trailing comma in the Values
format
This commit is contained in:
parent
17fc2936ce
commit
f88d294dd0
@ -572,9 +572,16 @@ bool ValuesBlockInputFormat::checkDelimiterAfterValue(size_t column_idx)
|
||||
skipWhitespaceIfAny(*buf);
|
||||
|
||||
if (likely(column_idx + 1 != num_columns))
|
||||
{
|
||||
return checkChar(',', *buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Optional trailing comma.
|
||||
if (checkChar(',', *buf))
|
||||
skipWhitespaceIfAny(*buf);
|
||||
return checkChar(')', *buf);
|
||||
}
|
||||
}
|
||||
|
||||
bool ValuesBlockInputFormat::shouldDeduceNewTemplate(size_t column_idx)
|
||||
|
@ -0,0 +1,3 @@
|
||||
1 2 3
|
||||
4 5 6
|
||||
7 8 9
|
@ -0,0 +1,5 @@
|
||||
CREATE TEMPORARY TABLE test (a UInt8, b UInt8, c UInt8);
|
||||
INSERT INTO test (a, b, c) VALUES (1, 2, 3, );
|
||||
INSERT INTO test (a, b, c) VALUES (4, 5, 6,);
|
||||
INSERT INTO test (a, b, c) VALUES (7, 8, 9);
|
||||
SELECT * FROM test ORDER BY a;
|
Loading…
Reference in New Issue
Block a user