| Bug #45502 | error if "Allow Batch=False" | ||
|---|---|---|---|
| Submitted: | 15 Jun 16:05 | Modified: | 18 Jun 10:59 |
| Reporter: | Miguel K | ||
| Status: | Closed | ||
| Category: | Connector/Net | Severity: | S2 (Serious) |
| Version: | 6.0.4 | OS: | Microsoft Windows (Server 2008) |
| Assigned to: | Reggie Burnett | Target Version: | |
| Triage: | D2 (Serious) | ||
[15 Jun 16:05]
Miguel K
[16 Jun 11:02]
Tonci Grgin
Hi Miguel and thanks for your report.
Verified as described using latest SVN sources from trunk. Exception is thrown in
command.cs, Ln:440. 5.2 branch is not affected by this problem.
Test case:
MySqlConnection c = new MySqlConnection();
c.ConnectionString =
"DataSource=***;Database=test;UserID=***;Password=***;PORT=***;logging=True;Allow
Batch=False";
c.Open();
MySqlCommand cmd = c.CreateCommand();
cmd.CommandText = "SELECT version();";
try
{
MySqlDataReader dr =
cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
while (dr.Read())
{
Console.WriteLine(dr.GetDataTypeName(0));
Console.WriteLine(dr.GetFieldType(0));
Console.WriteLine(dr.GetValue(0).GetType().FullName);
Console.WriteLine(dr.GetString(0));
}
dr.Close();
cmd.Dispose();
if (c.State == ConnectionState.Closed) {
Console.WriteLine("Conn closed"); }
else {
c.Close();
}
}
catch (Exception ex)
{
Console.Out.WriteLine(DateTime.UtcNow.ToLongTimeString() + " " + "Exception: "
+ ex.Message);
throw;
}
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'SET character_set_results=NULL' at line
1"
[16 Jun 18:25]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/76407
[16 Jun 21:50]
Reggie Burnett
fixed in 6.0.5
[18 Jun 10:59]
Tony Bedford
An entry was added to the 6.0.5 changelog: Adding the Allow Batch=False option to the connection string caused Connector/NET to generate the error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET character_set_results=NULL' at line 1
