forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0bd7305
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 parentc2a366d commit0bd7305
1 file changed
+33
-34
lines changedLines changed: 33 additions & 34 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4893 | 4893 |
| |
4894 | 4894 |
| |
4895 | 4895 |
| |
4896 |
| - | |
4897 |
| - | |
4898 |
| - | |
4899 |
| - | |
4900 | 4896 |
| |
4901 | 4897 |
| |
4902 | 4898 |
| |
4903 |
| - | |
4904 |
| - | |
4905 |
| - | |
4906 |
| - | |
4907 |
| - | |
4908 |
| - | |
4909 |
| - | |
4910 |
| - | |
4911 |
| - | |
4912 |
| - | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
| 4903 | + | |
| 4904 | + | |
| 4905 | + | |
| 4906 | + | |
| 4907 | + | |
| 4908 | + | |
4913 | 4909 |
| |
4914 | 4910 |
| |
4915 | 4911 |
| |
4916 | 4912 |
| |
4917 |
| - | |
4918 | 4913 |
| |
4919 |
| - | |
4920 |
| - | |
4921 |
| - | |
4922 |
| - | |
4923 |
| - | |
| 4914 | + | |
| 4915 | + | |
| 4916 | + | |
| 4917 | + | |
4924 | 4918 |
| |
4925 |
| - | |
4926 |
| - | |
4927 |
| - | |
4928 |
| - | |
4929 |
| - | |
4930 |
| - | |
4931 |
| - | |
4932 |
| - | |
4933 |
| - | |
4934 |
| - | |
4935 |
| - | |
4936 |
| - | |
4937 | 4919 |
| |
4938 |
| - | |
4939 |
| - | |
| 4920 | + | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
4940 | 4926 |
| |
4941 | 4927 |
| |
4942 | 4928 |
| |
| |||
4952 | 4938 |
| |
4953 | 4939 |
| |
4954 | 4940 |
| |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
4955 | 4954 |
| |
4956 | 4955 |
| |
4957 | 4956 |
| |
|
0 commit comments
Comments
(0)