check number of arguments for -Array combinator [#CLICKHOUSE-3853] #2703

This commit is contained in:
Alexey Zatelepin 2018-07-23 19:53:22 +03:00
parent 1c200589f5
commit 4c4da31cc2
2 changed files with 7 additions and 2 deletions

View File

@ -18,6 +18,9 @@ public:
DataTypes transformArguments(const DataTypes & arguments) const override DataTypes transformArguments(const DataTypes & arguments) const override
{ {
if (0 == arguments.size())
throw Exception("-Array aggregate functions require at least one argument", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
DataTypes nested_arguments; DataTypes nested_arguments;
for (const auto & type : arguments) for (const auto & type : arguments)
{ {

View File

@ -428,5 +428,7 @@ SELECT COVAR_SAMPArray([CAST( 0 AS Int8)],arrayPopBack([CAST( 0 AS Int8)]));
SELECT medianTimingWeightedArray([CAST( 0 AS Int8)],arrayPopBack([CAST( 0 AS Int8)])); SELECT medianTimingWeightedArray([CAST( 0 AS Int8)],arrayPopBack([CAST( 0 AS Int8)]));
SELECT quantilesDeterministicArray([CAST( 0 AS Int8)],arrayPopBack([CAST( 0 AS Int32)])); SELECT quantilesDeterministicArray([CAST( 0 AS Int8)],arrayPopBack([CAST( 0 AS Int32)]));
SELECT maxIntersections([], []) SELECT maxIntersections([], []);
SELECT sumMap([], []) SELECT sumMap([], []);
SELECT countArray();