Bug #56489 Not handling repreparation of PS

Submitted: 2 Sep 2010 10:04 Modified: 14 Dec 2010 8:24
Reporter: Tonci Grgin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S4 (Feature request)
Version:6.2.4 OS:Any
Assigned to: Reggie Burnett CPU Architecture:Any

[2 Sep 2010 10:04] Tonci Grgin
Description:
c/NET does not handle re-preparation of PS as per chapter 12.6.4 of the MySql 5.1 Reference Manual (http://dev.mysql.com/doc/refman/5.1/en/statement-repreparation.html).

How to repeat:
-

Suggested fix:
-
[13 Dec 2010 18:33] Reggie Burnett
Please give an example test case that illustrates this problem.
[14 Dec 2010 8:25] Bogdan Degtyariov
Cannot repeat using C/NET 6.3.6 and the following test case:

private void bIssue50703_Click(object sender, EventArgs e)
{
    MySqlConnection con = new MySqlConnection();
    try
    {
        con.ConnectionString = "server=localhost;database=test;" +
             "user id=*******;Password=****;Ignore prepare=false";
        con.Open();
        MySqlCommand cmd = new MySqlCommand();
        MySqlCommand cmd2 = new MySqlCommand();

        cmd.Connection = con;
        cmd2.Connection = con;

        cmd2.CommandText = "DROP TABLE IF EXISTS t_issue50703";
        cmd2.ExecuteNonQuery();
        cmd2.CommandText = "CREATE TABLE t_issue50703 (id int auto_increment primary key, txt varchar(32))";
        cmd2.ExecuteNonQuery();

        cmd.CommandText = "INSERT INTO t_issue50703(id, txt) VALUES (@val1, @val2)";

        cmd.Parameters.AddWithValue("@val1", 1);
        cmd.Parameters.AddWithValue("@val2", "something");

        cmd.Prepare();
        cmd.ExecuteNonQuery();

        cmd2.CommandText = "FLUSH TABLES";
        cmd2.ExecuteNonQuery();

        cmd.Parameters[0].Value = 2;
        cmd.Parameters[1].Value = "something 2";
        cmd.ExecuteNonQuery();

        cmd.CommandText = "DROP TABLE IF EXISTS t_issue50703";
        cmd.ExecuteNonQuery();

        tbOutput.AppendText("Done!\r\n");
    }
    catch (Exception ex)
    {
        string error = ex.Message.ToString();
        error += ex.StackTrace;
        tbOutput.AppendText("=============================================\r\n" +
                            "Error!\r\n" + error + "\r\n" +
                            "=============================================\r\n");

    }
    finally
    {
        con.Close();
    }
}

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.