unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Mauger via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: 47357@debbugs.gnu.org, Jean Louis <bugs@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	[thread overview]
Message-ID: <YRSc2gcENmen53NtFLaITx-RFSlZPc2YlP08C188MGgEEub9HHfH7K08HLgk5AHAGiEL4uHBpGLs8G-z-3gUyCu5xbyZISpTaVlr5sFuSYY=@protonmail.com> (raw)
In-Reply-To: <CADwFkmmPqv=9vRhC604u1=_w7ahEDX9cQMRNV4+sTujBbbFvDg@mail.gmail.com>

On Thursday, October 21st, 2021 at 5:02 PM, Stefan Kangas <stefan@marxist.se> wrote:
> Jean Louis bugs@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@MAUGER.COM // FSF and EFF member // GNU Emacs sql.el maintainer





  reply	other threads:[~2021-10-24 22:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  7:58 bug#47357: 28.0.50; sql-list-tables: Executing SQL command... takes indefinite time after creation of new table Jean Louis
2021-10-21 21:02 ` Stefan Kangas
2021-10-24 22:05   ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-10-24 22:24     ` Stefan Kangas
2022-06-26 18:32     ` Lars Ingebrigtsen
2022-07-05  0:39       ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-05 11:16         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='YRSc2gcENmen53NtFLaITx-RFSlZPc2YlP08C188MGgEEub9HHfH7K08HLgk5AHAGiEL4uHBpGLs8G-z-3gUyCu5xbyZISpTaVlr5sFuSYY=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=47357@debbugs.gnu.org \
    --cc=bugs@gnu.support \
    --cc=mmauger@protonmail.com \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).