How to send larger than 4k queries from SQL buffer to sql-mysql buffer in Emacs? How to send larger than 4k queries from SQL buffer to sql-mysql buffer in Emacs? linux linux

How to send larger than 4k queries from SQL buffer to sql-mysql buffer in Emacs?


I suspect the culprit to be Emacs's process communication code, used by comint, allocating PTYs to talk to processes. While these are useful for interactive work because they allow job control, they are also limited in how much data they can transfer in one chunk without an intervening newline. Emacs can also be told to use pipes, which do not have this limitation.

To test this, start a fresh Emacs, evaluate M-: (setq process-connection-type nil), and start sql-mysql. If the problem goes away, this is your culprit. In that case, you will want to use something like:

(add-hook 'sql-mysql-mode-hook          (lambda ()            (set (make-local-variable 'process-connection-type) nil)))

to make sure that process-connection-type gets reset only in MySQL interaction buffers.


EDIT

According to http://tinyurl.com/car439o/, Emacs no longer bothers to interrupt long PTY output with newline+EOF pairs. Although the commit is from 2010-04-13, it only appeared in Emacs 24, released in 2012. This would explain why the problem is apparently not reproducible in 24.2.1. If you are using Emacs prior to 24, try upgrading.