Bug #5922 Queries containing semicolons fail
Submitted: 6 Oct 2004 14:02 Modified: 9 Oct 2004 13:40
Reporter: Puiu Hrenciuc Email Updates:
Status: Duplicate Impact on me:
Category:Connector / NET Severity:S1 (Critical)
Version:1.0.0-Beta OS:Microsoft Windows (Windows XP Pro SP2)
Assigned to: Assigned Account CPU Architecture:Any

[6 Oct 2004 14:02] Puiu Hrenciuc
If you use a semicolon inside a string value to update / insert records, 
the query fails. As far as I read from the MySQL manual semicolon ';' is
not a special character, and same query works just fine in MySQL Query
or MySQL client.

How to repeat:
using System;
using MySql.Data.MySqlClient;

namespace MySQLTest
	class clsMySQLTest
		static void Main(string[] args)
			string SQL;
			MySqlConnection Connection=new MySqlConnection("Username=####;Password=####;Port=3306;Host=localhost;Database=test");
			MySqlCommand Command;

			SQL="CREATE TABLE IF NOT EXISTS test_semicolon (c VARCHAR(3))";
			Command=new MySqlCommand(SQL,Connection);

        // This query fails, sometimes with no errors, but it doesn't insert any record
			SQL="INSERT INTO test_semicolon(c) VALUES('1;')";

			MySqlDataReader Rows;
			SQL="SELECT c FROM test_semicolon";
			while (Rows.Read())
				Console.WriteLine("Value : {0}",Rows.GetString(0));
[6 Oct 2004 14:19] Puiu Hrenciuc
Sorry this is a repeat of the bug with ID 5876