1: # include   "../ingres.h"
   2: # include   "../access.h"
   3: 
   4: /*
   5: **	ADD_PRIM -- Add a primary page to the relation.  Assumes it is to
   6: **		be tacked onto page in current access method buffer.  No
   7: **		disk write is done but the page is marked for writing.
   8: **		It is assumed that the current page in access method buffer
   9: **		is the last physical page in the relation.
  10: */
  11: 
  12: /* tTf flag 86	TTF	add_prim() */
  13: 
  14: add_prim(d, tidx)
  15: struct descriptor   *d;
  16: struct tup_id       *tidx;
  17: {
  18:     register struct accbuf  *b;
  19:     register int        i;
  20: 
  21:     b = Acc_head;
  22:     b->mainpg = b->thispage + 1;
  23:     b->bufstatus |= BUF_DIRTY;
  24:     if (i = pageflush(b))
  25:         return (i);
  26: 
  27:     /*
  28: 	** Now form the new primary page
  29: 	*/
  30: 
  31:     b->thispage = b->mainpg;
  32:     b->mainpg = 0;
  33:     b->ovflopg = 0;
  34:     b->linetab[0] = b->firstup - b;
  35:     b->nxtlino = 0;
  36:     b->bufstatus |= BUF_DIRTY;
  37: 
  38:     /*
  39: 	** Update tid to be new page
  40: 	*/
  41:     stuff_page(tidx, &b->thispage);
  42:     return (0);
  43: }

Defined functions

add_prim defined in line 14; used 1 times
Last modified: 1995-02-04
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1691
Valid CSS Valid XHTML 1.0 Strict