unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Francis Devereux <francis@devrx.org>
Cc: 11908@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	[thread overview]
Message-ID: <87fw8vg2bo.fsf@gmx.de> (raw)
In-Reply-To: <0C01659A-3017-4D3E-AE26-03DED52A29A7@devrx.org> (Francis Devereux's message of "Wed, 11 Jul 2012 12:33:27 +0100")

Francis Devereux <francis@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.





  reply	other threads:[~2012-07-13 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 11:33 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) Francis Devereux
2012-07-13 14:31 ` Michael Albinus [this message]
2012-07-13 14:45   ` Francis Devereux
2012-07-13 15:00     ` Michael Albinus

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=87fw8vg2bo.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=11908@debbugs.gnu.org \
    --cc=francis@devrx.org \
    /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).