1: # include "../ingres.h" 2: 3: /* 4: ** Remove tuples from the specified system relation. 5: ** 6: ** 'Desa' is a descriptor for a system relation and 7: ** key[12] and dom[12] are the keys and domain numbers 8: ** to match on for the delete. 9: ** All the tuples in 'desa' with key1 and key2 10: ** are deleted from the relation. 11: */ 12: 13: purgetup(desa, key1, dom1, key2, dom2) 14: struct descriptor *desa; 15: char *key1; 16: int dom1; 17: char *key2; 18: int dom2; 19: { 20: struct tup_id tid, limtid; 21: register int i; 22: char tupkey[MAXTUP], tuple[MAXTUP]; 23: register struct descriptor *d; 24: 25: d = desa; 26: 27: setkey(d, tupkey, key1, dom1); 28: setkey(d, tupkey, key2, dom2); 29: if (i = find(d, EXACTKEY, &tid, &limtid, tupkey)) 30: syserr("purgetup:find:%d", i); 31: while ((i = get(d, &tid, &limtid, tuple, TRUE)) == 0) 32: { 33: if (kcompare(d, tuple, tupkey) == 0) 34: if (i = delete(d, &tid)) 35: syserr("attflush: delete %d", i); 36: } 37: 38: if (i < 0) 39: syserr("purgetup:get %.14s:%d", d->relid, i); 40: }