Subject: bug#9566: closed (Re: bug#9566: sql-mode: sql-comint-postgres can't decide if sql-port is an integer or port)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 22 Sep 2011 07:08:03 +0000

Your bug report

#9566: sql-mode: sql-comint-postgres can't decide if sql-port is an integer or port

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
9566: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9566
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#9566: sql-mode: sql-comint-postgres can't decide if sql-port is an integer or port
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Thu, 22 Sep 2011 03:06:43 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.1

Thank you; applied. (FYI, your patch had extraneous whitespace changes.)

Subject: sql-mode: sql-comint-postgres can't decide if sql-port is an integer or port
From: Andrew Schein <[email-masked]>
To: [email-masked]
Date: Tue, 20 Sep 2011 18:08:51 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

sql-port is initialized as an integer in sql.el, but later treated as
a string when building up the params variable within the function
sql-comint-postgres.  Below is my small patch that fixes this.

Cheers,

Andy

=== modified file 'lisp/progmodes/sql.el'
*** lisp/progmodes/sql.el       2011-07-06 03:51:48 +0000
--- lisp/progmodes/sql.el       2011-09-21 00:56:35 +0000
*************** Try to set `comint-output-filter-functio
*** 4719,4731 ****
    ;; sql-postgres-options.
    (let ((params options))
      (if (not (string= "" sql-database))
!       (setq params (append params (list sql-database))))
      (if (not (string= "" sql-server))
!       (setq params (append (list "-h" sql-server) params)))
      (if (not (string= "" sql-user))
!       (setq params (append (list "-U" sql-user) params)))
      (if (not (= 0 sql-port))
!       (setq params (append (list "-p" sql-port) params)))
      (sql-comint product params)))

  (defun sql-postgres-completion-object (sqlbuf schema)
--- 4719,4731 ----
    ;; sql-postgres-options.
    (let ((params options))
      (if (not (string= "" sql-database))
!     (setq params (append params (list sql-database))))
      (if (not (string= "" sql-server))
!     (setq params (append (list "-h" sql-server) params)))
      (if (not (string= "" sql-user))
!     (setq params (append (list "-U" sql-user) params)))
      (if (not (= 0 sql-port))
!     (setq params (append (list "-p" (number-to-string sql-port)) params)))
      (sql-comint product params)))

  (defun sql-postgres-completion-object (sqlbuf schema)

--
Andrew I. Schein
www.andrewschein.com