Commit 304007d9 authored by Robert Haas's avatar Robert Haas

Pass EXEC_FLAG_REWIND when initializing a tuplestore scan.

Since a rescan is possible, we must be able to rewind.

Thomas Munro, per a report from Prabhat Sabu

Discussion: http://postgr.es/m/CAEepm=2=Uv5fm=exqL+ygBxaO+-tgmC=o+63H4zYAXi9HtXf1w@mail.gmail.com
parent 3439f844
...@@ -107,7 +107,7 @@ ExecInitNamedTuplestoreScan(NamedTuplestoreScan *node, EState *estate, int eflag ...@@ -107,7 +107,7 @@ ExecInitNamedTuplestoreScan(NamedTuplestoreScan *node, EState *estate, int eflag
scanstate->relation = (Tuplestorestate *) enr->reldata; scanstate->relation = (Tuplestorestate *) enr->reldata;
scanstate->tupdesc = ENRMetadataGetTupDesc(&(enr->md)); scanstate->tupdesc = ENRMetadataGetTupDesc(&(enr->md));
scanstate->readptr = scanstate->readptr =
tuplestore_alloc_read_pointer(scanstate->relation, 0); tuplestore_alloc_read_pointer(scanstate->relation, EXEC_FLAG_REWIND);
/* /*
* The new read pointer copies its position from read pointer 0, which * The new read pointer copies its position from read pointer 0, which
......
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