Commit 8a3f745
committed
Do not access indclass through Form_pg_index
Normally, accessing variable-length members of catalog structures past
the first one doesn't work at all. Here, it happened to work because
indnatts was checked to be 1, and so the defined FormData_pg_index
layout, using int2vector[1] and oidvector[1] for variable-length
arrays, happened to match the actual memory layout. But it's a very
fragile assumption, and it's not in a performance-critical path, so
code it properly using heap_getattr() instead.
bug analysis by Tom Lane1 parent eb6af01 commit 8a3f745
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3351 | 3351 | | |
3352 | 3352 | | |
3353 | 3353 | | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
3354 | 3357 | | |
3355 | 3358 | | |
3356 | 3359 | | |
3357 | 3360 | | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
3358 | 3373 | | |
3359 | 3374 | | |
3360 | 3375 | | |
3361 | 3376 | | |
3362 | | - | |
| 3377 | + | |
3363 | 3378 | | |
3364 | 3379 | | |
3365 | 3380 | | |
| |||
0 commit comments