I've frequently run into an annoyance in Emacs's sql-mysql mode, and I'm wondering if anyone has a solution or better workaround. Anytime I try to send a query from an sql-mode buffer to an active SQL process buffer, that query cannot be larger than 4k. If it's larger than 4k, it appears that some sort of break - perhaps a newline - is inserted, and this causes the mysql interpreter to throw an error on the following line.
sql-mysql is implemented by sql.el, and uses the function sql-send-region to send query regions (or whole buffers) to the selected SQL process buffer. sql-send-region calls comint-send-region, which in turn calls process-send-region. process-send-region is a C function that calls send_process, both in src/process.c in the Emacs source.
It looks like this may just be a limitation produced by the 4k buffer on an IPC pipe. Since it appears that kernel hacking is necessary to change this size, that's not a great answer.
What I guess I'm puzzled by is why the SQL sent through the pipe is not properly reassembled by the mysql client if it's larger than 4k. Any ideas?
Emacs version: GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-03-25 on allspice, modified by Debian
mysql -V: mysql Ver 14.14 Distrib 5.5.24, for debian-linux-gnu (x86_64) using readline 6.2
Sql Mysql Options: -A -C -n (NB I've tried both with and without -n (unbuffered) and neither fixed this issue)