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:22 +0000 (11:57 -0500)
commit0315dfa8f4afa8390383119330ca0bf241be4ad4
treeae7cdb0b1aa767fa3d27628e2041327a0c28b8e7
parent9b3f0c10e7ae60eb0f9ca41f01fb5cc2cbf9cf00
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