postgres/src
Tom Lane 47acf3add3 Remove new coupling between NAMEDATALEN and MAX_LEVENSHTEIN_STRLEN.
Commit e529cd4ffa introduced an Assert requiring NAMEDATALEN to be
less than MAX_LEVENSHTEIN_STRLEN, which has been 255 for a long time.
Since up to that instant we had always allowed NAMEDATALEN to be
substantially more than that, this was ill-advised.

It's debatable whether we need MAX_LEVENSHTEIN_STRLEN at all (versus
putting a CHECK_FOR_INTERRUPTS into the loop), or whether it has to be
so tight; but this patch takes the narrower approach of just not applying
the MAX_LEVENSHTEIN_STRLEN limit to calls from the parser.

Trusting the parser for this seems reasonable, first because the strings
are limited to NAMEDATALEN which is unlikely to be hugely more than 256,
and second because the maximum distance is tightly constrained by
MAX_FUZZY_DISTANCE (though we'd forgotten to make use of that limit in one
place).  That means the cost is not really O(mn) but more like O(max(m,n)).

Relaxing the limit for user-supplied calls is left for future research;
given the lack of complaints to date, it doesn't seem very high priority.

In passing, fix confusion between lengths-in-bytes and lengths-in-chars
in comments and error messages.

Per gripe from Kevin Day; solution suggested by Robert Haas.  Back-patch
to 9.5 where the unwanted restriction was introduced.
2016-01-22 11:53:06 -05:00
..
backend Remove new coupling between NAMEDATALEN and MAX_LEVENSHTEIN_STRLEN. 2016-01-22 11:53:06 -05:00
bin Remove dead code in pg_dump. 2016-01-17 11:38:55 -05:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Remove new coupling between NAMEDATALEN and MAX_LEVENSHTEIN_STRLEN. 2016-01-22 11:53:06 -05:00
interfaces Translation updates 2016-01-04 08:18:48 -05:00
makefiles Link $(WIN32RES) into single-file modules only when PGFILEDESC is set. 2015-08-05 20:45:21 -04:00
pl Avoid dump/reload problems when using both plpython2 and plpython3. 2016-01-11 19:55:39 -05:00
port Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:32 -05:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:29 -04:00
test Clean up code for widget_in() and widget_out(). 2016-01-09 13:44:27 -05:00
timezone Update time zone data files to tzdata release 2015g. 2015-10-02 19:15:49 -04:00
tools Properly install dynloader.h on MSVC builds 2016-01-19 23:30:29 -05:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in Back-patch fixes to make TAP tests work on Windows. 2015-11-17 14:10:24 -05:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:30 -04:00
nls-global.mk
win32.mak