forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3987e9e
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 parent44404f3 commit3987e9e
1 file changed
+33
-34
lines changedLines changed: 33 additions & 34 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5187 | 5187 |
| |
5188 | 5188 |
| |
5189 | 5189 |
| |
5190 |
| - | |
5191 |
| - | |
5192 |
| - | |
5193 |
| - | |
5194 | 5190 |
| |
5195 | 5191 |
| |
5196 | 5192 |
| |
5197 |
| - | |
5198 |
| - | |
5199 |
| - | |
5200 |
| - | |
5201 |
| - | |
5202 |
| - | |
5203 |
| - | |
5204 |
| - | |
5205 |
| - | |
5206 |
| - | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
5207 | 5203 |
| |
5208 | 5204 |
| |
5209 | 5205 |
| |
5210 | 5206 |
| |
5211 |
| - | |
5212 | 5207 |
| |
5213 |
| - | |
5214 |
| - | |
5215 |
| - | |
5216 |
| - | |
5217 |
| - | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
5218 | 5212 |
| |
5219 |
| - | |
5220 |
| - | |
5221 |
| - | |
5222 |
| - | |
5223 |
| - | |
5224 |
| - | |
5225 |
| - | |
5226 |
| - | |
5227 |
| - | |
5228 |
| - | |
5229 |
| - | |
5230 |
| - | |
5231 | 5213 |
| |
5232 |
| - | |
5233 |
| - | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
| 5218 | + | |
| 5219 | + | |
5234 | 5220 |
| |
5235 | 5221 |
| |
5236 | 5222 |
| |
| |||
5246 | 5232 |
| |
5247 | 5233 |
| |
5248 | 5234 |
| |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
5249 | 5248 |
| |
5250 | 5249 |
| |
5251 | 5250 |
| |
|
0 commit comments
Comments
(0)