Jim Nasby <jim.na...@bluetreble.com> writes:
> In CteScanNext():
>       /*
>        * If we are not at the end of the tuplestore, or are going 
> backwards, try
>        * to fetch a tuple from tuplestore.
>        */
>       eof_tuplestore = tuplestore_ateof(tuplestorestate);

>       if (!forward && eof_tuplestore)

> For the comment to be correct, wouldn't the condition need to be 
> (!forward || !eof_tuplestore)?

No.  The comment is describing the overall strategy for the next ~30
lines.  That first if-test is dealing with a sub-case, ie reversing
direction after reaching EOF.  The code's fine, and the comments are
okay as far as they go, but maybe some rearrangement would be in order.
Or we could add something like "But first, we must deal with the special
case of reversing direction after reaching EOF."

                        regards, tom lane

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to