Fix query-based tab completion for multibyte characters.
authorRobert Haas <rhaas@postgresql.org>
Fri, 4 Mar 2016 16:53:20 +0000 (11:53 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 4 Mar 2016 16:57:36 +0000 (11:57 -0500)
commitc658d5a9b6323ce16029fdcdbc6b93acc3c24114
tree131df3403b097ba4f46b1dbf1ee735417d3fa06f
parentdcba544dd5f76974ea273cd689ab9ff41a22af1e
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.
src/bin/psql/tab-complete.c