forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7515982
committed
Fix failure with SQL-procedure polymorphic output arguments in v12.
Before the v13-era commit913bbd8, check_sql_fn_retval fails toresolve polymorphic output types and then just throws up its hands andassumes the check will be made at runtime. I think that's true forordinary functions returning RECORD, but it doesn't happen in CALL,potentially resulting in crashes if the actual output of the SQLprocedure's SELECT doesn't match the type inferred from polymorphism.With a little bit of rearrangement, we can use get_call_result_typeinstead of get_func_result_type and thereby infer the correct types.I'm still unwilling to back-patch all of913bbd8, so if the typesdon't match you'll get an error rather than perhaps silently insertinga cast as v13 and later can. That's consistent with prior behaviorthough, so it seems fine.Prior to70ffb27, you'd typically get other errors due to othershortcomings of CALL's management of polymorphism. Nonetheless,this is an independent bug.Although there is no bug in v13 and up, it seems prudent to addthe test case for this to the newer branches too. It's clearlyan under-tested area.Per report from Andrew Bille.Discussion:https://postgr.es/m/CAJnzarw9EeWHAQRm76dXd=7j+rgw6ERqC=nCay8jeFqTwKwhqQ@mail.gmail.com1 parente6cd857 commit7515982
File tree
2 files changed
+26
-0
lines changed- src/test/regress
- expected
- sql
2 files changed
+26
-0
lines changedLines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
227 | 227 |
| |
228 | 228 |
| |
229 | 229 |
| |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
230 | 247 |
| |
231 | 248 |
| |
232 | 249 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
152 | 161 |
| |
153 | 162 |
| |
154 | 163 |
| |
|
0 commit comments
Comments
(0)