| 856 | } |
| 857 | |
| 858 | static Node * |
| 859 | transformParamRef(ParseState *pstate, ParamRef *pref) |
| 860 | { |
| 861 | Node *result; |
| 862 | |
| 863 | /* |
| 864 | * The core parser knows nothing about Params. If a hook is supplied, |
| 865 | * call it. If not, or if the hook returns NULL, throw a generic error. |
| 866 | */ |
| 867 | if (pstate->p_paramref_hook != NULL) |
| 868 | result = pstate->p_paramref_hook(pstate, pref); |
| 869 | else |
| 870 | result = NULL; |
| 871 | |
| 872 | if (result == NULL) |
| 873 | ereport(ERROR, |
| 874 | (errcode(ERRCODE_UNDEFINED_PARAMETER), |
| 875 | errmsg("there is no parameter $%d", pref->number), |
| 876 | parser_errposition(pstate, pref->location))); |
| 877 | |
| 878 | return result; |
| 879 | } |
| 880 | |
| 881 | /* Test whether an a_expr is a plain NULL constant or not */ |
| 882 | static bool |
no test coverage detected