Commit bcfeca58 authored by Tom Lane's avatar Tom Lane

Check calling context for connectby_text(), per Joe Conway.

parent c42581eb
...@@ -1048,6 +1048,11 @@ connectby_text(PG_FUNCTION_ARGS) ...@@ -1048,6 +1048,11 @@ connectby_text(PG_FUNCTION_ARGS)
MemoryContext per_query_ctx; MemoryContext per_query_ctx;
MemoryContext oldcontext; MemoryContext oldcontext;
/* check to see if caller supports us returning a tuplestore */
if (!rsinfo || !(rsinfo->allowedModes & SFRM_Materialize))
elog(ERROR, "connectby: materialize mode required, but it is not "
"allowed in this context");
if (fcinfo->nargs == 6) if (fcinfo->nargs == 6)
{ {
branch_delim = GET_STR(PG_GETARG_TEXT_P(5)); branch_delim = GET_STR(PG_GETARG_TEXT_P(5));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment