Resurrect the "last ditch" code path in join_search_one_level().
Resurrect the "last ditch" code path in join_search_one_level().

This essentially reverts commit e54b10a62db2991235fe800c629baef4531a6d67,
in which I'd decided that the "last ditch" join logic was useless.  The
folly of that is now exposed by a report from Pavel Stehule: although the
function should always find at least one join in a self-contained join
problem, it can still fail to do so in a sub-problem created by artificial
from_collapse_limit or join_collapse_limit constraints.  Adjust the
comments to describe this, and simplify the code a bit to match the new
coding of the earlier loop in the function.

I'm not terribly happy about this: I still subscribe to the opinion stated
in the previous commit message that the "last ditch" code can obscure logic
bugs elsewhere.  But the alternative seems to be to complicate the earlier
tests for does-this-relation-have-a-join-clause to the point where they can
tell whether the join clauses link outside the current join sub-problem.
And that looks messy, slow, and possibly a source of bugs in itself.
In any case, now is not the time to be inserting experimental code into
9.2, so let's just go back to the time-tested solution.

pavanvd/postgres-xl,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,lisakowen/gpdb,ashwinstar/gpdb,50wu/gpdb,ovr/postgres-xl,xinzweb/gpdb,ovr/postgres-xl,zeroae/postgres-xl,jmcatamney/gpdb,ashwinstar/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,50wu/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,oberstet/postgres-xl,ovr/postgres-xl,zeroae/postgres-xl,adam8157/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,yazun/postgres-xl,yazun/postgres-xl,zeroae/postgres-xl,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,greenplum-db/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,oberstet/postgres-xl,pavanvd/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,adam8157/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,pavanvd/postgres-xl,50wu/gpdb,50wu/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,Postgres-XL/Postgres-XL,yazun/postgres-xl,techdragon/Postgres-XL,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,50wu/gpdb,pavanvd/postgres-xl,adam8157/gpdb,xinzweb/gpdb,oberstet/postgres-xl,yazun/postgres-xl,50wu/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,oberstet/postgres-xl,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,yazun/postgres-xl,adam8157/gpdb,50wu/gpdb,oberstet/postgres-xl,zeroae/postgres-xl,ovr/postgres-xl,ovr/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,jmcatamney/gpdb