GNU bug report logs - #11908
24.1; "Unable to locate SQL program" when using sql-mysql with tramp and the client does not have the SQL program (but the server does)

Previous Next

Package: emacs;

Reported by: Francis Devereux <francis <at> devrx.org>

Date: Wed, 11 Jul 2012 11:40:01 UTC

Severity: normal

Found in version 24.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Francis Devereux <francis <at> devrx.org>
Cc: 11908 <at> debbugs.gnu.org
Subject: bug#11908: 24.1; "Unable to locate SQL program" when using sql-mysql with tramp and the client does not have the SQL program (but the server does)
Date: Fri, 13 Jul 2012 16:31:23 +0200
Francis Devereux <francis <at> devrx.org> writes:

> However, if you comment out the following lines in sql-comint in sql.el:
> ;    (unless (executable-find program)
> ;      (error "Unable to locate SQL program \'%s\'" program))
> then it works - you get an SQLi buffer running mysql in an ssh session on
> the server.

Indeed, `executable-find' does not work in this case. I would propose
the following check, which keeps the test for local processes:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs/lisp/progmodes/sql.el.~109053~	2012-07-13 16:25:32.863194360 +0200
--- /home/albinus/src/emacs/lisp/progmodes/sql.el	2012-07-13 16:24:52.026991734 +0200
***************
*** 4146,4153 ****
  passed as command line arguments."
    (let ((program (sql-get-product-feature product :sqli-program))
          (buf-name "SQL"))
!     ;; make sure we can find the program
!     (unless (executable-find program)
        (error "Unable to locate SQL program \'%s\'" program))
      ;; Make sure buffer name is unique
      (when (sql-buffer-live-p (format "*%s*" buf-name))
--- 4146,4155 ----
  passed as command line arguments."
    (let ((program (sql-get-product-feature product :sqli-program))
          (buf-name "SQL"))
!     ;; Make sure we can find the program.  `executable-find' does not
!     ;; work for remote hosts; we suppress the check there.
!     (unless (or (file-remote-p default-directory)
! 		(executable-find program))
        (error "Unable to locate SQL program \'%s\'" program))
      ;; Make sure buffer name is unique
      (when (sql-buffer-live-p (format "*%s*" buf-name))
--8<---------------cut here---------------end--------------->8---

Could you, please, check, whether this works for you?

> Francis

Best regards, Michael.




This bug report was last modified 13 years and 7 days ago.

Previous Next


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