GNU bug report logs - #47357
28.0.50; sql-list-tables: Executing SQL command... takes indefinite time after creation of new table

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Wed, 24 Mar 2021 08:00:02 UTC

Severity: minor

Found in version 28.0.50

Full log


View this message in rfc822 format

From: Michael Mauger <mmauger <at> protonmail.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 47357 <at> debbugs.gnu.org, Jean Louis <bugs <at> gnu.support>
Subject: bug#47357: 28.0.50; sql-list-tables: Executing SQL command... takes indefinite time after creation of new table
Date: Sun, 24 Oct 2021 22:05:41 +0000
On Thursday, October 21st, 2021 at 5:02 PM, Stefan Kangas <stefan <at> marxist.se> wrote:
> Jean Louis bugs <at> gnu.support writes:
>
> > I have noticed, but have not researched why, is that function
> > `sql-list-tables' takes indefinite time without completing or giving
> > result when I do following:
> >
> > -   M-x sql-postgres RET and more entries until I get into the SQL buffer
> > -   create new table
> > -   C-c C-l t with new table name is then taking indefinite time.
> >
> > Maybe the library is reading tables only at initializations, I may be
> > wrong. In SQL buffer there is no problem to inspect the table, but C-c
> > C-l t does not allow it for new table created.
> >
> > This may all be wrong and related to some other bug there, I do not
> > know. I was interrupting the indefinite message with C-g.
>
> I'm copying in the sql.el maintainer here. Michael, could you please
> take a look at the above bug report?

The problem here is that the `sql-list-tables' feature uses the
`comint-redirect-send-command-to-process' procedure to capture the SQL
interpreter response and that relies upon the `comint-prompt-regexp'
variable to be set appropriately. Comint Mode itself no longer relies
upon the regexp to spot the prompt but the redirect logic does.

The default prompt regexp for Postgres in sql.el is not correct and a
fix will be made for Emacs 28 and master for that.

I will also add a function to sql.el to verify the prompt as best I can
to Emacs-28 so at least an error message or workaround can be provided.

On master, I'll submit a similar change to comint.el to protect all
Comint derived modes if they use the redirect logic and prevent the
hanging behavior.

I was aware of the bad prompt regexp but had forgotten to commit that
change. I'll go ahead and do that now.
--
MICHAEL <at> MAUGER.COM // FSF and EFF member // GNU Emacs sql.el maintainer




This bug report was last modified 2 years and 345 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.