diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 223fb2ec936..ba180c2b26c 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -1270,8 +1270,9 @@ specified, it's `sql-product' or `sql-connection' must match." (and (derived-mode-p 'sql-interactive-mode) (or (not product) (eq product sql-product)) - (or (stringp connection) - (string= connection sql-connection))))))) + (or (not connection) + (and (stringp connection) + (string= connection sql-connection)))))))) ;; Keymap for sql-interactive-mode.