Bug #11524 delimiter in script run with \. or doesn't work properly
Submitted: 23 Jun 2005 9:31 Modified: 27 Jun 2005 23:59
Reporter: Anders Karlsson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.7 OS:Windows (Windows and Linux)
Assigned to: Assigned Account CPU Architecture:Any

[23 Jun 2005 9:31] Anders Karlsson
Description:
If a SQL script that is run using the \. command from mysql on windows, then it seems that a \d and a delimiter command in that command file gets things mixed up, and any following SQL commands can't be terminated, if the last delimiter command is followed by an empty line.

How to repeat:
Create a file s1.sql using CR/LF line terminators:
delimiter //
delimiter ;

Note that there must be a last empty line, or rather, that the last delimiter command is followed by a linefeed. If not, the problem is not exposed, for some reason. Then run this from mysql:
C:\> mysql test
mysql> \. s1.sql
mysql> select 1;
    -> //
    -> ;
    ->
.. etc.

If the last line in s1.sql doesn't end with an empty line, then this problem isn't exposed.
[23 Jun 2005 9:34] Anders Karlsson
Changed the title of the bug, as this seems not to be related to CR/LF issues after all, but seems more generic than that, and also exists on Linux
[27 Jun 2005 23:59] Jim Winstead
This is really just another manifestation of the problem addressd in Bug #11523.