Tweak distribute_qual_to_rels so that when we decide a pseudoconstant qual can be pushed to the top of the join tree, we update both the relids and qualscope variables to keep them in sync.  This prevents a possible later failure of an Assert clause, and affects nothing else since qualscope isn't used later except for that Assert.  At the moment the Assert shouldn't be reachable when we've pushed the qual up; but this is cheap insurance, and it's more sensible anyway in terms of the overall logic of the routine. Per analysis of a bug report from Stefan Huehner.
Tweak distribute_qual_to_rels so that when we decide a pseudoconstant qual
can be pushed to the top of the join tree, we update both the relids and
qualscope variables to keep them in sync.  This prevents a possible later
failure of an Assert clause, and affects nothing else since qualscope isn't
used later except for that Assert.  At the moment the Assert shouldn't be
reachable when we've pushed the qual up; but this is cheap insurance, and
it's more sensible anyway in terms of the overall logic of the routine.
Per analysis of a bug report from Stefan Huehner.

I'm not back-patching this since it's just future-proofing; but if anyone
gets tempted to change check_outerjoin_delay again in the back branches,
this might be needed.

zeroae/postgres-xl,arcivanov/postgres-xl,adam8157/gpdb,ovr/postgres-xl,lisakowen/gpdb,50wu/gpdb,ashwinstar/gpdb,adam8157/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,greenplum-db/gpdb,lisakowen/gpdb,adam8157/gpdb,pavanvd/postgres-xl,pavanvd/postgres-xl,Postgres-XL/Postgres-XL,xinzweb/gpdb,lisakowen/gpdb,yuanzhao/gpdb,techdragon/Postgres-XL,yuanzhao/gpdb,yazun/postgres-xl,yuanzhao/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,yuanzhao/gpdb,Chibin/gpdb,yuanzhao/gpdb,edespino/gpdb,zeroae/postgres-xl,xinzweb/gpdb,50wu/gpdb,Chibin/gpdb,yazun/postgres-xl,yuanzhao/gpdb,postmind-net/postgres-xl,oberstet/postgres-xl,greenplum-db/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,50wu/gpdb,edespino/gpdb,50wu/gpdb,postmind-net/postgres-xl,snaga/postgres-xl,techdragon/Postgres-XL,jmcatamney/gpdb,Chibin/gpdb,ovr/postgres-xl,xinzweb/gpdb,snaga/postgres-xl,edespino/gpdb,yazun/postgres-xl,ashwinstar/gpdb,Chibin/gpdb,snaga/postgres-xl,techdragon/Postgres-XL,jmcatamney/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,Chibin/gpdb,kmjungersen/PostgresXL,xinzweb/gpdb,ashwinstar/gpdb,Chibin/gpdb,kmjungersen/PostgresXL,ashwinstar/gpdb,ovr/postgres-xl,zeroae/postgres-xl,pavanvd/postgres-xl,ashwinstar/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,xinzweb/gpdb,Chibin/gpdb,tpostgres-projects/tPostgres,kmjungersen/PostgresXL,yuanzhao/gpdb,jmcatamney/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,50wu/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,yuanzhao/gpdb,50wu/gpdb,adam8157/gpdb,adam8157/gpdb,jmcatamney/gpdb,yazun/postgres-xl,greenplum-db/gpdb,50wu/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,edespino/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,zeroae/postgres-xl,greenplum-db/gpdb,oberstet/postgres-xl,jmcatamney/gpdb,oberstet/postgres-xl,kmjungersen/PostgresXL,lisakowen/gpdb,greenplum-db/gpdb,kmjungersen/PostgresXL,yuanzhao/gpdb,snaga/postgres-xl,postmind-net/postgres-xl,snaga/postgres-xl,oberstet/postgres-xl,arcivanov/postgres-xl,zeroae/postgres-xl,Chibin/gpdb,edespino/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,edespino/gpdb,Chibin/gpdb,ovr/postgres-xl,adam8157/gpdb,50wu/gpdb,techdragon/Postgres-XL,Chibin/gpdb,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,tpostgres-projects/tPostgres,ashwinstar/gpdb,ovr/postgres-xl,jmcatamney/gpdb,edespino/gpdb,lisakowen/gpdb,adam8157/gpdb,arcivanov/postgres-xl,arcivanov/postgres-xl,pavanvd/postgres-xl,arcivanov/postgres-xl,postmind-net/postgres-xl,edespino/gpdb,oberstet/postgres-xl,lisakowen/gpdb,tpostgres-projects/tPostgres,arcivanov/postgres-xl