mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
Fix GiST index-only scans for opclasses with different storage type.
We cannot use the index's tuple descriptor directly to describe the index tuples returned in an index-only scan. That's because the index might use a different datatype for the values stored on disk than the type originally indexed. As long as they were both pass-by-ref, it worked, but will not work for pass-by-value types of different sizes. I noticed this as a crash when I started hacking a patch to add fetch methods to btree_gist.
This commit is contained in:
@@ -78,6 +78,8 @@ typedef struct GISTSTATE
|
||||
MemoryContext tempCxt; /* short-term context for calling functions */
|
||||
|
||||
TupleDesc tupdesc; /* index's tuple descriptor */
|
||||
TupleDesc fetchTupdesc; /* tuple descriptor for tuples returned in an
|
||||
* index-only scan */
|
||||
|
||||
FmgrInfo consistentFn[INDEX_MAX_KEYS];
|
||||
FmgrInfo unionFn[INDEX_MAX_KEYS];
|
||||
|
Reference in New Issue
Block a user