forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6ca712f
committed
Fix "cannot accept a set" error when only some arms of a CASE return a set.
In commitc135205, I implemented anoptimization that assumed that a function's argument expressions wouldeither always return a set (ie multiple rows), or always not. This iswrong however: we allow CASE expressions in which some arms return a setof some type and others just return a scalar of that type. There may beother examples as well. To fix, replace the run-time test of whether anargument returned a set with a static precheck (expression_returns_set).This adds a little bit of query startup overhead, but it seems barelymeasurable.Per bug #8228 from David Johnston. This has been broken since 8.0,so patch all supported branches.1 parent5301c83 commit6ca712f
File tree
3 files changed
+61
-17
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+61
-17
lines changedLines changed: 38 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1607 | 1607 |
| |
1608 | 1608 |
| |
1609 | 1609 |
| |
1610 |
| - | |
1611 |
| - | |
1612 |
| - | |
| 1610 | + | |
1613 | 1611 |
| |
1614 | 1612 |
| |
1615 | 1613 |
| |
| |||
1888 | 1886 |
| |
1889 | 1887 |
| |
1890 | 1888 |
| |
1891 |
| - | |
1892 |
| - | |
1893 |
| - | |
1894 |
| - | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
1895 | 1894 |
| |
1896 |
| - | |
1897 |
| - | |
1898 | 1895 |
| |
1899 | 1896 |
| |
1900 | 1897 |
| |
| |||
2350 | 2347 |
| |
2351 | 2348 |
| |
2352 | 2349 |
| |
2353 |
| - | |
2354 |
| - | |
2355 |
| - | |
2356 |
| - | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
2357 | 2366 |
| |
2358 | 2367 |
| |
2359 | 2368 |
| |
| |||
2372 | 2381 |
| |
2373 | 2382 |
| |
2374 | 2383 |
| |
2375 |
| - | |
2376 |
| - | |
2377 |
| - | |
2378 |
| - | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
2379 | 2400 |
| |
2380 | 2401 |
| |
2381 | 2402 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
929 | 929 |
| |
930 | 930 |
| |
931 | 931 |
| |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
455 | 455 |
| |
456 | 456 |
| |
457 | 457 |
| |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + |
0 commit comments
Comments
(0)