Index: command.cs =================================================================== --- command.cs (revision 1306) +++ command.cs (working copy) @@ -57,6 +57,7 @@ private bool resetSqlSelect; List batch; private string batchableCommandText; + internal bool isOutPutParams = false; /// public MySqlCommand() @@ -84,6 +85,14 @@ Connection = connection; } + /// + public MySqlCommand(string cmdText, MySqlConnection connection, bool hasOutPutParams) + : this(cmdText) + { + isOutPutParams = hasOutPutParams; + Connection = connection; + } + /// public MySqlCommand(string cmdText, MySqlConnection connection, MySqlTransaction transaction) @@ -93,6 +102,7 @@ curTransaction = transaction; } + #region Properties Index: Statement.cs =================================================================== --- Statement.cs (revision 1306) +++ Statement.cs (working copy) @@ -32,9 +32,11 @@ protected MySqlCommand command; protected string commandText; private ArrayList buffers; + private bool isOutPutParams = false; private Statement(MySqlCommand cmd) { + isOutPutParams = cmd.isOutPutParams; command = cmd; buffers = new ArrayList(); } @@ -213,7 +215,7 @@ protected virtual bool ShouldIgnoreMissingParameter(string parameterName) { - return Connection.Settings.AllowUserVariables || + return isOutPutParams || Connection.Settings.AllowUserVariables || (parameterName.Length > 1 && (parameterName[1] == '`' || parameterName[1] == '\'')); } Index: StoredProcedure.cs =================================================================== --- StoredProcedure.cs (revision 1306) +++ StoredProcedure.cs (working copy) @@ -214,13 +214,12 @@ if (outSelect.Length == 0) return; - bool allowUserVar = Connection.Settings.AllowUserVariables; - Connection.Settings.AllowUserVariables = true; try { - MySqlCommand cmd = new MySqlCommand("SELECT " + outSelect, Connection); + MySqlCommand cmd = new MySqlCommand("SELECT " + outSelect, Connection, true); using (MySqlDataReader reader = cmd.ExecuteReader()) { + // since MySQL likes to return user variables as strings // we reset the types of the readers internal value objects // this will allow those value objects to parse the string based @@ -247,7 +246,7 @@ } finally { - Connection.Settings.AllowUserVariables = allowUserVar; + } } }