mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
done
This commit is contained in:
parent
281bf351d2
commit
08b63fde77
@ -50,6 +50,7 @@ namespace ErrorCodes
|
||||
extern const int TOO_MANY_TEMPORARY_COLUMNS;
|
||||
extern const int TOO_MANY_TEMPORARY_NON_CONST_COLUMNS;
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
}
|
||||
|
||||
/// Read comment near usage
|
||||
@ -375,7 +376,6 @@ void ExpressionAction::execute(Block & block, bool dry_run) const
|
||||
auto source = block.getByName(source_name);
|
||||
block.erase(source_name);
|
||||
source.column = source.column->convertToFullColumnIfConst();
|
||||
|
||||
const ColumnArray * array = typeid_cast<const ColumnArray *>(source.column.get());
|
||||
if (!array)
|
||||
throw Exception("ARRAY JOIN of not array: " + source_name, ErrorCodes::TYPE_MISMATCH);
|
||||
@ -387,6 +387,9 @@ void ExpressionAction::execute(Block & block, bool dry_run) const
|
||||
source.type = assert_cast<const DataTypeArray &>(*source.type).getNestedType();
|
||||
source.name = result_name;
|
||||
|
||||
if (source.type->getTypeId() == TypeIndex::Nothing)
|
||||
throw Exception("ARRAY JOIN of empty array is not allowed", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||
|
||||
block.insert(std::move(source));
|
||||
|
||||
break;
|
||||
|
12
tests/queries/0_stateless/01548_with_totals_having.reference
Normal file
12
tests/queries/0_stateless/01548_with_totals_having.reference
Normal file
@ -0,0 +1,12 @@
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
3
|
||||
|
||||
0
|
2
tests/queries/0_stateless/01548_with_totals_having.sql
Normal file
2
tests/queries/0_stateless/01548_with_totals_having.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT * FROM numbers(4) GROUP BY number WITH TOTALS HAVING sum(number) <= arrayJoin([]); -- { serverError 43 }
|
||||
SELECT * FROM numbers(4) GROUP BY number WITH TOTALS HAVING sum(number) <= arrayJoin([3, 2, 1, 0]) ORDER BY number;
|
Loading…
Reference in New Issue
Block a user