aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/gist_private.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-03-26 23:07:52 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-03-26 23:07:52 +0200
commit55b59eda13a742f8af913734e22ecc8a21754414 (patch)
tree4bbe77575d9eb2f27d0c770d07fc10095ea329f6 /src/include/access/gist_private.h
parent785941cdc359c6e595201ffb0df9d28f3f7173a4 (diff)
downloadpostgresql-55b59eda13a742f8af913734e22ecc8a21754414.tar.gz
postgresql-55b59eda13a742f8af913734e22ecc8a21754414.zip
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.
Diffstat (limited to 'src/include/access/gist_private.h')
-rw-r--r--src/include/access/gist_private.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index 3693893e261..9d3714d27d2 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -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];