all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#30494: 25.2; (setting-constant nil) error in sql.el
@ 2018-02-16 21:52 sciamano
  2018-03-09  1:18 ` Noam Postavsky
  0 siblings, 1 reply; 7+ messages in thread
From: sciamano @ 2018-02-16 21:52 UTC (permalink / raw)
  To: 30494

Hi,

i'm trying to add SQL product by following steps from the introduction
section in the sql.el, but for the settings
:sqli-program
:sqli-login
:sqli-options
it fails with "attemt to set a constant symbol: nil"

In 'emacs -Q' executing it step-by-step:

(require 'sql)

(sql-add-product 'xyz "XyzDB"
                 '(:free-software t))

(defcustom my-sql-xyz-program "ixyz"
  "Command to start ixyz by XyzDB."
  :type 'file
  :group 'SQL)

;; NEXT STEP FAILS WITH:
;; Debugger entered--Lisp error: (setting-constant nil)
;;  sql-set-product-feature(xyz :sqli-program my-sql-xyz-program)
;;  eval((sql-set-product-feature (quote xyz) :sqli-program (quote my-sql-xyz-program)) nil)
(sql-set-product-feature 'xyz
                         :sqli-program 'my-sql-xyz-program)

;; BUT THIS TWO ARE OK
(sql-set-product-feature 'xyz
			 :prompt-regexp "^xyzdb> ")
(sql-set-product-feature 'xyz
			 :prompt-length 7)


-- 
Denis






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30494: 25.2; (setting-constant nil) error in sql.el
  2018-02-16 21:52 bug#30494: 25.2; (setting-constant nil) error in sql.el sciamano
@ 2018-03-09  1:18 ` Noam Postavsky
  2018-12-01  0:30   ` Pierre Téchoueyres
  0 siblings, 1 reply; 7+ messages in thread
From: Noam Postavsky @ 2018-03-09  1:18 UTC (permalink / raw)
  To: sciamano; +Cc: 30494

tags 30494 + confirmed easy
quit

sciamano@yandex.ru writes:

> In 'emacs -Q' executing it step-by-step:
>
> (require 'sql)
>
> (sql-add-product 'xyz "XyzDB"
>                  '(:free-software t))
>
> (defcustom my-sql-xyz-program "ixyz"
>   "Command to start ixyz by XyzDB."
>   :type 'file
>   :group 'SQL)
>
> ;; NEXT STEP FAILS WITH:
> ;; Debugger entered--Lisp error: (setting-constant nil)
> ;;  sql-set-product-feature(xyz :sqli-program my-sql-xyz-program)
> ;;  eval((sql-set-product-feature (quote xyz) :sqli-program (quote my-sql-xyz-program)) nil)
> (sql-set-product-feature 'xyz
>                          :sqli-program 'my-sql-xyz-program)

Looks like it's probably just a missing nil check in
sql-set-product-feature.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30494: 25.2; (setting-constant nil) error in sql.el
  2018-03-09  1:18 ` Noam Postavsky
@ 2018-12-01  0:30   ` Pierre Téchoueyres
  2018-12-13 19:40     ` Pierre Téchoueyres
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Téchoueyres @ 2018-12-01  0:30 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: sciamano, 30494

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

Noam Postavsky <npostavs@gmail.com> writes:

> tags 30494 + confirmed easy
> quit
>
> sciamano@yandex.ru writes:
>
>> In 'emacs -Q' executing it step-by-step:
>>
>> (require 'sql)
>>
>> (sql-add-product 'xyz "XyzDB"
>>                  '(:free-software t))
>>
>> (defcustom my-sql-xyz-program "ixyz"
>>   "Command to start ixyz by XyzDB."
>>   :type 'file
>>   :group 'SQL)
>>
>> ;; NEXT STEP FAILS WITH:
>> ;; Debugger entered--Lisp error: (setting-constant nil)
>> ;;  sql-set-product-feature(xyz :sqli-program my-sql-xyz-program)
>> ;;  eval((sql-set-product-feature (quote xyz) :sqli-program (quote my-sql-xyz-program)) nil)
>> (sql-set-product-feature 'xyz
>>                          :sqli-program 'my-sql-xyz-program)
>
> Looks like it's probably just a missing nil check in
> sql-set-product-feature.
>

Does the attached patch do the trick ?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix bug30494 --]
[-- Type: text/x-patch, Size: 1442 bytes --]

From fc0ee63bb0cadb054260ea74d310720ac3068f15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <pierre.techoueyres@free.fr>
Date: Sat, 1 Dec 2018 01:20:45 +0100
Subject: [PATCH] Check that feature exist in `sql-set-product-feature'
 (Bug#30494).

* lisp/progmodes/sql.el: add check for feature existence.
---
 lisp/progmodes/sql.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index e7d7494d2c..9051a6ad07 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -2533,13 +2533,17 @@ sql-set-product-feature
 
   (let* ((p (assoc product sql-product-alist))
          (v (plist-get (cdr p) feature)))
-    (if p
+    (if (and p v)
         (if (and
              (member feature sql-indirect-features)
              (symbolp v))
             (set v newvalue)
           (setcdr p (plist-put (cdr p) feature newvalue)))
-      (error "`%s' is not a known product; use `sql-add-product' to add it first." product))))
+      (progn
+       (when (null p)
+         (error "`%s' is not a known product; use `sql-add-product' to add it first." product))
+       (when (null v)
+         (error "`%s' is not a known feature for `%s'; use `sql-add-product' to add it first." feature product))))))
 
 (defun sql-get-product-feature (product feature &optional fallback not-indirect)
   "Lookup FEATURE associated with a SQL PRODUCT.
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#30494: 25.2; (setting-constant nil) error in sql.el
  2018-12-01  0:30   ` Pierre Téchoueyres
@ 2018-12-13 19:40     ` Pierre Téchoueyres
  2018-12-23 19:51       ` Pierre Téchoueyres
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Téchoueyres @ 2018-12-13 19:40 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: sciamano, 30494

pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:

> Noam Postavsky <npostavs@gmail.com> writes:
>
>> tags 30494 + confirmed easy
>> quit
>>
>> sciamano@yandex.ru writes:
>>
>>> In 'emacs -Q' executing it step-by-step:
>>>
>>> (require 'sql)
>>>
>>> (sql-add-product 'xyz "XyzDB"
>>>                  '(:free-software t))
>>>
>>> (defcustom my-sql-xyz-program "ixyz"
>>>   "Command to start ixyz by XyzDB."
>>>   :type 'file
>>>   :group 'SQL)
>>>
>>> ;; NEXT STEP FAILS WITH:
>>> ;; Debugger entered--Lisp error: (setting-constant nil)
>>> ;;  sql-set-product-feature(xyz :sqli-program my-sql-xyz-program)
>>> ;;  eval((sql-set-product-feature (quote xyz) :sqli-program (quote my-sql-xyz-program)) nil)
>>> (sql-set-product-feature 'xyz
>>>                          :sqli-program 'my-sql-xyz-program)
>>
>> Looks like it's probably just a missing nil check in
>> sql-set-product-feature.
>>
>
> Does the attached patch do the trick ?
>
Any interrest on this ?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30494: 25.2; (setting-constant nil) error in sql.el
  2018-12-13 19:40     ` Pierre Téchoueyres
@ 2018-12-23 19:51       ` Pierre Téchoueyres
  2019-01-08 22:00         ` Pierre Téchoueyres
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Téchoueyres @ 2018-12-23 19:51 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: sciamano, 30494

pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:

> pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:
>
>> Noam Postavsky <npostavs@gmail.com> writes:
>>
>>> tags 30494 + confirmed easy
>>> quit
>>>
>>> sciamano@yandex.ru writes:
>>>
>>>> In 'emacs -Q' executing it step-by-step:
>>>>
>>>> (require 'sql)
>>>>
>>>> (sql-add-product 'xyz "XyzDB"
>>>>                  '(:free-software t))
>>>>
>>>> (defcustom my-sql-xyz-program "ixyz"
>>>>   "Command to start ixyz by XyzDB."
>>>>   :type 'file
>>>>   :group 'SQL)
>>>>
>>>> ;; NEXT STEP FAILS WITH:
>>>> ;; Debugger entered--Lisp error: (setting-constant nil)
>>>> ;;  sql-set-product-feature(xyz :sqli-program my-sql-xyz-program)
>>>> ;;  eval((sql-set-product-feature (quote xyz) :sqli-program (quote my-sql-xyz-program)) nil)
>>>> (sql-set-product-feature 'xyz
>>>>                          :sqli-program 'my-sql-xyz-program)
>>>
>>> Looks like it's probably just a missing nil check in
>>> sql-set-product-feature.
>>>
>>
>> Does the attached patch do the trick ?
>>
> Any interrest on this ?

Ping ! Or if this isn't desired, maybe it's time to close the bug ?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30494: 25.2; (setting-constant nil) error in sql.el
  2018-12-23 19:51       ` Pierre Téchoueyres
@ 2019-01-08 22:00         ` Pierre Téchoueyres
  2019-01-12 11:35           ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Téchoueyres @ 2019-01-08 22:00 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: sciamano, 30494

pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:

> pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:
>
>> pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:
>>
>>> Noam Postavsky <npostavs@gmail.com> writes:
>>>
>>>> tags 30494 + confirmed easy
>>>> quit
>>>>
>>>> sciamano@yandex.ru writes:
>>>>
>>>>> In 'emacs -Q' executing it step-by-step:
>>>>>
>>>>> (require 'sql)
>>>>>
>>>>> (sql-add-product 'xyz "XyzDB"
>>>>>                  '(:free-software t))
>>>>>
>>>>> (defcustom my-sql-xyz-program "ixyz"
>>>>>   "Command to start ixyz by XyzDB."
>>>>>   :type 'file
>>>>>   :group 'SQL)
>>>>>
>>>>> ;; NEXT STEP FAILS WITH:
>>>>> ;; Debugger entered--Lisp error: (setting-constant nil)
>>>>> ;;  sql-set-product-feature(xyz :sqli-program my-sql-xyz-program)
>>>>> ;;  eval((sql-set-product-feature (quote xyz) :sqli-program (quote my-sql-xyz-program)) nil)
>>>>> (sql-set-product-feature 'xyz
>>>>>                          :sqli-program 'my-sql-xyz-program)
>>>>
>>>> Looks like it's probably just a missing nil check in
>>>> sql-set-product-feature.
>>>>
>>>
>>> Does the attached patch do the trick ?
>>>
>> Any interrest on this ?
>
> Ping ! Or if this isn't desired, maybe it's time to close the bug ?

Ping ! Ping !





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#30494: 25.2; (setting-constant nil) error in sql.el
  2019-01-08 22:00         ` Pierre Téchoueyres
@ 2019-01-12 11:35           ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-01-12 11:35 UTC (permalink / raw)
  To: Pierre Téchoueyres; +Cc: sciamano, npostavs, 30494-done

> From: pierre.techoueyres@free.fr (Pierre Téchoueyres)
> Date: Tue, 08 Jan 2019 23:00:06 +0100
> Cc: sciamano@yandex.ru, 30494@debbugs.gnu.org
> 
> >>>> Looks like it's probably just a missing nil check in
> >>>> sql-set-product-feature.
> >>>>
> >>>
> >>> Does the attached patch do the trick ?
> >>>
> >> Any interrest on this ?
> >
> > Ping ! Or if this isn't desired, maybe it's time to close the bug ?
> 
> Ping ! Ping !

Sorry for lack of replies so far.

I've now pushed these changes to the master branch, and I'm closing
the bug report.  In the future, please be sure to state in the log
message the function(s) where you make changes.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-12 11:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-16 21:52 bug#30494: 25.2; (setting-constant nil) error in sql.el sciamano
2018-03-09  1:18 ` Noam Postavsky
2018-12-01  0:30   ` Pierre Téchoueyres
2018-12-13 19:40     ` Pierre Téchoueyres
2018-12-23 19:51       ` Pierre Téchoueyres
2019-01-08 22:00         ` Pierre Téchoueyres
2019-01-12 11:35           ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.