forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit47ac447
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 parent3aefff4 commit47ac447
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 | |
---|---|---|---|
| |||
1634 | 1634 |
| |
1635 | 1635 |
| |
1636 | 1636 |
| |
1637 |
| - | |
1638 |
| - | |
1639 |
| - | |
| 1637 | + | |
1640 | 1638 |
| |
1641 | 1639 |
| |
1642 | 1640 |
| |
| |||
1906 | 1904 |
| |
1907 | 1905 |
| |
1908 | 1906 |
| |
1909 |
| - | |
1910 |
| - | |
1911 |
| - | |
1912 |
| - | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
1913 | 1912 |
| |
1914 |
| - | |
1915 |
| - | |
1916 | 1913 |
| |
1917 | 1914 |
| |
1918 | 1915 |
| |
| |||
2371 | 2368 |
| |
2372 | 2369 |
| |
2373 | 2370 |
| |
2374 |
| - | |
2375 |
| - | |
2376 |
| - | |
2377 |
| - | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
2378 | 2387 |
| |
2379 | 2388 |
| |
2380 | 2389 |
| |
| |||
2394 | 2403 |
| |
2395 | 2404 |
| |
2396 | 2405 |
| |
2397 |
| - | |
2398 |
| - | |
2399 |
| - | |
2400 |
| - | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
2401 | 2422 |
| |
2402 | 2423 |
| |
2403 | 2424 |
| |
|
Lines changed: 14 additions & 0 deletions
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 | + |
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)