Fix edge-case behavior of pg_next_dst_boundary().
Fix edge-case behavior of pg_next_dst_boundary().

Due to rather sloppy thinking (on my part, I'm afraid) about the
appropriate behavior for boundary conditions, pg_next_dst_boundary() gave
undefined, platform-dependent results when the input time is exactly the
last recorded DST transition time for the specified time zone, as a result
of fetching values one past the end of its data arrays.

Change its specification to be that it always finds the next DST boundary
*after* the input time, and adjust code to match that.  The sole existing
caller, DetermineTimeZoneOffset, doesn't actually care about this
distinction, since it always uses a probe time earlier than the instant
that it does care about.  So it seemed best to me to change the API to make
the result=1 and result=0 cases more consistent, specifically to ensure
that the "before" outputs always describe the state at the given time,
rather than hacking the code to obey the previous API comment exactly.

Per bug #6605 from Sergey Burladyan.  Back-patch to all supported versions.

Quikling/gpdb,xinzweb/gpdb,edespino/gpdb,kaknikhil/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,Chibin/gpdb,rvs/gpdb,xinzweb/gpdb,lisakowen/gpdb,Quikling/gpdb,yuanzhao/gpdb,CraigHarris/gpdb,janebeckman/gpdb,ahachete/gpdb,chrishajas/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,adam8157/gpdb,jmcatamney/gpdb,0x0FFF/gpdb,jmcatamney/gpdb,50wu/gpdb,yuanzhao/gpdb,rvs/gpdb,zaksoup/gpdb,ashwinstar/gpdb,lintzc/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,janebeckman/gpdb,50wu/gpdb,janebeckman/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,royc1/gpdb,CraigHarris/gpdb,chrishajas/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xuegang/gpdb,xinzweb/gpdb,janebeckman/gpdb,jmcatamney/gpdb,rvs/gpdb,janebeckman/gpdb,lintzc/gpdb,CraigHarris/gpdb,rvs/gpdb,ahachete/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,Quikling/gpdb,0x0FFF/gpdb,50wu/gpdb,ahachete/gpdb,xinzweb/gpdb,xuegang/gpdb,chrishajas/gpdb,zaksoup/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,xuegang/gpdb,edespino/gpdb,cjcjameson/gpdb,lisakowen/gpdb,royc1/gpdb,50wu/gpdb,zaksoup/gpdb,lintzc/gpdb,chrishajas/gpdb,yuanzhao/gpdb,royc1/gpdb,xinzweb/gpdb,Chibin/gpdb,Chibin/gpdb,ashwinstar/gpdb,rvs/gpdb,janebeckman/gpdb,greenplum-db/gpdb,adam8157/gpdb,chrishajas/gpdb,chrishajas/gpdb,50wu/gpdb,0x0FFF/gpdb,edespino/gpdb,kaknikhil/gpdb,xuegang/gpdb,rvs/gpdb,kaknikhil/gpdb,zaksoup/gpdb,janebeckman/gpdb,janebeckman/gpdb,cjcjameson/gpdb,royc1/gpdb,royc1/gpdb,royc1/gpdb,xuegang/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,ahachete/gpdb,chrishajas/gpdb,0x0FFF/gpdb,jmcatamney/gpdb,50wu/gpdb,lisakowen/gpdb,Chibin/gpdb,CraigHarris/gpdb,Chibin/gpdb,rvs/gpdb,lintzc/gpdb,edespino/gpdb,Quikling/gpdb,royc1/gpdb,greenplum-db/gpdb,adam8157/gpdb,lintzc/gpdb,adam8157/gpdb,greenplum-db/gpdb,janebeckman/gpdb,Quikling/gpdb,edespino/gpdb,0x0FFF/gpdb,50wu/gpdb,Quikling/gpdb,rvs/gpdb,xuegang/gpdb,rvs/gpdb,rvs/gpdb,0x0FFF/gpdb,kaknikhil/gpdb,lintzc/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,edespino/gpdb,lintzc/gpdb,Chibin/gpdb,lisakowen/gpdb,ashwinstar/gpdb,adam8157/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,ahachete/gpdb,adam8157/gpdb,yuanzhao/gpdb,edespino/gpdb,CraigHarris/gpdb,Quikling/gpdb,0x0FFF/gpdb,Quikling/gpdb,xuegang/gpdb,xuegang/gpdb,janebeckman/gpdb,lintzc/gpdb,ashwinstar/gpdb,xinzweb/gpdb,50wu/gpdb,ahachete/gpdb,zaksoup/gpdb,lisakowen/gpdb,xuegang/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,lisakowen/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,zaksoup/gpdb,ahachete/gpdb,royc1/gpdb,Quikling/gpdb,adam8157/gpdb,chrishajas/gpdb,Quikling/gpdb,adam8157/gpdb,yuanzhao/gpdb,edespino/gpdb,zaksoup/gpdb,Chibin/gpdb,Chibin/gpdb,zaksoup/gpdb,edespino/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,xinzweb/gpdb,lintzc/gpdb,Chibin/gpdb,lisakowen/gpdb,ahachete/gpdb,kaknikhil/gpdb,edespino/gpdb,Chibin/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,lisakowen/gpdb,ashwinstar/gpdb,ashwinstar/gpdb