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

Function errdetail_execute

src/backend/tcop/postgres.c:3253–3277  ·  view source on GitHub ↗

* errdetail_execute * * Add an errdetail() line showing the query referenced by an EXECUTE, if any. * The argument is the raw parsetree list. */

Source from the content-addressed store, hash-verified

3251 * The argument is the raw parsetree list.
3252 */
3253static int
3254errdetail_execute(List *raw_parsetree_list)
3255{
3256 ListCell *parsetree_item;
3257
3258 foreach(parsetree_item, raw_parsetree_list)
3259 {
3260 RawStmt *parsetree = lfirst_node(RawStmt, parsetree_item);
3261
3262 if (IsA(parsetree->stmt, ExecuteStmt))
3263 {
3264 ExecuteStmt *stmt = (ExecuteStmt *) parsetree->stmt;
3265 PreparedStatement *pstmt;
3266
3267 pstmt = FetchPreparedStatement(stmt->name, false);
3268 if (pstmt)
3269 {
3270 errdetail("prepare: %s", pstmt->plansource->query_string);
3271 return 0;
3272 }
3273 }
3274 }
3275
3276 return 0;
3277}
3278
3279/*
3280 * errdetail_params

Callers 1

exec_simple_queryFunction · 0.85

Calls 3

FetchPreparedStatementFunction · 0.85
foreachFunction · 0.50
errdetailFunction · 0.50

Tested by

no test coverage detected