Bug #61680 MySqlScript.Execute throws exception if DELIMITER is not followed by a newline
Submitted: 28 Jun 2011 21:18 Modified: 8 Jul 2011 13:22
Reporter: Roman Ovseitsev Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.3.7 OS:Windows (Windows 7 32bit)
Assigned to: Julio Casal CPU Architecture:Any

[28 Jun 2011 21:18] Roman Ovseitsev
Description:
MySqlScript.Execute throws "Index was outside the bounds of the array." exception if query string contains DELIMITER command in the end which is not followed by a newline.

How to repeat:
MySqlScript script = new MySqlScript(conn, "DELIMITER ;");
script.Execute();
[1 Jul 2011 6:02] Bogdan Degtyariov
Hi Roman,

MySqlScript class helps to deal with the command delimiters, but it has to be done in a different way:

MySqlScript script = new MySqlScript(conn);
script.Delimiter = ";";
script.Execute();

Setting the status "Not a bug".
[1 Jul 2011 13:16] Reggie Burnett
the example given by the poster should work.  Setting back to open
[8 Jul 2011 13:22] Julio Casal
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

Fixed in 6.1.7, 6.2.6, 6.3.8 and 6.4.4+.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html