GNU bug report logs - #13715
24.2; Invalid function when calling sql-connect

Previous Next

Package: emacs;

Reported by: roman.scherer <at> nugg.ad

Date: Thu, 14 Feb 2013 19:02:01 UTC

Severity: normal

Merged with 15391

Found in versions 24.2, 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

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 13715 in the body.
You can then email your comments to 13715 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13715; Package emacs. (Thu, 14 Feb 2013 19:02:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to roman.scherer <at> nugg.ad:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 14 Feb 2013 19:02:01 GMT) Full text and rfc822 format available.

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

From: roman.scherer <at> nugg.ad
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; Invalid function when calling sql-connect
Date: Thu, 14 Feb 2013 15:51:27 +0100
I defined some connections in sql-connection-alist like this:

(require 'sql)

(setq sql-connection-alist
      '((db1
         (sql-product 'mysql)
         (sql-server "localhost")
         (sql-user "tiger")
         (sql-password "scotch")
         (sql-database "db1")
         (sql-port 3306))
        (db2
         (sql-product 'mysql)
         (sql-server "localhost")
         (sql-user "tiger")
         (sql-password "scotch")
         (sql-database "db2"))))

When calling sql-connect Emacs errors with the message "Invalid
function: (db1 db2)" when hitting tab or when typing the connection name
and pressing enter.


In GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4)
 of 2013-01-20 on eric
Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
 --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro''

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_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC [ 8 ~ C-x C-e ESC [ B ESC [ B ESC [ B ESC [ B ESC 
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B 
ESC [ B ESC [ B ESC [ B ESC [ B ESC [ 8 ~ C-x C-e RET 
RET ESC x s q TAB c o TAB n TAB RET d b 1 RET ESC x 
ESC x ESC ESC ESC ESC x e m a TAB TAB ESC DEL r e p 
o r t TAB RET

Recent messages:
("emacs" "sql.el")
For information about GNU Emacs and the GNU system, type C-h C-a.
sql
((db1 (sql-product (quote mysql)) (sql-server "localhost") (sql-user "tiger") (sql-password "scotch") (sql-database "db1") (sql-port 3306)) (db2 (sql-product (quote mysql)) (sql-server "localhost") (sql-user "tiger") (sql-password "scotch") (sql-database "db2")))
Making completion list...
test-completion: Invalid function: (db1 db2)
completing-read-default: Command attempted to use minibuffer while in minibuffer [2 times]
Quit
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message idna format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode view sql easymenu thingatpt
comint regexp-opt ansi-color ring time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd 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 dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13715; Package emacs. (Thu, 14 Feb 2013 23:52:03 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: roman.scherer <at> nugg.ad
Cc: 13715 <at> debbugs.gnu.org
Subject: Re: bug#13715: 24.2; Invalid function when calling sql-connect
Date: Thu, 14 Feb 2013 18:50:30 -0500
roman.scherer <at> nugg.ad wrote:

> When calling sql-connect Emacs errors with the message "Invalid
> function: (db1 db2)" when hitting tab or when typing the connection name
> and pressing enter.

Thanks for the report. This should fix it:

*** lisp/progmodes/sql.el	2013-01-01 09:11:05 +0000
--- lisp/progmodes/sql.el	2013-02-14 23:46:50 +0000
***************
*** 3919,3925 ****
    "Read a connection name."
    (let ((completion-ignore-case t))
      (completing-read prompt
!                      (mapcar (lambda (c) (car c))
                               sql-connection-alist)
                       nil t initial 'sql-connection-history default)))
  
--- 3919,3925 ----
    "Read a connection name."
    (let ((completion-ignore-case t))
      (completing-read prompt
!                      (mapcar (lambda (c) (symbol-name (car c)))
                               sql-connection-alist)
                       nil t initial 'sql-connection-history default)))
  




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13715; Package emacs. (Fri, 15 Feb 2013 01:52:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: roman.scherer <at> nugg.ad
Cc: mmaug <at> yahoo.com, 13715 <at> debbugs.gnu.org
Subject: Re: bug#13715: 24.2; Invalid function when calling sql-connect
Date: Thu, 14 Feb 2013 20:50:28 -0500
Re: http://debbugs.gnu.org/13715

Glenn Morris wrote:

> roman.scherer <at> nugg.ad wrote:
>
>> When calling sql-connect Emacs errors with the message "Invalid
>> function: (db1 db2)" when hitting tab or when typing the connection name
>> and pressing enter.
>
> Thanks for the report. This should fix it:
>
> *** lisp/progmodes/sql.el	2013-01-01 09:11:05 +0000
> --- lisp/progmodes/sql.el	2013-02-14 23:46:50 +0000
> ***************
> *** 3919,3925 ****
>     "Read a connection name."
>     (let ((completion-ignore-case t))
>       (completing-read prompt
> !                      (mapcar (lambda (c) (car c))
>                                sql-connection-alist)
>                        nil t initial 'sql-connection-history default)))
>   
> --- 3919,3925 ----
>     "Read a connection name."
>     (let ((completion-ignore-case t))
>       (completing-read prompt
> !                      (mapcar (lambda (c) (symbol-name (car c)))
>                                sql-connection-alist)
>                        nil t initial 'sql-connection-history default)))


However, there seems to be an inconsistency, in that:

sql-connection-alist says "CONNECTION is a symbol identifying the connection"

whereas sql-connect (above) assumes it to be a string.
AFAICS, sql-save-connection also saves strings rather than symbols for NAME.

So maybe it is a doc bug?


On a semi-related note:

emacs -Q -l sql
M-x sql-connect
  -> "Wrong number of arguments" error





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13715; Package emacs. (Fri, 15 Feb 2013 01:56:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: roman.scherer <at> nugg.ad
Cc: mmaug <at> yahoo.com, 13715 <at> debbugs.gnu.org
Subject: Re: bug#13715: 24.2; Invalid function when calling sql-connect
Date: Thu, 14 Feb 2013 20:54:32 -0500
Glenn Morris wrote:

> sql-connection-alist says "CONNECTION is a symbol identifying the connection"

Yet the associated custom :type is a string, so I guess this is just a
doc bug and that you are supposed to use a string rather than a symbol.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13715; Package emacs. (Fri, 15 Feb 2013 17:11:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: 13715 <at> debbugs.gnu.org
Cc: Roman Scherer <roman.scherer <at> nugg.ad>
Subject: Re: bug#13715: 24.2; Invalid function when calling sql-connect
Date: Fri, 15 Feb 2013 12:09:57 -0500
Please keep debbugs cc'd. Resending your comments so they are more visible.

Date: Fri, 15 Feb 2013 10:11:04 +0100
From: Roman Scherer <roman.scherer <at> nugg.ad>

thanks for your help. If I remember correctly it used to work
with symbols. I also tried this with strings like this:

(require 'sql)

(setq sql-connection-alist
      '(("db1"
         (sql-product 'mysql)
         (sql-server "localhost")
         (sql-user "tiger")
         (sql-password "scotch")
         (sql-database "db1")
         (sql-port 3306))
        ("db2"
         (sql-product 'mysql)
         (sql-server "localhost")
         (sql-user "tiger")
         (sql-password "scotch")
         (sql-database "db2"))))

This seems to work. However only after the second time I call
sql-connect. The first time I get the error "eval: Attempt to set

a constant symbol: nil". Calling it the second time works.

I think it breaks in sql-connect near this line:

;; Start the SQLi session with revised list of login parameters

(eval `(let ((,param-var ',rem-params))
         (sql-product-interactive sql-product new-name))))

Roman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13715; Package emacs. (Mon, 11 Mar 2013 01:56:02 GMT) Full text and rfc822 format available.

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

From: Michael Mauger <mmaug <at> yahoo.com>
To: Glenn Morris <rgm <at> gnu.org>, "roman.scherer <at> nugg.ad" <roman.scherer <at> nugg.ad>
Cc: "13715 <at> debbugs.gnu.org" <13715 <at> debbugs.gnu.org>
Subject: Re: bug#13715: 24.2; Invalid function when calling sql-connect
Date: Sun, 10 Mar 2013 18:54:42 -0700 (PDT)
This was a documentation error, version 3.2 corrects this, and the "Wrong number of arguments" error.

Replaced "symbol" with "case-insensitive string"

Thanks for the report.

--Michael


----- Original Message -----
> From: Glenn Morris <rgm <at> gnu.org>
> To: roman.scherer <at> nugg.ad
> Cc: 13715 <at> debbugs.gnu.org; mmaug <at> yahoo.com
> Sent: Thursday, February 14, 2013 8:50 PM
> Subject: Re: bug#13715: 24.2; Invalid function when calling sql-connect
> 
> Re: http://debbugs.gnu.org/13715
> 
> Glenn Morris wrote:
> 
>>  roman.scherer <at> nugg.ad wrote:
>> 
>>>  When calling sql-connect Emacs errors with the message "Invalid
>>>  function: (db1 db2)" when hitting tab or when typing the 
> connection name
>>>  and pressing enter.
>> 
>>  Thanks for the report. This should fix it:
>> 
>>  *** lisp/progmodes/sql.el    2013-01-01 09:11:05 +0000
>>  --- lisp/progmodes/sql.el    2013-02-14 23:46:50 +0000
>>  ***************
>>  *** 3919,3925 ****
>>      "Read a connection name."
>>      (let ((completion-ignore-case t))
>>        (completing-read prompt
>>  !                      (mapcar (lambda (c) (car c))
>>                                 sql-connection-alist)
>>                         nil t initial 'sql-connection-history default)))
>>   
>>  --- 3919,3925 ----
>>      "Read a connection name."
>>      (let ((completion-ignore-case t))
>>        (completing-read prompt
>>  !                      (mapcar (lambda (c) (symbol-name (car c)))
>>                                 sql-connection-alist)
>>                         nil t initial 'sql-connection-history default)))
> 
> 
> However, there seems to be an inconsistency, in that:
> 
> sql-connection-alist says "CONNECTION is a symbol identifying the 
> connection"
> 
> whereas sql-connect (above) assumes it to be a string.
> AFAICS, sql-save-connection also saves strings rather than symbols for NAME.
> 
> So maybe it is a doc bug?
> 
> 
> On a semi-related note:
> 
> emacs -Q -l sql
> M-x sql-connect
>   -> "Wrong number of arguments" error
>




bug marked as fixed in version 24.4, send any further explanations to 13715 <at> debbugs.gnu.org and roman.scherer <at> nugg.ad Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 18 May 2013 00:38:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 15 Jun 2013 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2013 06:58:02 GMT) Full text and rfc822 format available.

Forcibly Merged 13715 15391. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2013 06:58:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 14 Oct 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 190 days ago.

Previous Next


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