git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: eb6af01) | patch
Do not access indclass through Form_pg_index
2012年1月27日 18:08:34 +0000 (20:08 +0200)
2012年1月27日 18:08:34 +0000 (20:08 +0200)
commit 8a3f745f160d8334ad978676828d3926ac949f43
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 Lane
src/backend/utils/cache/relcache.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /