Bug #65237 Connection timeout do not work as expect.

Submitted: 8 May 2012 8:38 Modified: 8 May 2012 9:07
Reporter: Cong Danh Doan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.5.4 OS:Windows (XP)
Assigned to: CPU Architecture:Any

[8 May 2012 8:38] Cong Danh Doan
Description:
As sample code.
I'm using Microsoft Visual Studio 2010 SP1.
Connector 6.5.4. MySQL server 5.5 and 5.0

How to repeat:
static void Main(string[] args)
        {
            try
            {
                var builder = new MySqlConnectionStringBuilder
                              {
                                  Server = "localhost",
                                  Database = "mydb",
                                  UserID = "usr",
                                  Password = "pwd",
                                  CharacterSet = "utf8",
                                  ConnectionTimeout = 600
                              };
                var connection = new MySqlConnection(builder.GetConnectionString(true));
                var command = new MySqlCommand
                              {
                                  Connection = connection,
                                  CommandText = "select sleep(500)"
                              };
                connection.Open();
                var s = (int)command.ExecuteScalar();
                Console.WriteLine(s);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error:" + ex.Message);
            }

            Console.ReadLine();
        }
[8 May 2012 9:07] Cong Danh Doan
Please kindly reject this report.
It's my mistake. I've choose wrong Properties. Just add DefaultCommandTimeout = 600.
Thanks for your help.

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

Page generated in 0.049 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.