*** postgresql-7.0.2/src/backend/parser/parse_type.c.orig Wed Jan 26 14:56:42 2000 --- postgresql-7.0.2/src/backend/parser/parse_type.c Mon Jul 10 10:45:35 2000 *************** *** 48,54 **** return NULL; } typetuple = (Form_pg_type) GETSTRUCT(tup); ! return NameStr(typetuple->typname); } /* return a Type structure, given a type id */ --- 48,55 ---- return NULL; } typetuple = (Form_pg_type) GETSTRUCT(tup); ! /* pstrdup here because result may need to outlive the syscache entry */ ! return pstrdup(NameStr(typetuple->typname)); } /* return a Type structure, given a type id */ *************** *** 119,125 **** Form_pg_type typ; typ = (Form_pg_type) GETSTRUCT(t); ! return NameStr(typ->typname); } /* given a type, return its typetype ('c' for 'c'atalog types) */ --- 120,127 ---- Form_pg_type typ; typ = (Form_pg_type) GETSTRUCT(t); ! /* pstrdup here because result may need to outlive the syscache entry */ ! return pstrdup(NameStr(typ->typname)); } /* given a type, return its typetype ('c' for 'c'atalog types) */ *** postgresql-7.0.2/src/backend/storage/large_object/inv_api.c.orig Thu Apr 13 02:15:37 2000 --- postgresql-7.0.2/src/backend/storage/large_object/inv_api.c Mon Jul 10 10:45:35 2000 *************** *** 185,190 **** --- 185,191 ---- retval->idesc = RelationGetDescr(indr); retval->offset = retval->lowbyte = retval->highbyte = 0; ItemPointerSetInvalid(&(retval->htid)); + retval->flags = 0; if (flags & INV_WRITE) { *************** *** 233,238 **** --- 234,240 ---- retval->idesc = RelationGetDescr(indrel); retval->offset = retval->lowbyte = retval->highbyte = 0; ItemPointerSetInvalid(&(retval->htid)); + retval->flags = 0; if (flags & INV_WRITE) { *************** *** 371,384 **** if (whence == SEEK_CUR) { offset += obj_desc->offset; /* calculate absolute position */ - return inv_seek(obj_desc, offset, SEEK_SET); } ! ! /* ! * if you seek past the end (offset > 0) I have no clue what happens ! * :-( B.L. 9/1/93 ! */ ! if (whence == SEEK_END) { /* need read lock for getsize */ if (!(obj_desc->flags & IFS_RDLOCK)) --- 373,380 ---- if (whence == SEEK_CUR) { offset += obj_desc->offset; /* calculate absolute position */ } ! else if (whence == SEEK_END) { /* need read lock for getsize */ if (!(obj_desc->flags & IFS_RDLOCK)) *************** *** 389,396 **** offset += _inv_getsize(obj_desc->heap_r, obj_desc->hdesc, obj_desc->index_r); - return inv_seek(obj_desc, offset, SEEK_SET); } /* * Whenever we do a seek, we turn off the EOF flag bit to force --- 385,392 ---- offset += _inv_getsize(obj_desc->heap_r, obj_desc->hdesc, obj_desc->index_r); } + /* now we can assume that the operation is SEEK_SET */ /* * Whenever we do a seek, we turn off the EOF flag bit to force *************** *** 414,422 **** * stores the offset of the last byte that appears on it, and we have * an index on this. */ - - - /* right now, just assume that the operation is SEEK_SET */ if (obj_desc->iscan != (IndexScanDesc) NULL) { d = Int32GetDatum(offset); --- 410,415 ---- *************** *** 424,430 **** } else { - ScanKeyEntryInitialize(&skey, 0x0, 1, F_INT4GE, Int32GetDatum(offset)); --- 417,422 ---- *************** *** 487,495 **** /* copy the data from this block into the buffer */ d = heap_getattr(&tuple, 2, obj_desc->hdesc, &isNull); ReleaseBuffer(buffer); ! fsblock = (struct varlena *) DatumGetPointer(d); off = obj_desc->offset - obj_desc->lowbyte; ncopy = obj_desc->highbyte - obj_desc->offset + 1; --- 479,505 ---- /* copy the data from this block into the buffer */ d = heap_getattr(&tuple, 2, obj_desc->hdesc, &isNull); + fsblock = (struct varlena *) DatumGetPointer(d); ReleaseBuffer(buffer); ! /* ! * If block starts beyond current seek point, then we are looking ! * at a "hole" (unwritten area) in the object. Return zeroes for ! * the "hole". ! */ ! if (obj_desc->offset < obj_desc->lowbyte) ! { ! int nzeroes = obj_desc->lowbyte - obj_desc->offset; ! ! if (nzeroes > (nbytes - nread)) ! nzeroes = (nbytes - nread); ! MemSet(buf, 0, nzeroes); ! buf += nzeroes; ! nread += nzeroes; ! obj_desc->offset += nzeroes; ! if (nread >= nbytes) ! break; ! } off = obj_desc->offset - obj_desc->lowbyte; ncopy = obj_desc->highbyte - obj_desc->offset + 1; *************** *** 535,548 **** Buffer buffer; /* ! * Fetch the current inversion file system block. If the class ! * storing the inversion file is empty, we don't want to do an ! * index lookup, since index lookups choke on empty files (should ! * be fixed someday). */ ! if ((obj_desc->flags & IFS_ATEOF) ! || obj_desc->heap_r->rd_nblocks == 0) tuple.t_data = NULL; else inv_fetchtup(obj_desc, &tuple, &buffer); --- 545,555 ---- Buffer buffer; /* ! * Fetch the current inversion file system block. We can skip ! * the work if we already know we are at EOF. */ ! if (obj_desc->flags & IFS_ATEOF) tuple.t_data = NULL; else inv_fetchtup(obj_desc, &tuple, &buffer); *** postgresql-7.0.2/src/backend/utils/cache/fcache.c.orig Thu Apr 13 02:15:53 2000 --- postgresql-7.0.2/src/backend/utils/cache/fcache.c Mon Jul 10 10:45:35 2000 *************** *** 14,19 **** --- 14,20 ---- */ #include "postgres.h" + #include "access/heapam.h" #include "catalog/pg_language.h" #include "catalog/pg_proc.h" #include "catalog/pg_type.h" *************** *** 89,97 **** if (!use_syscache) elog(ERROR, "what the ????, init the fcache without the catalogs?"); ! procedureTuple = SearchSysCacheTuple(PROCOID, ! ObjectIdGetDatum(foid), ! 0, 0, 0); if (!HeapTupleIsValid(procedureTuple)) elog(ERROR, "init_fcache: Cache lookup failed for procedure %u", --- 90,98 ---- if (!use_syscache) elog(ERROR, "what the ????, init the fcache without the catalogs?"); ! procedureTuple = SearchSysCacheTupleCopy(PROCOID, ! ObjectIdGetDatum(foid), ! 0, 0, 0); if (!HeapTupleIsValid(procedureTuple)) elog(ERROR, "init_fcache: Cache lookup failed for procedure %u", *************** *** 258,263 **** --- 259,266 ---- } else retval->func.fn_addr = (func_ptr) NULL; + + heap_freetuple(procedureTuple); return retval; } *** postgresql-7.0.2/src/backend/utils/time/tqual.c.orig Wed Jan 26 14:57:36 2000 --- postgresql-7.0.2/src/backend/utils/time/tqual.c Mon Jul 10 10:45:35 2000 *************** *** 441,447 **** --- 441,451 ---- } if (TransactionIdIsCurrentTransactionId(tuple->t_xmax)) + { + if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE) + return true; return false; + } if (!TransactionIdDidCommit(tuple->t_xmax)) {