GNU bug report logs - #19452
24.4; sql-connect fails in first invocation: "Attempt to set a constant symbol: nil"

Previous Next

Package: emacs;

Reported by: JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>

Date: Sat, 27 Dec 2014 06:46:01 UTC

Severity: normal

Merged with 21458, 23280

Found in versions 24.4, 25.0.92

Done: Eli Zaretskii <eliz <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 19452 in the body.
You can then email your comments to 19452 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#19452; Package emacs. (Sat, 27 Dec 2014 06:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 27 Dec 2014 06:46:02 GMT) Full text and rfc822 format available.

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

From: JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; sql-connect fails in first invocation: "Attempt to set a
 constant symbol: nil"
Date: Sat, 27 Dec 2014 07:45:21 +0100
[Message part 1 (text/plain, inline)]
First time in an emacs session I call interactively to sql-connect,
after I am prompted with the "Connection: " to use, emacs fails to
process the request with:

    eval: Attempt to set a constant symbol: nil

Subsequent invocations of the comman works fine

I can reproduce with emacs -Q, evalling this:

    (setq sql-connection-alist
           '(("foo"
              (sql-product  'mysql)
              (sql-database "foo")
              (sql-server   "localhost")
              (sql-user     "foo")
              (sql-password ""))))

And doing M-x sql-connect, then typing "foo" at the prompt.

I tried to use foo, instead of "foo" in the variable definition.  It is
the same.

If this is a bug, I would be happy to test a patch.

Thanks
juanleon


In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2014-12-26 on malaz
Windowing system distributor `The X.Org Foundation', version 11.0.11406000
System Description:    Ubuntu 12.04.5 LTS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: SQLi[MySQL]

Minor modes in effect:
  popwin-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-auto-complete-mode: t
  shell-dirtrack-mode: t
  projectile-global-mode: t
  projectile-mode: t
  back-button-mode: t
  flx-ido-mode: t
  ido-everywhere: t
  global-yascroll-bar-mode: t
  yascroll-bar-mode: t
  winner-mode: t
  show-paren-mode: t
  auto-image-file-mode: t
  recentf-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  temp-buffer-resize-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
[Message part 2 (text/html, inline)]

Merged 19452 21458. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 11 Sep 2015 16:16:02 GMT) Full text and rfc822 format available.

Merged 19452 21458 23280. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 13 Apr 2016 15:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Mon, 25 Jul 2016 20:14:01 GMT) Full text and rfc822 format available.

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

From: Nikolay Kudryavtsev <nikolay.kudryavtsev <at> gmail.com>
To: 19452 <at> debbugs.gnu.org
Subject: Re: 24.4; sql-connect fails in first invocation: "Attempt to set a
 constant symbol: nil"
Date: Mon, 25 Jul 2016 23:12:47 +0300
[Message part 1 (text/plain, inline)]
Ok, this bug has been bugging me long enough.

What happens is that there's a dynamic let block that looks like this:

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

Here's the code that sets param-var:

(setq param-var
          (sql-get-product-feature sql-product :sqli-login nil t))

It uses global variable sql-product. The default sql-product is ansi and 
running the above for it results in nil. Running "(let ((nil ..." leads 
to this error. In the same function there is a block that sets it to a 
proper value based on the current connection, but it is executed after 
param-var is already set. That's why the second time works.


I've attached a simple patch that just reorders code within sql-connect.

-- 
Best Regards,
Nikolay Kudryavtsev

[19452.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Mon, 25 Jul 2016 20:57:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Nikolay Kudryavtsev <nikolay.kudryavtsev <at> gmail.com>, 19452 <at> debbugs.gnu.org
Subject: Re: bug#19452: 24.4;
 sql-connect fails in first invocation: "Attempt to set a
 constant	symbol: nil"
Date: Mon, 25 Jul 2016 22:56:45 +0200
[Message part 1 (text/plain, inline)]
Nikolay Kudryavtsev <nikolay.kudryavtsev <at> gmail.com> writes:

Hi Nikolay,


> +                (mapc
> +                 #'(lambda (vv)
> +                     (set-default (car vv) (eval (cadr vv))))

You don't need to sharp-quote lambdas.

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Tue, 26 Jul 2016 13:20:02 GMT) Full text and rfc822 format available.

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

From: Nikolay Kudryavtsev <nikolay.kudryavtsev <at> gmail.com>
To: Nicolas Petton <nicolas <at> petton.fr>, 19452 <at> debbugs.gnu.org
Subject: Re: bug#19452: 24.4; sql-connect fails in first invocation: "Attempt
 to set a constant symbol: nil"
Date: Tue, 26 Jul 2016 16:19:16 +0300
Yeah, thanks. I just didn't bother to change what was there originally. 
There's a lot more of them there too.

Looking at vc history, sql.el got infested by those sharp-quoted lambdas 
relatively recently, in 2013, at e18e61cf276880f658ab8cdf1f242a675b58cd71.

And I honestly can't blame the author for that. Even the current Elisp 
reference is a bit unclear on the use of sharp-quotes.

-- 
Best Regards,
Nikolay Kudryavtsev





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Tue, 26 Jul 2016 15:12:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Nikolay Kudryavtsev <nikolay.kudryavtsev <at> gmail.com>, 19452 <at> debbugs.gnu.org
Subject: Re: bug#19452: 24.4;
 sql-connect fails in first invocation: "Attempt to set a constant
 symbol: nil"
Date: Tue, 26 Jul 2016 17:11:41 +0200
[Message part 1 (text/plain, inline)]
Nikolay Kudryavtsev <nikolay.kudryavtsev <at> gmail.com> writes:

> Yeah, thanks. I just didn't bother to change what was there originally. 
> There's a lot more of them there too.

I fixed them in master (you'll need to update your patch).

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Tue, 26 Jul 2016 15:40:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicolas Petton <nicolas <at> petton.fr>
Cc: 19452 <at> debbugs.gnu.org, nikolay.kudryavtsev <at> gmail.com
Subject: Re: bug#19452: 24.4;
 sql-connect fails in first invocation: "Attempt to set a constant
 symbol: nil"
Date: Tue, 26 Jul 2016 18:38:54 +0300
> From: Nicolas Petton <nicolas <at> petton.fr>
> Date: Tue, 26 Jul 2016 17:11:41 +0200
> 
> > Yeah, thanks. I just didn't bother to change what was there originally. 
> > There's a lot more of them there too.
> 
> I fixed them in master (you'll need to update your patch).

Thanks.  When you compiled sql.el, did you see the warning below?

  In sql-end-of-statement:
  progmodes/sql.el:2781:31:Warning: looking-back called with 1 argument, but
      requires 2-3




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Tue, 26 Jul 2016 16:42:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Petton <nicolas <at> petton.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19452 <at> debbugs.gnu.org, nikolay.kudryavtsev <at> gmail.com
Subject: Re: bug#19452: 24.4;
 sql-connect fails in first invocation: "Attempt to set a
 constant	symbol: nil"
Date: Tue, 26 Jul 2016 18:41:14 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks.  When you compiled sql.el, did you see the warning below?
>
>   In sql-end-of-statement:
>   progmodes/sql.el:2781:31:Warning: looking-back called with 1 argument, but
>       requires 2-3

Yes, but I haven't changed anything related to this, or?

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Sun, 31 Jul 2016 12:52:02 GMT) Full text and rfc822 format available.

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

From: Nikolay Kudryavtsev <nikolay.kudryavtsev <at> gmail.com>
To: Nicolas Petton <nicolas <at> petton.fr>, 19452 <at> debbugs.gnu.org
Subject: Re: bug#19452: 24.4; sql-connect fails in first invocation: "Attempt
 to set a constant symbol: nil"
Date: Sun, 31 Jul 2016 15:50:48 +0300
[Message part 1 (text/plain, inline)]
Here's the same patch made from the current master.

-- 
Best Regards,
Nikolay Kudryavtsev

[19452.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Tue, 29 Nov 2016 21:05:01 GMT) Full text and rfc822 format available.

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

From: root <at> opow.pw
To: 19452 <at> debbugs.gnu.org
Subject: status?
Date: Tue, 29 Nov 2016 22:01:42 +0100
Hello

Just wondering why it's still not fixed.
Incorrect patch?




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 02 Dec 2016 09:56:01 GMT) Full text and rfc822 format available.

Notification sent to JuanLeon Lahoz <juanleon.lahoz <at> gmail.com>:
bug acknowledged by developer. (Fri, 02 Dec 2016 09:56:02 GMT) Full text and rfc822 format available.

Message #38 received at 19452-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: root <at> opow.pw
Cc: 19452-done <at> debbugs.gnu.org
Subject: Re: bug#19452: status?
Date: Fri, 02 Dec 2016 11:55:01 +0200
> Date: Tue, 29 Nov 2016 22:01:42 +0100
> From: root <at> opow.pw
> 
> Just wondering why it's still not fixed.
> Incorrect patch?

Thanks for the reminder, I pushed the patch to the master branch.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 02 Dec 2016 09:56:02 GMT) Full text and rfc822 format available.

Notification sent to Manuel Uberti - Boccaperta <manuel <at> boccaperta.com>:
bug acknowledged by developer. (Fri, 02 Dec 2016 09:56:02 GMT) Full text and rfc822 format available.

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 02 Dec 2016 09:56:02 GMT) Full text and rfc822 format available.

Notification sent to Manuel Uberti - Boccaperta <manuel <at> boccaperta.com>:
bug acknowledged by developer. (Fri, 02 Dec 2016 09:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19452; Package emacs. (Tue, 13 Dec 2016 16:32:02 GMT) Full text and rfc822 format available.

Message #51 received at 19452-done <at> debbugs.gnu.org (full text, mbox):

From: root <at> opow.pw
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19452-done <at> debbugs.gnu.org
Subject: Re: bug#19452: status?
Date: Tue, 13 Dec 2016 12:06:10 +0100
On Fri, Dec 02, 2016 at 11:55:01AM +0200, Eli Zaretskii wrote:
> > Date: Tue, 29 Nov 2016 22:01:42 +0100
> > From: root <at> opow.pw
> > 
> > Just wondering why it's still not fixed.
> > Incorrect patch?
> 
> Thanks for the reminder, I pushed the patch to the master branch.

Thanks!




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

This bug report was last modified 8 years and 164 days ago.

Previous Next


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