From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Mauger via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <867dlxnftl.fsf@protected.rcdrun.com> Reply-To: Michael Mauger Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40943"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47357@debbugs.gnu.org, Jean Louis To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 25 00:06:19 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1meldD-000AQQ-81 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Oct 2021 00:06:19 +0200 Original-Received: from localhost ([::1]:35204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meld8-0000oF-0x for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 18:06:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1melcw-0000lb-SG for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 18:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1melcw-0007Bu-Ir for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 18:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1melcw-0006Pq-7k for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 18:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Mauger Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 22:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47357 X-GNU-PR-Package: emacs Original-Received: via spool by 47357-submit@debbugs.gnu.org id=B47357.163511315824652 (code B ref 47357); Sun, 24 Oct 2021 22:06:02 +0000 Original-Received: (at 47357) by debbugs.gnu.org; 24 Oct 2021 22:05:58 +0000 Original-Received: from localhost ([127.0.0.1]:41167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1melcs-0006PY-6w for submit@debbugs.gnu.org; Sun, 24 Oct 2021 18:05:58 -0400 Original-Received: from mail-40131.protonmail.ch ([185.70.40.131]:20224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1melcp-0006P6-MZ for 47357@debbugs.gnu.org; Sun, 24 Oct 2021 18:05:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1635113145; bh=1uyVj9TFQh6kG45jLqqkeTvjSmzcYcKhQAN30yZmRlI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=ZhECS7BgmC3A8UgptUGUPVq1hStYbQbGQS+qdV/gGiUjdT77Q/rqubx8GRKq0ijSH KPBDPPj33frWwGTmvEixqvtexZYdzqO/+8LQSqgf2EP0k63WbQrDvUqxrzeEvOMHLZ EwLDR2m8gtq64zm0UWRr0KwC7PKJZba5EIkipqPw= In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" X-ACL-Warn: , Michael Mauger Xref: news.gmane.io gmane.emacs.bugs:218217 Archived-At: On Thursday, October 21st, 2021 at 5:02 PM, Stefan Kangas 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 buff= er > > - 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