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

From: Nikolay Kudryavtsev <[email-masked]>
Date: Sun, 31 Jul 2016 15:50:48 +0300

Here's the same patch made from the current master.

-- 
Best Regards,
Nikolay Kudryavtsev

diff --git lisp/progmodes/sql.el lisp/progmodes/sql.el
index a11d456..9a7b746 100644
*** lisp/progmodes/sql.el
--- lisp/progmodes/sql.el
***************
*** 4040,4045 ****
--- 4040,4051 ----
            (if connect-set
                ;; Set the desired parameters
                (let (param-var login-params set-params rem-params)
+                 ;; Set the parameters and start the interactive session
+                 (mapc
+                  (lambda (vv)
+                    (set-default (car vv) (eval (cadr vv))))
+                  (cdr connect-set))
+                 (setq-default sql-connection connection)

                  ;; :sqli-login params variable
                  (setq param-var
***************
*** 4069,4081 ****
                             (unless (member token set-params)
                               (if plist (cons token plist) token)))))

-                 ;; Set the parameters and start the interactive session
-                 (mapc
-                  (lambda (vv)
-                      (set-default (car vv) (eval (cadr vv))))
-                  (cdr connect-set))
-                 (setq-default sql-connection connection)
-
                  ;; Start the SQLi session with revised list of login parameters
                  (eval `(let ((,param-var ',rem-params))
                           (sql-product-interactive ',sql-product ',new-name))))
--- 4075,4080 ----