-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Left join InlineView Result is error.
Leftjoin has no rows on the match should be NULL populated instead of an expression evaluating the value
To Reproduce
Steps to reproduce the behavior:
mysql> select * from t1;
+------+------+------+
| v1 | v2 | v3 |
+------+------+------+
| 1 | 2 | 3 |
| 4 | 5 | 6 |
+------+------+------+
2 rows in set (0.01 sec)
mysql> select * from t2;
+------+------+------+
| v1 | v2 | v3 |
+------+------+------+
| 1 | 2 | 3 |
+------+------+------+
1 row in set (0.01 sec)
mysql> select t1.v1,b.v2 from t1 left join (select v1, v2 is null as v2 from t2) as b on t1.v1=b.v1;
+------+------+
| v1 | v2 |
+------+------+
| 1 | 0 |
| 4 | 1 |
+------+------+
2 rows in set (0.01 sec)
Expected behavior
mysql> select t1.v1,b.v2 from t1 left join (select v1, v2 is null as v2 from t2) as b on t1.v1=b.v1;
+------+------+
| v1 | v2 |
+------+------+
| 1 | 0 |
| 4 | NULL |
+------+------+
2 rows in set (0.01 sec)
Additional context
Add any other context about the problem here.