Commit b4cc35f
committed
Tighten coding for non-composite case in plperl's return_next.
Coverity complained about this code's practice of using scalar variables
as single-element arrays. While that's really just nitpicking, it probably
is more readable to declare them as arrays, so let's do that. A more
important point is that the code was just blithely assuming that the
result tupledesc has exactly one column; if it doesn't, we'd likely get
a crash of some sort in tuplestore_putvalues. Since the tupledesc is
manufactured outside of plperl, that seems like an uncomfortably long
chain of assumptions. We can nail it down at little cost with a sanity
check earlier in the function.1 parent d2a51e3 commit b4cc35f
1 file changed
+17
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3247 | 3247 | | |
3248 | 3248 | | |
3249 | 3249 | | |
3250 | | - | |
| 3250 | + | |
| 3251 | + | |
3251 | 3252 | | |
3252 | 3253 | | |
3253 | 3254 | | |
3254 | 3255 | | |
| 3256 | + | |
3255 | 3257 | | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
3256 | 3262 | | |
3257 | 3263 | | |
3258 | 3264 | | |
| |||
3300 | 3306 | | |
3301 | 3307 | | |
3302 | 3308 | | |
3303 | | - | |
3304 | | - | |
| 3309 | + | |
| 3310 | + | |
3305 | 3311 | | |
3306 | | - | |
3307 | | - | |
3308 | | - | |
3309 | | - | |
3310 | | - | |
3311 | | - | |
3312 | | - | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
3313 | 3319 | | |
3314 | 3320 | | |
3315 | 3321 | | |
3316 | | - | |
| 3322 | + | |
3317 | 3323 | | |
3318 | 3324 | | |
3319 | 3325 | | |
| |||
0 commit comments