From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Berg <myon@debian.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
Date: Fri, 03 Jan 2020 08:52:57 -0500
Message-ID: <13708.1578059577@sss.pgh.pa.us> (raw)
In-Reply-To: <20200103110128.GA28967@msg.df7cb.de>
References: <E1in6ft-0004zR-6l@gemulon.postgresql.org>
<20200103110128.GA28967@msg.df7cb.de>
Christoph Berg <myon@debian.org> writes:
> Re: Tom Lane 2020-01-02 <E1in6ft-0004zR-6l@gemulon.postgresql.org>
>> Add basic TAP tests for psql's tab-completion logic.
> The \DRD test fails on Debian/unstable:
Indeed. It appears that recent libedit breaks tab-completion for
words involving a backslash, which is the fault of this upstream
commit:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/filecomplete.c.diff?r1=1.52&r2=1.53
Basically what that's doing is applying de-backslashing to EVERY
word that completion is attempted on, whether it might be a filename
or not. So what psql_complete sees in this test case is just "DRD"
which of course it does not recognize as a possible psql backslash
command.
I found out while investigating this that the libedit version shipping
with buster (3.1-20181209) is differently broken for the same case:
instead of inapproriate forced de-escaping of the input of the
application-specific completion function, it applies inapproriate
forced escaping to the output of said function, so that when we see
"\DRD" and return "\drds", what comes out to the user is "\\drds".
libedit apparently needs a regression test suite even worse than we do.
I was kind of despairing of fixing this last night, but in the light
of morning it occurs to me that there's a possible workaround for the
de-escape bug: we could make psql_completion ignore the passed "text"
string and look at the original input buffer, as
get_previous_words() is already doing. I don't see any way to
dodge buster's bug, though.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, myon@debian.org, pgsql-hackers@postgresql.org
Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
In-Reply-To: <13708.1578059577@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox