forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4dbcb3f
committed
Restructure polymorphic-type resolution in funcapi.c.
resolve_polymorphic_tupdesc() and resolve_polymorphic_argtypes() failed tocover the case of having to resolve anyarray given only an anyrange input.The bug was masked if anyelement was also used (as either input oroutput), which probably helps account for our not having noticed.While looking at this I noticed that resolve_generic_type() would producethe wrong answer if asked to make that same resolution. ISTM thatresolve_generic_type() is confusingly defined and overly complex, sorather than fix it, let's just make funcapi.c do the specific lookupsit requires for itself.With this change, resolve_generic_type() is not used anywhere, so removeit in HEAD. In the back branches, leave it alone (complete with bug)just in case any external code is using it.While we're here, make some other refactoring adjustments in funcapi.cwith an eye to upcoming future expansion of the set of polymorphic types:* Simplify quick-exit tests by adding an overall have_polymorphic_resultflag. This is about a wash now but will be a win when there are moreflags.* Reduce duplication of code between resolve_polymorphic_tupdesc() andresolve_polymorphic_argtypes().* Don't bother to validate correct matching of anynonarray or anyenum;the parser should have done that, and even if it didn't, just doing"return false" here would lead to a very confusing, off-point errormessage. (Really, "return false" in these two functions should onlyoccur if the call_expr isn't supplied or we can't obtain data typeinfo from it.)* For the same reason, throw an elog rather than "return false" ifwe fail to resolve a polymorphic type.The bug's been there since we added anyrange, so back-patch toall supported branches.Discussion:https://postgr.es/m/6093.1584202130@sss.pgh.pa.us1 parente83daa7 commit4dbcb3f
File tree
5 files changed
+216
-251
lines changed- src
- backend
- parser
- utils/fmgr
- include/parser
- test/regress
- expected
- sql
5 files changed
+216
-251
lines changedLines changed: 0 additions & 104 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
18 | 17 |
| |
19 | 18 |
| |
20 | 19 |
| |
| |||
26 | 25 |
| |
27 | 26 |
| |
28 | 27 |
| |
29 |
| - | |
30 | 28 |
| |
31 | 29 |
| |
32 | 30 |
| |
| |||
1968 | 1966 |
| |
1969 | 1967 |
| |
1970 | 1968 |
| |
1971 |
| - | |
1972 |
| - | |
1973 |
| - | |
1974 |
| - | |
1975 |
| - | |
1976 |
| - | |
1977 |
| - | |
1978 |
| - | |
1979 |
| - | |
1980 |
| - | |
1981 |
| - | |
1982 |
| - | |
1983 |
| - | |
1984 |
| - | |
1985 |
| - | |
1986 |
| - | |
1987 |
| - | |
1988 |
| - | |
1989 |
| - | |
1990 |
| - | |
1991 |
| - | |
1992 |
| - | |
1993 |
| - | |
1994 |
| - | |
1995 |
| - | |
1996 |
| - | |
1997 |
| - | |
1998 |
| - | |
1999 |
| - | |
2000 |
| - | |
2001 |
| - | |
2002 |
| - | |
2003 |
| - | |
2004 |
| - | |
2005 |
| - | |
2006 |
| - | |
2007 |
| - | |
2008 |
| - | |
2009 |
| - | |
2010 |
| - | |
2011 |
| - | |
2012 |
| - | |
2013 |
| - | |
2014 |
| - | |
2015 |
| - | |
2016 |
| - | |
2017 |
| - | |
2018 |
| - | |
2019 |
| - | |
2020 |
| - | |
2021 |
| - | |
2022 |
| - | |
2023 |
| - | |
2024 |
| - | |
2025 |
| - | |
2026 |
| - | |
2027 |
| - | |
2028 |
| - | |
2029 |
| - | |
2030 |
| - | |
2031 |
| - | |
2032 |
| - | |
2033 |
| - | |
2034 |
| - | |
2035 |
| - | |
2036 |
| - | |
2037 |
| - | |
2038 |
| - | |
2039 |
| - | |
2040 |
| - | |
2041 |
| - | |
2042 |
| - | |
2043 |
| - | |
2044 |
| - | |
2045 |
| - | |
2046 |
| - | |
2047 |
| - | |
2048 |
| - | |
2049 |
| - | |
2050 |
| - | |
2051 |
| - | |
2052 |
| - | |
2053 |
| - | |
2054 |
| - | |
2055 |
| - | |
2056 |
| - | |
2057 |
| - | |
2058 |
| - | |
2059 |
| - | |
2060 |
| - | |
2061 |
| - | |
2062 |
| - | |
2063 |
| - | |
2064 |
| - | |
2065 |
| - | |
2066 |
| - | |
2067 |
| - | |
2068 |
| - | |
2069 |
| - | |
2070 |
| - | |
2071 |
| - | |
2072 |
| - | |
2073 | 1969 |
| |
2074 | 1970 |
| |
2075 | 1971 |
| |
|
0 commit comments
Comments
(0)