# 2.11BSD#431 - /usr/ingres/source/access/get.c

##### Functions

    get               X

       1: # include   "../ingres.h"
       2: # include   "../aux.h"
       3: # include   "../access.h"
       4:
       5: /*
       6: **	Get - get a single tuple
       7: **
       8: **	Get either gets the next sequencial tuple after
       9: **	"tid" or else gets the tuple specified by tid.
      10: **
      11: **	If getnxt == TRUE, then tid is incremented to the next
      12: **	tuple after tid. If there are no more, then get returns
      13: **	1. Otherwise get returns 0 and "tid" is set to the tid of
      14: **	the returned tuple.
      15: **
      16: **	Under getnxt mode, the previous page is reset before
      17: **	the next page is read. This is done to prevent the previous
      18: **	page from hanging around in the am's buffers when we "know"
      19: **	that it will not be referenced again.
      20: **
      21: **	If getnxt == FALSE then the tuple specified by tid is
      22: **	returned. If the tuple was deleted previously,
      23: **	get retuns 2 else get returns 0.
      24: **
      25: **	If getnxt is true, limtid holds the the page number
      26: **	of the first page past the end point. Limtid and the
      27: **	initial value of tid are set by calls to FIND.
      28: **
      29: **	returns:
      30: **		<0  fatal error
      31: **		0   success
      32: **		1   end of scan (getnxt=TRUE only)
      33: **		2   tuple deleted (getnxt=FALSE only)
      34: */
      35:
      36:
      37: get(d, tid, limtid, tuple, getnxt)
      38: struct descriptor   *d;
      39: struct tup_id       *tid, *limtid;
      40: int         getnxt;
      41: char            *tuple;
      42: {
      43:     register int        i;
      44:     register struct tup_id  *tidx;
      45:     long            pageid, lpageid;
      46:
      47: #	ifdef xATR1
      48:     if (tTf(93, 0))
      49:     {
      50:         printf("get: %.14s,", d->relid);
      51:         dumptid(tid);
      52:         printf("get: lim");
      53:         dumptid(limtid);
      54:     }
      55: #	endif
      56:     tidx = tid;
      57:     if (get_page(d, tidx))
      58:     {
      59:         return (-1);
      60:     }
      61:     if (getnxt)
      62:     {
      63:         pluck_page(limtid, &lpageid);
      64:         do
      65:         {
      66:             while (((++(tidx->line_id)) & I1MASK) >= Acc_head->nxtlino)
      67:             {
      68:                 tidx->line_id = -1;
      69:                 pageid = Acc_head->ovflopg;
      70:                 stuff_page(tidx, &pageid);
      71:                 if (pageid == 0)
      72:                 {
      73:                     pageid = Acc_head->mainpg;
      74:                     stuff_page(tidx, &pageid);
      75:                     if (pageid == 0 || pageid == lpageid + 1)
      76:                         return (1);
      77:                 }
      78:                 if (i = resetacc(Acc_head))
      79:                     return (i);
      80:                 if (i = get_page(d, tidx))
      81:                     return (i);
      82:             }
      83:         } while (!Acc_head->linetab[-(tidx->line_id & I1MASK)]);
      84:     }
      85:     else
      86:     {
      87:         if (i = invalid(tidx))
      88:             return (i);
      89:     }
      90:     get_tuple(d, tidx, tuple);
      91: #	ifdef xATR2
      92:     if (tTf(93, 1))
      93:     {
      94:         printf("get: ");
      95:         printup(d, tuple);
      96:     }
      97: #	endif
      98:     return (0);
      99: }

#### Defined functions

get defined in line 37; used 41 times

- in /usr/ingres/source/access/batch.c line 109
- in /usr/ingres/source/access/getequal.c line 45
- in /usr/ingres/source/access/openr.c line 240
- in /usr/ingres/source/dbu/copy.c line 275, 683
- in /usr/ingres/source/dbu/display.c line 311
- in /usr/ingres/source/dbu/get_seq_atts.c line 86
- in /usr/ingres/source/dbu/help.c line 196, 342
- in /usr/ingres/source/dbu/index.c line 165
- in /usr/ingres/source/dbu/ksort.c line 199
- in /usr/ingres/source/dbu/modify.c line 704, 844, 993
- in /usr/ingres/source/dbu/modupdate.c line 109
- in /usr/ingres/source/dbu/pr_prot.c line 150
- in /usr/ingres/source/dbu/print.c line 132
- in /usr/ingres/source/dbu/purgetup.c line 31
- in /usr/ingres/source/dbu/rmqm.c line 456, 599
- in /usr/ingres/source/dbu/secupdate.c line 46
- in /usr/ingres/source/dbu/userdestroy.c line 92
- in /usr/ingres/source/decomp/decomp.c line 191
- in /usr/ingres/source/decomp/reformat.c line 500
- in /usr/ingres/source/ovqp/interp.c line 180
- in /usr/ingres/source/ovqp/scan.c line 141, 161
- in /usr/ingres/source/ovqp/strategy.c line 95
- in /usr/ingres/source/parser/xdot.c line 46
- in /usr/ingres/source/qrymod/integrity.c line 130
- in /usr/ingres/source/qrymod/protect.c line 486
- in /usr/ingres/source/support/purge.c line 142
- in /usr/ingres/source/support/restore.c line 334, 392, 554, 705, 751, 795, 829, 927, 1014

Last modified: 1980-12-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 545 |