Fix booltestsel() for case where we have NULL stats but not MCV stats.
Fix booltestsel() for case where we have NULL stats but not MCV stats.

In a boolean column that contains mostly nulls, ANALYZE might not find
enough non-null values to populate the most-common-values stats,
but it would still create a pg_statistic entry with stanullfrac set.
The logic in booltestsel() for this situation did the wrong thing for
"col IS NOT TRUE" and "col IS NOT FALSE" tests, forgetting that null
values would satisfy these tests (so that the true selectivity would
be close to one, not close to zero).  Per bug #8274.

Fix by Andrew Gierth, some comment-smithing by me.

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