- Notifications
You must be signed in to change notification settings - Fork5
Commitd8411a6
committed
Allow functions that return sets of tuples to return simple NULLs.
ExecMakeTableFunctionResult(), which is used in SELECT FROM function(...)cases, formerly treated a simple NULL output from a function that bothreturnsSet and returnsTuple as a violation of the SRF protocol. What seemsbetter is to treat a NULL output as equivalent to ROW(NULL,NULL,...).Without this, cases such as SELECT FROM unnest(...) on an array ofcomposite are vulnerable to unexpected and not-very-helpful failures.Old code comments here suggested an alternative of just ignoringsimple-NULL outputs, but that doesn't seem very principled.This change had been hung up for a long time due to uncertainty abouthow much we wanted to buy into the equivalence of simple NULL andROW(NULL,NULL,...). I think that's been mostly resolved by the discussionaround bug #14235, so let's go ahead and do it.Per bug #7808 from Joe Van Dyk. Although this is a pretty old report,fixing it smells a bit more like a new feature than a bug fix, and thelack of other similar complaints suggests that we shouldn't take much riskof destabilization by back-patching. (Maybe that could be revisited oncethis patch has withstood some field usage.)Andrew Gierth and Tom LaneReport: <E1TurJE-0006Es-TK@wrigleys.postgresql.org>1 parent976b24f commitd8411a6
File tree
3 files changed
+106
-60
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+106
-60
lines changedLines changed: 65 additions & 60 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2229 | 2229 |
| |
2230 | 2230 |
| |
2231 | 2231 |
| |
2232 |
| - | |
2233 |
| - | |
2234 |
| - | |
2235 |
| - | |
2236 |
| - | |
2237 |
| - | |
2238 |
| - | |
2239 |
| - | |
2240 |
| - | |
2241 |
| - | |
2242 |
| - | |
2243 |
| - | |
2244 |
| - | |
2245 |
| - | |
2246 |
| - | |
2247 |
| - | |
2248 |
| - | |
2249 |
| - | |
| 2232 | + | |
| 2233 | + | |
2250 | 2234 |
| |
2251 | 2235 |
| |
2252 | 2236 |
| |
2253 | 2237 |
| |
2254 |
| - | |
2255 |
| - | |
2256 |
| - | |
2257 |
| - | |
2258 |
| - | |
2259 |
| - | |
2260 |
| - | |
2261 |
| - | |
2262 |
| - | |
2263 |
| - | |
2264 |
| - | |
2265 |
| - | |
2266 |
| - | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
2267 | 2241 |
| |
2268 |
| - | |
2269 |
| - | |
2270 |
| - | |
2271 | 2242 |
| |
2272 | 2243 |
| |
2273 | 2244 |
| |
2274 | 2245 |
| |
2275 | 2246 |
| |
2276 | 2247 |
| |
2277 | 2248 |
| |
| 2249 | + | |
2278 | 2250 |
| |
2279 |
| - | |
2280 | 2251 |
| |
2281 |
| - | |
2282 |
| - | |
2283 | 2252 |
| |
2284 | 2253 |
| |
2285 | 2254 |
| |
2286 | 2255 |
| |
2287 | 2256 |
| |
2288 | 2257 |
| |
2289 | 2258 |
| |
2290 |
| - | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
2291 | 2262 |
| |
2292 |
| - | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
2293 | 2289 |
| |
2294 |
| - | |
2295 |
| - | |
2296 |
| - | |
2297 |
| - | |
2298 |
| - | |
2299 |
| - | |
2300 |
| - | |
2301 |
| - | |
2302 |
| - | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
2303 | 2296 |
| |
2304 |
| - | |
2305 |
| - | |
2306 |
| - | |
2307 |
| - | |
2308 |
| - | |
2309 |
| - | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
2310 | 2311 |
| |
2311 |
| - | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
2312 | 2316 |
| |
2313 | 2317 |
| |
| 2318 | + | |
| 2319 | + | |
2314 | 2320 |
| |
| 2321 | + | |
2315 | 2322 |
| |
2316 | 2323 |
| |
2317 | 2324 |
| |
| |||
2343 | 2350 |
| |
2344 | 2351 |
| |
2345 | 2352 |
| |
2346 |
| - | |
| 2353 | + | |
| 2354 | + | |
2347 | 2355 |
| |
2348 | 2356 |
| |
2349 | 2357 |
| |
| |||
2353 | 2361 |
| |
2354 | 2362 |
| |
2355 | 2363 |
| |
2356 |
| - | |
2357 | 2364 |
| |
2358 | 2365 |
| |
2359 | 2366 |
| |
2360 |
| - | |
2361 | 2367 |
| |
2362 | 2368 |
| |
2363 |
| - | |
2364 |
| - | |
| 2369 | + | |
2365 | 2370 |
| |
2366 | 2371 |
| |
2367 | 2372 |
| |
|
Lines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2076 | 2076 |
| |
2077 | 2077 |
| |
2078 | 2078 |
| |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + |
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
639 | 639 |
| |
640 | 640 |
| |
641 | 641 |
| |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + |
0 commit comments
Comments
(0)