Updated to not clear on_expression from table_join as its used by future analyze runs

This commit is contained in:
Smita Kulkarni 2023-02-16 16:15:18 +01:00
parent b99706b736
commit 6763a9d1ff
3 changed files with 12 additions and 3 deletions

View File

@ -655,10 +655,7 @@ void collectJoinedColumns(TableJoin & analyzed_join, ASTTableJoin & table_join,
{
bool join_on_const_ok = tryJoinOnConst(analyzed_join, table_join.on_expression, context);
if (join_on_const_ok)
{
table_join.on_expression = nullptr;
return;
}
bool is_asof = (table_join.strictness == JoinStrictness::Asof);

View File

@ -0,0 +1,3 @@
1 2
1 1
0 0

View File

@ -0,0 +1,9 @@
CREATE TABLE t0 (c0 Int32) ENGINE = Memory;
CREATE TABLE t1 (c1 Int32) ENGINE = Memory;
INSERT INTO t0(c0) VALUES (1), (2);
INSERT INTO t1(c1) VALUES (1);
SELECT max(1), count() FROM t0 AS t0 LEFT JOIN t1 ON true WHERE 1;
SELECT max(1), count() FROM t0 AS t0 INNER JOIN t1 ON t0.c0 = t1.c1 WHERE 1;
SELECT max(1), count() FROM t0 AS t0 INNER JOIN t1 ON true WHERE 0;