Fix query-based tab completion for multibyte characters.

Robert Haas <rhaas@postgresql.org>

Commit: 0315dfa8f4afa8390383119330ca0bf241be4ad4
Author: Robert Haas <rhaas@postgresql.org>
Date: 2016-03-04T16:57:22Z
Releases: 9.5.2
Fix query-based tab completion for multibyte characters.

The existing code confuses the byte length of the string (which is
relevant when passing it to pg_strncasecmp) with the character length
of the string (which is relevant when it is used with the SQL substring
function).  Separate those two concepts.

Report and patch by Kyotaro Horiguchi, reviewed by Thomas Munro and
reviewed and further revised by me.

Files

PathChange+/−
src/bin/psql/tab-complete.c modified +19 −11