postgresql/src
Tom Lane aad663a0b4 Reduce number of bytes examined by convert_one_string_to_scalar().
Previously, convert_one_string_to_scalar() would examine up to 20 bytes of
the input string, producing a scalar conversion with theoretical precision
far greater than is of any possible use considering the other limitations
on the accuracy of the resulting selectivity estimate.  (I think this
choice might pre-date the caller-level logic that strips any common prefix
of the strings; before that, there could have been value in scanning the
strings far enough to use all the precision available in a double.)

Aside from wasting cycles to little purpose, this choice meant that the
"denom" variable could grow to as much as 256^21 = 3.74e50, which could
overflow in some non-IEEE float arithmetics.  While we don't really support
any machines with non-IEEE arithmetic anymore, this still seems like quite
an unnecessary platform dependency.  Limit the scan to 12 bytes instead,
thus limiting "denom" to 256^13 = 2.03e31, a value more likely to be
computable everywhere.

Per testing by Greg Stark, which showed overflow failures in our standard
regression tests on VAX.
2015-08-23 15:15:47 -04:00
..
backend Reduce number of bytes examined by convert_one_string_to_scalar(). 2015-08-23 15:15:47 -04:00
bin Add hint to run "pgbench -i", if test tables don't exist. 2015-08-22 14:19:10 +01:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Avoid use of float arithmetic in bipartite_match.c. 2015-08-23 13:02:18 -04:00
interfaces Fix declaration of isarray variable. 2015-08-13 13:23:58 +02:00
makefiles Link $(WIN32RES) into single-file modules only when PGFILEDESC is set. 2015-08-05 20:43:07 -04:00
pl Detect mismatched CONTINUE and EXIT statements at plpgsql compile time. 2015-08-21 20:17:19 -04:00
port Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
template Attempt to work around a 32bit xlc compiler bug from a different place. 2015-08-08 01:19:02 +02:00
test Detect mismatched CONTINUE and EXIT statements at plpgsql compile time. 2015-08-21 20:17:19 -04:00
timezone Update time zone data files to tzdata release 2015d. 2015-05-15 19:35:29 -04:00
tools MSVC: Exclude 'brin' contrib module 2015-08-13 19:28:54 -03:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Consolidate makefile code for setting top_srcdir, srcdir and VPATH. 2015-07-30 20:48:41 -04:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:26 -04:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00