citusdata / citusdata/citus

Router query with true=false in LEFT JOIN errors out

Open
#2,398 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

**Schema**
```
CREATE TABLE test_src (id int, tenant_id int);
CREATE TABLE test_src_1 (id int, tenant_id int);
SELECT create_distributed_table('test_src','tenant_id');
SELECT create_distributed_table('test_src_1','tenant_id');
```
**Query that errors out.**
```
SELECT ts1.tenant_id,count(*) FROM test_src ts1 LEFT JOIN test_src ts2
ON true=false AND ts1.tenant_id = ts2.tenant_id WHERE ts1.tenant_id = 1
group by ts1.tenant_id;
```
**Query that works:**
```
SELECT ts1.tenant_id,count(*) FROM test_src ts1 LEFT JOIN test_src ts2
ON false=false AND ts1.tenant_id = ts2.tenant_id WHERE ts1.tenant_id = 1
group by ts1.tenant_id;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.