forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9e4b213
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 parentbda2856 commit9e4b213
1 file changed
+5
-1
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2758 | 2758 |
| |
2759 | 2759 |
| |
2760 | 2760 |
| |
2761 |
| - | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
2762 | 2764 |
| |
2763 | 2765 |
| |
2764 | 2766 |
| |
2765 | 2767 |
| |
2766 | 2768 |
| |
2767 | 2769 |
| |
2768 | 2770 |
| |
| 2771 | + | |
| 2772 | + | |
2769 | 2773 |
| |
2770 | 2774 |
| |
2771 | 2775 |
| |
|
0 commit comments
Comments
(0)