forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd730424
committed
Fix old oversight in const-simplification of COALESCE() expressions.
Once we have found a non-null constant argument, there is no need toexamine additional arguments of the COALESCE. The previous coding got itright only if the constant was in the first argument position; otherwiseit tried to simplify following arguments too, leading to unexpectedbehavior like this:regression=# select coalesce(f1, 42, 1/0) from int4_tbl;ERROR: division by zeroIt's a minor corner case, but a bug is a bug, so back-patch all the way.1 parent19e231b commitd730424
1 file changed
+5
-1
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2746 | 2746 |
| |
2747 | 2747 |
| |
2748 | 2748 |
| |
2749 |
| - | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
2750 | 2752 |
| |
2751 | 2753 |
| |
2752 | 2754 |
| |
2753 | 2755 |
| |
2754 | 2756 |
| |
2755 | 2757 |
| |
2756 | 2758 |
| |
| 2759 | + | |
| 2760 | + | |
2757 | 2761 |
| |
2758 | 2762 |
| |
2759 | 2763 |
| |
|
0 commit comments
Comments
(0)