- Notifications
You must be signed in to change notification settings - Fork5k
Commit6d24189
committed
Make decompilation of optimized CASE constructs more robust.
We had some hacks in ruleutils.c to cope with various odd transformationsthat the optimizer could do on a CASE foo WHEN "CaseTestExpr = RHS" clause.However, the fundamental impossibility of covering all cases was exposedby Heikki, who pointed out that the "=" operator could get replaced by aninlined SQL function, which could contain nearly anything at all. So giveup on the hacks and just print the expression as-is if we fail to recognizeit as "CaseTestExpr = RHS". (We must cover that case so that decompiledrules print correctly; but we are not under any obligation to make EXPLAINoutput be 100% valid SQL in all cases, and already could not do so in someother cases.) This approach requires that we have some printablerepresentation of the CaseTestExpr node type; I used "CASE_TEST_EXPR".Back-patch to all supported branches, since the problem case fails in all.1 parentea393e4 commit6d24189
1 file changed
+33
-34
lines changedLines changed: 33 additions & 34 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3678 | 3678 |
| |
3679 | 3679 |
| |
3680 | 3680 |
| |
3681 |
| - | |
3682 |
| - | |
3683 |
| - | |
3684 |
| - | |
3685 | 3681 |
| |
3686 | 3682 |
| |
3687 | 3683 |
| |
3688 |
| - | |
3689 |
| - | |
3690 |
| - | |
3691 |
| - | |
3692 |
| - | |
3693 |
| - | |
3694 |
| - | |
3695 |
| - | |
3696 |
| - | |
3697 |
| - | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
3698 | 3694 |
| |
3699 | 3695 |
| |
3700 | 3696 |
| |
3701 | 3697 |
| |
3702 |
| - | |
3703 | 3698 |
| |
3704 |
| - | |
3705 |
| - | |
3706 |
| - | |
3707 |
| - | |
3708 |
| - | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
3709 | 3703 |
| |
3710 |
| - | |
3711 |
| - | |
3712 |
| - | |
3713 |
| - | |
3714 |
| - | |
3715 |
| - | |
3716 |
| - | |
3717 |
| - | |
3718 |
| - | |
3719 |
| - | |
3720 |
| - | |
3721 |
| - | |
3722 | 3704 |
| |
3723 |
| - | |
3724 |
| - | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
3725 | 3711 |
| |
3726 | 3712 |
| |
3727 | 3713 |
| |
| |||
3737 | 3723 |
| |
3738 | 3724 |
| |
3739 | 3725 |
| |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
3740 | 3739 |
| |
3741 | 3740 |
| |
3742 | 3741 |
| |
|
0 commit comments
Comments
(0)