mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Fix inconsistency
This commit is contained in:
parent
da1ac3fda5
commit
48d21bb03b
@ -219,6 +219,9 @@ const ActionsDAG::Node & ActionsDAG::addFunction(
|
||||
column = node.function_base->getConstantResultForNonConstArguments(arguments, node.result_type);
|
||||
}
|
||||
|
||||
if (all_const && column && !isColumnConst(*column) && column->size() <= 1)
|
||||
column = ColumnConst::create(std::move(column), column->size());
|
||||
|
||||
/// If the result is not a constant, just in case, we will consider the result as unknown.
|
||||
if (column && isColumnConst(*column))
|
||||
{
|
||||
|
@ -0,0 +1,6 @@
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
1 1 0
|
||||
0 0 0
|
@ -0,0 +1,8 @@
|
||||
SELECT 1 as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
|
||||
|
||||
SELECT materialize(1) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
|
||||
SELECT materialize(1) as a, count() FROM numbers(10) WHERE 0 ORDER BY a;
|
||||
|
||||
SELECT isConstant(1) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
|
||||
SELECT 1 as b, isConstant(b) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
|
||||
SELECT 0 as b, least(isConstant(materialize(1)), b) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
|
Loading…
Reference in New Issue
Block a user