GNU bug report logs - #74996
28.2; sql interactive mode prints output of executed query where the pointer is instead of the bottom of the buffer

Previous Next

Package: emacs;

Reported by: José Júnior <jjnilton <at> gmail.com>

Date: Fri, 20 Dec 2024 16:48:02 UTC

Severity: normal

Found in version 28.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 74996 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74996 <at> debbugs.gnu.org,
 José Júnior <jjnilton <at> gmail.com>
Subject: Re: bug#74996: 28.2; sql interactive mode prints output of executed
 query where the pointer is instead of the bottom of the buffer
Date: Fri, 20 Dec 2024 21:08:36 +0100
On Fri, 20 Dec 2024 21:32:53 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> Date: Fri, 20 Dec 2024 16:03:59 -0300
>> Cc: 74996 <at> debbugs.gnu.org
>> From: José Júnior <jjnilton <at> gmail.com>
>> 
>> Alright, I'll try.
>> 
>> 1. Install mysql or mariadb, on Debian I installed the package `mysql-common`
>> 
>> `sudo apt install mysql-common`
>> 
>> 2. Start the mysql/mariadb server:
>> 
>> `sudo service mysql start`
>> 
>> 3. Log in into the server and create a unprivileged user in the interactive
>> mysql shell:
>> 
>> `sudo mysql -u root`
>> 
>> `CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';`
>> 
>> 4. On Emacs, create a new buffer like `*sql*`, then enable sql-mode `M-x sql-mode`;
>> 
>> 5. Connect to the server using `sql-mysql` by providing the values for
>> what's prompted:
>> 
>> - user: user
>> 
>> - password: password
>> 
>> - database: (leave it empty)
>> 
>> - host: localhost
>> 
>> A sql-interactive-mode buffer should be opened if the connection is successful.
>> 
>> 6. In ther *sql* buffer enter the following query:
>> 
>> `show databases;`
>> 
>> And press `C-c C-c` (sql-send-paragraph) on the line of this query to send
>> it to the server;
>> 
>> An output of this query should be printed on the interactive buffer.
>> 
>> 7. Now switch to the interactive buffer, move the pointer to a line where
>> the output of the previous action was printed.
>> 
>> 8. Switch to the *sql* buffer and press `C-C C-c` to send the command again.
>> 
>> Now you should see that the second execution is mixed with the previous one.
>
> Thanks.  If this needs the mysql package, then why do you think the
> problem is in Emacs and not in mysql?  (Apologies if this makes no
> sense: I know nothing about mysql and almost nothing about sql-mode.)

I don't have MySQL or mariadb but I can reproduce the problem with
PostgreSQL in Emacs 29.4, but not in 30 or master, so it seems to have
been fixed since Emacs 30.

Steve Berman




This bug report was last modified 153 days ago.

Previous Next


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