public static void T_AsyncSocket1()
 {
     var connStr = GetMySqlConnString();
     var conn = new MySqlConnection(connStr);
     conn.Open(() =>
     {
         conn.UpdateMaxAllowPacket();
     });
     //conn.Close();
 }
        public static void T_InsertBlobData()
        {
            var connStr = GetMySqlConnString();
            var conn = new MySqlConnection(connStr);
            conn.Open();
            conn.UpdateMaxAllowPacket();
            //DropIfExist(conn);
            //CreateNewTable(conn);
            //InsertMore(conn);
            //if (ReadAll(conn))
            //{
            //    return;
            //}
            {
                string sql = "drop table if exists test001";
                var cmd = new MySqlCommand(sql, conn);
                cmd.ExecuteNonQuery();
            }

            {
                string sql = "create table test001(col_id int(10) unsigned not null auto_increment, mydata longblob,primary key(col_id)) ENGINE=MyISAM DEFAULT CHARSET=latin1";
                var cmd = new MySqlCommand(sql, conn);
                cmd.ExecuteNonQuery();
            }
            //create sample blob
            byte[] data = CreateTestData();
            uint lastInsertId = 0;
            //int testdata_crc32 = 0;
            {
                string sql = "insert into test001(mydata) values(?mydata)";
                var cmd = new MySqlCommand(sql, conn);
                cmd.Prepare();

                //testdata_crc32 = SharpConnect.CRC32Calculator.CalculateCrc32(data);
                cmd.Parameters.AddWithValue("?mydata", data);
                for(int i = 0; i < 5; i++)
                {
                    cmd.ExecuteNonQuery();
                }
                lastInsertId = cmd.LastInsertedId;
            }

            {
                if (lastInsertId > 0)
                {
                    //test download back
                    string sql = "select mydata from test001 where col_id<=?col_id";
                    var cmd = new MySqlCommand(sql, conn);
                    cmd.Prepare();
                    cmd.Parameters.AddWithValue("?col_id", lastInsertId);
                    var reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        byte[] dataBuffer = reader.GetBuffer(0);
                        if (Match(data, dataBuffer))
                        {
                            Console.WriteLine("All Matching!!!");
                        }
                        else
                        {
                            Console.WriteLine("Some byte not match!!");
                        }
                    }
                    reader.Close();

                }
            }
            conn.Close();
            Report.WriteLine("ok");
        }