// Copyright (C) 2004-2006 MySQL AB // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation // // There are special exceptions to the terms and conditions of the GPL // as it is applied to this software. View the full text of the // exception in file EXCEPTIONS in the directory of this software // distribution. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Data; using MySql.Data.MySqlClient; using NUnit.Framework; using System.Threading; namespace MySql.Data.MySqlClient.Tests { [TestFixture] public class Csc12029Tests : BaseTest { [TestFixtureSetUp] public void TestFixtureSetUp() { Open(); } [TestFixtureTearDown] public void TestFixtureTearDown() { Close(); } protected override void Setup() { base.Setup(); execSQL("DROP TABLE IF EXISTS Test"); execSQL("DROP PROCEDURE IF EXISTS EnumParamTest"); execSQL("CREATE TABLE Test (e ENUM('A', 'B', 'C'))"); execSQL("CREATE PROCEDURE EnumParamTest (IN p_enum ENUM('P','R','F','E'))" + " BEGIN " + " INSERT INTO Test (e) VALUES (p_enum); " + " END "); } [Test] public void ProcEnumParamTest() { try { MySql.Data.MySqlClient.MySqlCommand MyCommand = new MySqlCommand("EnumParamTest", conn); MyCommand.CommandType = CommandType.StoredProcedure; MyCommand.Parameters.Add("?p_enum", "B"); MyCommand.Parameters["?p_enum"].Direction = ParameterDirection.Input; MyCommand.ExecuteReader(); MyCommand.Dispose(); } catch (MySqlException ex) { Assert.Fail(ex.Message); } } } #region Configs #endregion }