Re: pgsql: Add basic TAP tests for psql's tab-completion logic.

Christoph Berg <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.general
Message-ID <[email protected]>
Re: Tom Lane 2020-01-05 <[email protected]>
> The current state of play on this is that I committed a hacky workaround
> [1], but there is now a fix for it in libedit upstream [2][3].  I gather
> from looking at Debian's package page that the fix could be expected to
> propagate to Debian unstable within a few weeks, at which point I'd like
> to revert the hack.  The libedit bug's only been there a few months
> (it was evidently introduced on 2019-03-31) so we can hope that it hasn't
> propagated into any long-term-support distros.
[...]

I lost track of what bug is supposed to be where, so here's a summary
of the state at apt.postgresql.org:

PG13 head work on Debian unstable, buster, stretch.
Does not work on Ubuntu bionic, xenial. (Others not tested.)

Ubuntu xenial:

07:24:42 #   Failed test 'complete SEL<tab> to SELECT'
07:24:42 #   at t/010_tab_completion.pl line 98.
07:24:42 # Actual output was "SEL\tpostgres=# SEL\a"
07:24:42 # Did not match "(?^:SELECT )"
07:24:48
07:24:48 #   Failed test 'complete sel<tab> to select'
07:24:48 #   at t/010_tab_completion.pl line 103.
07:24:48 # Actual output was "sel\b\b\bSELECT "
07:24:48 # Did not match "(?^:select )"
07:24:54
07:24:54 #   Failed test 'complete t<tab> to tab1'
07:24:54 #   at t/010_tab_completion.pl line 106.
07:24:54 # Actual output was "* from t "
07:24:54 # Did not match "(?^:\* from tab1 )"
07:25:00
07:25:00 #   Failed test 'complete my<tab> to mytab when there are multiple choices'
07:25:00 #   at t/010_tab_completion.pl line 112.
07:25:00 # Actual output was "select * from my "
07:25:00 # Did not match "(?^:select \* from my\a?tab)"
07:25:06
07:25:06 #   Failed test 'offer multiple table choices'
07:25:06 #   at t/010_tab_completion.pl line 118.
07:25:06 # Actual output was "\r\n\r\n\r\r\npostgres=# select * from my \r\n\r\n\r\r\npostgres=# select * from my "
07:25:06 # Did not match "(?^:mytab123 +mytab246)"
07:25:12
07:25:12 #   Failed test 'finish completion of one of multiple table choices'
07:25:12 #   at t/010_tab_completion.pl line 123.
07:25:12 # Actual output was "2 "
07:25:12 # Did not match "(?^:246 )"
07:25:18
07:25:18 #   Failed test 'complete \DRD<tab> to \drds'
07:25:18 #   at t/010_tab_completion.pl line 131.
07:25:18 # Actual output was "\\DRD\b\b\b\bselect "
07:25:18 # Did not match "(?^:drds )"
07:25:18 # Looks like you failed 7 tests of 12.
07:25:18 t/010_tab_completion.pl ..
07:25:18 Dubious, test returned 7 (wstat 1792, 0x700)
07:25:18 Failed 7/12 subtests

Ubuntu bionic fails elsewhere:

07:19:51 t/001_stream_rep.pl .................. ok
07:19:53 t/002_archiving.pl ................... ok
07:19:59 t/003_recovery_targets.pl ............ ok
07:20:01 t/004_timeline_switch.pl ............. ok
07:20:08 t/005_replay_delay.pl ................ ok
07:20:10 Bailout called.  Further testing stopped:  system pg_ctl failed
07:20:10 FAILED--Further testing stopped: system pg_ctl failed

07:20:10 2020-01-06 06:19:41.285 UTC [26415] LOG:  received fast shutdown request
07:20:10 2020-01-06 06:19:41.285 UTC [26415] LOG:  aborting any active transactions
07:20:10 2020-01-06 06:19:41.287 UTC [26415] LOG:  background worker "logical replication launcher" (PID 26424) exited with exit code 1
07:20:10 2020-01-06 06:19:41.287 UTC [26419] LOG:  shutting down
07:20:10 2020-01-06 06:19:41.287 UTC [26419] LOG:  checkpoint starting: shutdown immediate

(It didn't get to the 010_tab_completion.pl test.)

Libedit versions are:

Debian:
libedit2   | 3.1-20140620-2 | oldoldstable | amd64, armel, armhf, i386 (jessie)
libedit2   | 3.1-20160903-3 | oldstable    | amd64, arm64, armel, armhf, i386, mips, mips64el, m (stretch)
libedit2   | 3.1-20181209-1 | stable       | amd64, arm64, armel, armhf, i386, mips, mips64el, m (buster)
libedit2   | 3.1-20191211-1 | testing      | amd64, arm64, armel, armhf, i386, mips64el, mipsel, (bullseye)
libedit2   | 3.1-20191231-1 | unstable     | amd64, arm64, armel, armhf, i386, mips64el, mipsel,

Ubuntu:
 libedit2 | 2.11-20080614-3ubuntu2 | precise        | amd64, armel, armhf, i386, powerpc
 libedit2 | 3.1-20130712-2         | trusty         | amd64, arm64, armhf, i386, powerpc, ppc64e
 libedit2 | 3.1-20150325-1ubuntu2  | xenial         | amd64, arm64, armhf, i386, powerpc, ppc64e
 libedit2 | 3.1-20170329-1         | bionic         | amd64, arm64, armhf, i386, ppc64el, s390x
 libedit2 | 3.1-20181209-1         | disco          | amd64, arm64, armhf, i386, ppc64el, s390x
 libedit2 | 3.1-20190324-1         | eoan           | amd64, arm64, armhf, i386, ppc64el, s390x
 libedit2 | 3.1-20191211-1         | focal          | amd64, arm64, armhf, i386, ppc64el, s390x
 libedit2 | 3.1-20191231-1         | focal-proposed | amd64, arm64, armhf, i386, ppc64el, s390x

Christoph
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.