mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Fix portability problems recently exposed by regression tests on Alphas.
1. Distinguish cases where a Datum representing a tuple datatype is an OID from cases where it is a pointer to TupleTableSlot, and make sure we use the right typlen in each case. 2. Make fetchatt() and related code support 8-byte by-value datatypes on machines where Datum is 8 bytes. Centralize knowledge of the available by-value datatype sizes in two macros in tupmacs.h, so that this will be easier if we ever have to do it again.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.48 2000/12/07 02:00:47 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.49 2000/12/27 23:59:10 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -217,9 +217,9 @@ nocache_index_getattr(IndexTuple tup,
|
||||
/* This is handled in the macro */
|
||||
if (att[attnum]->attcacheoff != -1)
|
||||
{
|
||||
return (Datum) fetchatt(&(att[attnum]),
|
||||
(char *) tup + data_off +
|
||||
att[attnum]->attcacheoff);
|
||||
return fetchatt(att[attnum],
|
||||
(char *) tup + data_off +
|
||||
att[attnum]->attcacheoff);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -279,8 +279,8 @@ nocache_index_getattr(IndexTuple tup,
|
||||
{
|
||||
if (att[attnum]->attcacheoff != -1)
|
||||
{
|
||||
return (Datum) fetchatt(&(att[attnum]),
|
||||
tp + att[attnum]->attcacheoff);
|
||||
return fetchatt(att[attnum],
|
||||
tp + att[attnum]->attcacheoff);
|
||||
}
|
||||
else if (!IndexTupleAllFixed(tup))
|
||||
{
|
||||
@ -332,7 +332,7 @@ nocache_index_getattr(IndexTuple tup,
|
||||
off += att[j]->attlen;
|
||||
}
|
||||
|
||||
return (Datum) fetchatt(&(att[attnum]), tp + att[attnum]->attcacheoff);
|
||||
return fetchatt(att[attnum], tp + att[attnum]->attcacheoff);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -379,7 +379,7 @@ nocache_index_getattr(IndexTuple tup,
|
||||
|
||||
off = att_align(off, att[attnum]->attlen, att[attnum]->attalign);
|
||||
|
||||
return (Datum) fetchatt(&att[attnum], tp + off);
|
||||
return fetchatt(att[attnum], tp + off);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user