Commit f014211
committed
Make decompilation of optimized CASE constructs more robust.
We had some hacks in ruleutils.c to cope with various odd transformations
that the optimizer could do on a CASE foo WHEN "CaseTestExpr = RHS" clause.
However, the fundamental impossibility of covering all cases was exposed
by Heikki, who pointed out that the "=" operator could get replaced by an
inlined SQL function, which could contain nearly anything at all. So give
up on the hacks and just print the expression as-is if we fail to recognize
it as "CaseTestExpr = RHS". (We must cover that case so that decompiled
rules print correctly; but we are not under any obligation to make EXPLAIN
output be 100% valid SQL in all cases, and already could not do so in some
other cases.) This approach requires that we have some printable
representation of the CaseTestExpr node type; I used "CASE_TEST_EXPR".
Back-patch to all supported branches, since the problem case fails in all.1 parent 9a57eaf commit f014211
1 file changed
+33
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3721 | 3721 | | |
3722 | 3722 | | |
3723 | 3723 | | |
3724 | | - | |
3725 | | - | |
3726 | | - | |
3727 | | - | |
3728 | 3724 | | |
3729 | 3725 | | |
3730 | 3726 | | |
3731 | | - | |
3732 | | - | |
3733 | | - | |
3734 | | - | |
3735 | | - | |
3736 | | - | |
3737 | | - | |
3738 | | - | |
3739 | | - | |
3740 | | - | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
3741 | 3737 | | |
3742 | 3738 | | |
3743 | 3739 | | |
3744 | 3740 | | |
3745 | | - | |
3746 | 3741 | | |
3747 | | - | |
3748 | | - | |
3749 | | - | |
3750 | | - | |
3751 | | - | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
3752 | 3746 | | |
3753 | | - | |
3754 | | - | |
3755 | | - | |
3756 | | - | |
3757 | | - | |
3758 | | - | |
3759 | | - | |
3760 | | - | |
3761 | | - | |
3762 | | - | |
3763 | | - | |
3764 | | - | |
3765 | 3747 | | |
3766 | | - | |
3767 | | - | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
3768 | 3754 | | |
3769 | 3755 | | |
3770 | 3756 | | |
| |||
3780 | 3766 | | |
3781 | 3767 | | |
3782 | 3768 | | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
3783 | 3782 | | |
3784 | 3783 | | |
3785 | 3784 | | |
| |||
0 commit comments