forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit080b7db
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 parentdaa7527 commit080b7db
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 | |
---|---|---|---|
| |||
1992 | 1992 |
| |
1993 | 1993 |
| |
1994 | 1994 |
| |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
599 | 599 |
| |
600 | 600 |
| |
601 | 601 |
| |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + |
0 commit comments
Comments
(0)