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
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11908 in the body.
You can then email your comments to 11908 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11908
; Package
emacs
.
(Wed, 11 Jul 2012 11:40:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Francis Devereux <francis <at> devrx.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 11 Jul 2012 11:40:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Steps to reproduce:
1) Have a client machine (i.e. the machine running emacs) with no mysql
executable on the PATH, and a server machine which does have mysql on
the path.
2) C-x C-f /server: RETURN (to open a tramp dired buffer to the server)
3) M-x sql-mysql RETURN, and then fill in username/password/database, leave
server blank
4) You get the message "Unable to locate SQL program 'mysql'"
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.
I'm running Emacs on OS X, server is running Debian GNU/Linux 6.0 (also
happens with Red Hat servers). Can test with a GNU/Linux client if required.
Francis
In GNU Emacs 24.1.1 (x86_64-apple-darwin11.4.0, NS apple-appkit-1138.47)
of 2012-06-10 on jupiter-wifi.repton.int
Windowing system distributor `Apple', version 10.3.1138
Configured using:
`configure '--with-ns''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_GB.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
Major mode: Dired by date
Minor modes in effect:
shell-dirtrack-mode: t
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<return> a s s e t b a n k _ <backspace> <return> <return>
<help-echo> M-x r e p o r t - e m <tab> <return>
Recent messages:
Making completion list...
Quit [3 times]
Loading sql...done
goto-history-element: Beginning of history; no preceding item
Creating customization items...
Creating customization items ...done
Resetting customization items...done
Creating customization setup...done
Quit
Login...
sql-comint: Unable to locate SQL program 'mysql'
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils sql thingatpt cus-edit
cus-start cus-load wid-edit help-mode easymenu view dired tramp-cache
tramp-sh tramp tramp-compat auth-source eieio byte-opt bytecomp
byte-compile cconv macroexp assoc gnus-util mm-util mail-prsvr
password-cache shell pcomplete comint ansi-color ring format-spec advice
help-fns advice-preload tramp-loaddefs regexp-opt time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11908
; Package
emacs
.
(Fri, 13 Jul 2012 14:38:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 11908 <at> debbugs.gnu.org (full text, mbox):
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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11908
; Package
emacs
.
(Fri, 13 Jul 2012 14:52:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 11908 <at> debbugs.gnu.org (full text, mbox):
On 13 Jul 2012, at 15:31, Michael Albinus wrote:
> 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:
[ patch snipped]
> Could you, please, check, whether this works for you?
Yes, this does work for me. I have tested both for a remote host, where the check is correctly skipped, and for the local host, where the check is done and correctly fails when sql-mysql-program can't be found.
Thanks Michael :-)
Francis
Reply sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
You have taken responsibility.
(Fri, 13 Jul 2012 15:07:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Francis Devereux <francis <at> devrx.org>
:
bug acknowledged by developer.
(Fri, 13 Jul 2012 15:07:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 11908-done <at> debbugs.gnu.org (full text, mbox):
Francis Devereux <francis <at> devrx.org> writes:
> Yes, this does work for me. I have tested both for a remote host,
> where the check is correctly skipped, and for the local host, where
> the check is done and correctly fails when sql-mysql-program can't be
> found.
Thanks for the test. I've committed the patch to the trunk, closing this
bug.
> Thanks Michael :-)
>
> Francis
Best regards, Michael.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 11 Aug 2012 11:24:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 312 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.