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

Function resolveTargetListUnknowns

src/backend/parser/parse_target.c:289–308  ·  view source on GitHub ↗

* resolveTargetListUnknowns() * Convert any unknown-type targetlist entries to type TEXT. * * We do this after we've exhausted all other ways of identifying the output * column types of a query. */

Source from the content-addressed store, hash-verified

287 * column types of a query.
288 */
289void
290resolveTargetListUnknowns(ParseState *pstate, List *targetlist)
291{
292 ListCell *l;
293
294 foreach(l, targetlist)
295 {
296 TargetEntry *tle = (TargetEntry *) lfirst(l);
297 Oid restype = exprType((Node *) tle->expr);
298
299 if (restype == UNKNOWNOID)
300 {
301 tle->expr = (Expr *) coerce_type(pstate, (Node *) tle->expr,
302 restype, TEXTOID, -1,
303 COERCION_IMPLICIT,
304 COERCE_IMPLICIT_CAST,
305 -1);
306 }
307 }
308}
309
310
311/*

Callers 3

transformSelectStmtFunction · 0.85
transformReturnStmtFunction · 0.85
transformReturningListFunction · 0.85

Calls 3

exprTypeFunction · 0.85
coerce_typeFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected