Interesting problem here. When trying to send any reasonable amount of information in an Emacs SQLi-mode buffer, the result is often unbalanced quotes, and random statements failing to be interpreted. However, when I run the SQL file a little bit at a time, everything works as expected.
Often the result of failed execution of a buffer is an SQL buffer that looks like this:
mysql> mysql> mysql> mysql> Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> -> -> -> -> -> -> -> -> '> '>
'> '> '> '> '> '> '> '> '> '> '>
'> '> '> '> '> '> '> '>
Obviously, closing the quotes manually afterwards results in more errors.
I made sure to dumb down the SQL file so no MySQL-isms are in it in the event that they would confuse the mode, but the problem presists.
With some investigation, it seems to cut out around whatever query is between lines 100-130 (Maybe 128?).
tl;dr - Emacs SQLi mode works when sending SQL in small bits of SQL, but barfs when sending more than 128-ish lines.
Am I missing something here?