MCPcopy Create free account
hub / github.com/apache/cloudberry / ginint4_consistent

Function ginint4_consistent

contrib/intarray/_int_gin.c:109–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107PG_FUNCTION_INFO_V1(ginint4_consistent);
108
109Datum
110ginint4_consistent(PG_FUNCTION_ARGS)
111{
112 bool *check = (bool *) PG_GETARG_POINTER(0);
113 StrategyNumber strategy = PG_GETARG_UINT16(1);
114 int32 nkeys = PG_GETARG_INT32(3);
115
116 /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
117 bool *recheck = (bool *) PG_GETARG_POINTER(5);
118 bool res = false;
119 int32 i;
120
121 switch (strategy)
122 {
123 case RTOverlapStrategyNumber:
124 /* result is not lossy */
125 *recheck = false;
126 /* at least one element in check[] is true, so result = true */
127 res = true;
128 break;
129 case RTContainedByStrategyNumber:
130 case RTOldContainedByStrategyNumber:
131 /* we will need recheck */
132 *recheck = true;
133 /* at least one element in check[] is true, so result = true */
134 res = true;
135 break;
136 case RTSameStrategyNumber:
137 /* we will need recheck */
138 *recheck = true;
139 /* Must have all elements in check[] true */
140 res = true;
141 for (i = 0; i < nkeys; i++)
142 {
143 if (!check[i])
144 {
145 res = false;
146 break;
147 }
148 }
149 break;
150 case RTContainsStrategyNumber:
151 case RTOldContainsStrategyNumber:
152 /* result is not lossy */
153 *recheck = false;
154 /* Must have all elements in check[] true */
155 res = true;
156 for (i = 0; i < nkeys; i++)
157 {
158 if (!check[i])
159 {
160 res = false;
161 break;
162 }
163 }
164 break;
165 case BooleanSearchStrategy:
166 {

Callers

nothing calls this directly

Calls 1

gin_bool_consistentFunction · 0.85

Tested by

no test coverage detected