/*+ NestLoop(t1 t2) */
EXPLAIN (COSTS false) EXECUTE p8 (10);
ERROR: prepared statement "p8" does not exist
-/*+ NestLoop(t1 t2) */
-EXPLAIN (COSTS false) SELECT count(*) FROM t1, t2 WHERE t1.id = t2.id AND t1.id > 10;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id > 10) AND (id = t2.id))
-(5 rows)
-
/*+ NestLoop(t1 t2) */
EXPLAIN (COSTS false) EXECUTE p8 (10);
ERROR: prepared statement "p8" does not exist
-/*+ NestLoop(t1 t2) */
-EXPLAIN (COSTS false) SELECT count(*) FROM t1, t2 WHERE t1.id = t2.id AND t1.id > 10;
-LOG: pg_hint_plan:
-used hint:
-NestLoop(t1 t2)
-not used hint:
-duplication hint:
-error hint:
-
- QUERY PLAN
---------------------------------------------------------
- Aggregate
- -> Nested Loop
- -> Seq Scan on t2
- -> Index Scan using t1_pkey on t1
- Index Cond: ((id > 10) AND (id = t2.id))
-(5 rows)
-
*/
static void
-ProcessUtility_hook_error_callback(void *arg)
-{
- stmt_name = NULL;
-}
-
-static void
pg_hint_plan_ProcessUtility(Node *parsetree, const char *queryString,
ParamListInfo params, bool isTopLevel,
DestReceiver *dest, char *completionTag)
{
Node *node;
- ErrorContextCallback errcontext;
if (!pg_hint_plan_enable)
{
{
ExecuteStmt *stmt;
- /* Set up callback to statement name reset. */
- errcontext.callback = ProcessUtility_hook_error_callback;
- errcontext.arg = NULL;
- errcontext.previous = error_context_stack;
- error_context_stack = &errcontext;
-
stmt = (ExecuteStmt *) node;
stmt_name = stmt->name;
}
if (stmt_name)
{
stmt_name = NULL;
-
- /* Remove error callback. */
- error_context_stack = errcontext.previous;
}
}