forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit97a39f2
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 parent3bd8987 commit97a39f2
File tree
3 files changed
+61
-17
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+61
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1631 | 1631 | | |
1632 | 1632 | | |
1633 | 1633 | | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
| 1634 | + | |
1637 | 1635 | | |
1638 | 1636 | | |
1639 | 1637 | | |
| |||
1895 | 1893 | | |
1896 | 1894 | | |
1897 | 1895 | | |
1898 | | - | |
1899 | | - | |
1900 | | - | |
1901 | | - | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
1902 | 1901 | | |
1903 | | - | |
1904 | | - | |
1905 | 1902 | | |
1906 | 1903 | | |
1907 | 1904 | | |
| |||
2360 | 2357 | | |
2361 | 2358 | | |
2362 | 2359 | | |
2363 | | - | |
2364 | | - | |
2365 | | - | |
2366 | | - | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
2367 | 2376 | | |
2368 | 2377 | | |
2369 | 2378 | | |
| |||
2383 | 2392 | | |
2384 | 2393 | | |
2385 | 2394 | | |
2386 | | - | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
2390 | 2411 | | |
2391 | 2412 | | |
2392 | 2413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 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)