1: #
2: /*
3: ** COPYRIGHT
4: **
5: ** The Regents of the University of California
6: **
7: ** 1977
8: **
9: ** This program material is the property of the
10: ** Regents of the University of California and
11: ** may not be reproduced or disclosed without
12: ** the prior written permission of the owner.
13: */
14:
15:
16:
17: # define PARBUFSIZ 2000 /* size of buffer for dbu commands */
18: # define TREEMAX 2500 /* max number of bytes for tree */
19: # define MAXATT 150 /* max number of attributes in the att stash */
20:
21: /* mode parameters for range table manipulation */
22: # define LOOKREL 1
23: # define LOOKVAR 2
24: # define R_INTERNAL 3
25: # define R_EXTERNAL 4
26:
27: /* error numbers */
28: # define TREEOFLO 2118 /* over flow tree buffer */
29: # define PBUFOFLO 2106 /* over flow dbu arg buffer */
30:
31: # define NOATTRIN 2100 /* attrib not in relation */
32: # define CANTUPDATE 2107 /* can't update rel */
33: # define NOVBLE 2109 /* vble not declared */
34: # define NOPATMAT 2120 /* no pattern matching in tl */
35: # define RNGEXIST 2117 /* can't find rel for var */
36: # define REPALL 2123 /* x.all on replace */
37: # define BADCONSTOP 2134 /* bad constant operator */
38:
39: # define 2111 /* too many atts in key */
40: # define RESXTRA 2130 /* too many resdoms in tl */
41: # define TARGXTRA 2131 /* tl larger than MAXTUP */
42: # define AGGXTRA 2132 /* too many aggs */
43:
44: # define MODTYPE 2119 /* type conflict for MOD */
45: # define CONCATTYPE 2121 /* type conflict for CONCAT */
46: # define AVGTYPE 2125 /* type conflict for AVG(U) */
47: # define SUMTYPE 2126 /* type conflict for SUM(U) */
48: # define FOPTYPE 2127 /* type conflict for func ops */
49: # define UOPTYPE 2128 /* type conflict for unary ops */
50: # define NUMTYPE 2129 /* type conflict for numeric ops */
51: # define RELTYPE 2133 /* type conflict for relatv op */
52:
53: # define RESTYPE 2103 /* result type mismatch w/expr */
54: # define RESAPPEX 2108 /* append res rel not exist */
55: # define RESEXIST 2135 /* result rel already exists */
56:
57: # define NXTCMDERR 2501 /* misspelt where problem */
58: # define NOQRYMOD 2139 /* no qrymod in database */
59:
60: # define BADHOURS 2136 /* no such hour */
61: # define BADMINS 2137 /* no such minute */
62: # define BAD24TIME 2138 /* only 24:00 can be used */
63:
64: /* -- ASSORTED DATA STRUCTURES -- */
65: struct atstash /* attribute table */
66: {
67: char atbid; /* attribute number */
68: char atbfrmt; /* attribute form type */
69: char atbfrml; /* attribute form length */
70: char atbname[MAXNAME]; /* attribute name */
71: struct atstash *atbnext; /* pointer to next entry in chain */
72: };
73:
74: struct rngtab /* range table */
75: {
76: int rentno; /* variable number of this table position */
77: char rmark; /* was it used in this command */
78: char ractiv; /* is entry empty */
79: int rposit; /* lru position of entry */
80: char varname[MAXNAME + 1]; /* variable name */
81: char relnm[MAXNAME + 1]; /* relation name */
82: char relnowner[2]; /* relation owner */
83: int rstat; /* relstat field of relation relation */
84: int ratts; /* number of attributes in relation */
85: struct atstash *attlist; /* head of attrib list for this reln */
86: };
87:
88: struct constop /* constant operator lookup table */
89: {
90: char *copname; /* string name for identification */
91: int copnum; /* op number */
92: char coptype; /* op result type for formating */
93: char coplen; /* op result length for formatting */
94: };
95:
96: struct rngtab Rngtab[MAXVAR + 1]; /* range table */
97: struct rngtab *Resrng; /* ptr to result reln entry */
98: struct atstash Attable[MAXATT]; /* attrib stash space, turned into a list later */
99: struct atstash *Freeatt; /* free list of attrib stash */
100: struct querytree *Tidnode; /* pointer to tid node of targ list
101: for REPLACE, DELETE */
102: struct querytree *Lastree; /* pointer to root node of tree */
103: struct descriptor Reldesc; /* descriptor for range table lookup */
104: struct descriptor Desc; /* descriptor for attribute relation */
105: extern struct atstash Faketid; /* atstash structure for TID node */
106: #ifdef DISTRIB
107: extern struct atstash Fakesid; /* atstash structure for SID node */
108: #endif
109:
110: int Rsdmno; /* result domain number */
111: int Opflag; /* operator flag contains query mode */
112: char *Relspec; /* ptr to storage structure of result relation */
113: char *Indexspec; /* ptr to stor strctr of index */
114: char *Indexname; /* ptr to name of index */
115: char Trfrmt; /* format for type checking */
116: char Trfrml; /* format length for type checking */
117: char *Trname; /* pointer to attribute name */
118: int Agflag; /* how many aggs in this qry */
119: int Equel; /* indicates EQUEL preprocessor on */
120: int Ingerr; /* set if a query returns an error from processes below */
121: int Patflag; /* signals a pattern match reduction */
122: int Qlflag; /* set when processing a qual */
123: int Noupdt; /* INGRES user override of no update restriction */
124: extern int yypflag; /* disable action stmts if = 0 */
125: int yyline; /* line counter */
126: struct retcode *Lastcnt; /* ptr to last tuple count, or 0 */
127: struct retcode Lastcsp; /* space for last tuple count */
128: int Dcase; /* default case mapping */
129: char **Pv; /* ptr to list of dbu params */
130: char Pbuffer[PARBUFSIZ]; /* buffer for dbu commands */
131: int Pc; /* number of dbu commands */
132: char *Qbuf; /* buffer which holds tree allocated on stack in main.c to get data space */
133: int Permcomd;
134: int Qrymod; /* qrymod on in database flag */
Defined variables
Desc
defined in line
104; used 14 times
Opflag
defined in line
111; used 35 times
- in /usr/ingres/source/parser/control.c line
54
- in /usr/ingres/source/parser/master.grammar line
73-75(2),
107,
118,
135,
151,
167,
185,
208,
221,
332,
355,
377,
452,
481,
638,
656-658(3),
682,
689,
702-707(2),
716,
737-742(2),
750,
758,
804,
815,
862,
869
- in /usr/ingres/source/parser/tree.c line
254,
291
Pc
defined in line
131; used 6 times
Pv
defined in line
129; used 8 times
Qbuf
defined in line
132; used 3 times
Resrng
defined in line
97; used 35 times
- in /usr/ingres/source/parser/call_tree.c line
26-31(3),
41-50(3)
- in /usr/ingres/source/parser/control.c line
55,
105,
140
- in /usr/ingres/source/parser/master.grammar line
175,
181,
187,
203,
246-247(2),
278-279(2),
398-404(3),
411-413(2),
422-423(2),
431-436(4)
- in /usr/ingres/source/parser/rngfcn.c line
177-179(3)
- in /usr/ingres/source/parser/tree.c line
264,
282-288(3)
Rngtab
defined in line
96; used 10 times
Trfrmt
defined in line
115; used 26 times
- in /usr/ingres/source/parser/attfcn.c line
160
- in /usr/ingres/source/parser/format.c line
135,
171,
183,
193-195(2),
205,
212,
235-237(2),
247-260(5),
271-274(2),
283-289(3),
303-306(2),
316
- in /usr/ingres/source/parser/tree.c line
72,
78,
268
Defined struct's
atstash
defined in line
65; used 66 times
- in line 71(2),
85(2),
98-99(4),
105-107(4)
- in /usr/ingres/source/parser/attfcn.c line
13-18(4),
30(2),
36(2),
42-43(4),
88-97(10),
130-135(4),
155-157(4),
170-172(4),
186-189(4),
220(2)
- in /usr/ingres/source/parser/master.grammar line
63(2)
- in /usr/ingres/source/parser/rngfcn.c line
18(2)
- in /usr/ingres/source/parser/tree.c line
21-23(4),
250-252(4)
- in /usr/ingres/source/parser/xdot.c line
28(2)
rngtab
defined in line
74; used 62 times
- in line 96-97(4)
- in /usr/ingres/source/parser/attfcn.c line
32-35(4),
90(2),
132(2),
190-192(4),
217(2)
- in /usr/ingres/source/parser/call_tree.c line
84-86(4)
- in /usr/ingres/source/parser/rngfcn.c line
19(2),
50-55(4),
89(2),
98-99(4),
144(2),
164(2),
188-191(6),
209-212(6),
231(2),
246-250(4),
269(2),
287(2)
- in /usr/ingres/source/parser/xdot.c line
18(2)
Defined macros
defined in line
39; used 1 times
Usage of this include