Modified:
branches/1.0/CHANGES
branches/1.0/TestSuite/BaseTest.cs
branches/1.0/TestSuite/StoredProcedure.cs
branches/1.0/mysqlclient/ConnectionString.cs
branches/1.0/mysqlclient/Resources.Designer.cs
branches/1.0/mysqlclient/Resources.resx
branches/1.0/mysqlclient/StoredProcedure.cs
branches/1.0/mysqlclient/docs/MySqlConnection.xml
Log:
Added "Use Procedure Bodies" connection string to allow calling stored procedures without querying for metadata in some cases.
Modified: branches/1.0/CHANGES
===================================================================
--- branches/1.0/CHANGES 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/CHANGES 2007-02-20 19:40:41 UTC (rev 595)
@@ -1,3 +1,13 @@
+Version 1.0.10
+ Bugs
+ ----
+
+ Other
+ -----
+ Added "Use Procedure Bodies" connection string option to allow calling procedures without
+ using procedure metadata (if possible).
+
+
Version 1.0.9
Bugs fixed or addressed
Modified: branches/1.0/TestSuite/BaseTest.cs
===================================================================
--- branches/1.0/TestSuite/BaseTest.cs 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/TestSuite/BaseTest.cs 2007-02-20 19:40:41 UTC (rev 595)
@@ -49,8 +49,8 @@
databases = new string[2];
csAdditions = ";pooling=false;";
- user = "root";
- password = "";
+ user = "test";
+ password = "test";
host = "localhost";
databases[0] = "test";
databases[1] = "mysql";
Modified: branches/1.0/TestSuite/StoredProcedure.cs
===================================================================
--- branches/1.0/TestSuite/StoredProcedure.cs 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/TestSuite/StoredProcedure.cs 2007-02-20 19:40:41 UTC (rev 595)
@@ -1099,7 +1099,7 @@
/// Currently this is borked on the server so we are marking this as notworking
/// until the server has this fixed.
/// </summary>
- [Category("NotWorking")]
+/* [Category("NotWorking")]
[Test]
public void LastInsertId()
{
@@ -1114,6 +1114,39 @@
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
Assert.AreEqual(2, cmd.LastInsertedId);
- }
+ }*/
+
+ [Test]
+ public void NoAccessToProcedureBodies()
+ {
+ suExecSQL("DROP PROCEDURE IF EXISTS spTest");
+ suExecSQL("CREATE PROCEDURE spTest(in1 INT, INOUT inout1 INT, OUT out1 INT ) " +
+ "BEGIN SET inout1 = inout1+2; SET out1=inout1-3; SELECT in1; END");
+
+ string connStr = GetConnectionString(true) + "; use procedure bodies=false";
+ using (MySqlConnection c = new MySqlConnection(connStr))
+ {
+ try
+ {
+ c.Open();
+
+ MySqlCommand cmd = new MySqlCommand("spTest", c);
+ cmd.CommandType = CommandType.StoredProcedure;
+ cmd.Parameters.Add("?in1", 2);
+ cmd.Parameters.Add("?inout1", 4);
+ cmd.Parameters.Add("?out1", MySqlDbType.Int32);
+ cmd.Parameters[1].Direction = ParameterDirection.InputOutput;
+ cmd.Parameters[2].Direction = ParameterDirection.Output;
+ cmd.ExecuteNonQuery();
+
+ Assert.AreEqual(6, cmd.Parameters[1].Value);
+ Assert.AreEqual(3, cmd.Parameters[2].Value);
+ }
+ catch (Exception ex)
+ {
+ Assert.Fail(ex.Message);
+ }
+ }
+ }
}
}
Modified: branches/1.0/mysqlclient/ConnectionString.cs
===================================================================
--- branches/1.0/mysqlclient/ConnectionString.cs 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/mysqlclient/ConnectionString.cs 2007-02-20 19:40:41 UTC (rev 595)
@@ -271,6 +271,17 @@
get { return GetInt("procedure cache size"); }
}
+ [Category("Advanced")]
+#if NET20
+ [DisplayName("Use Procedure Bodies")]
+#endif
+ [Description("Indicates if stored procedure bodies will be available for parameter detection.")]
+ [DefaultValue(true)]
+ public bool UseProcedureBodies
+ {
+ get { return GetBool("procedure bodies"); }
+ }
+
#endregion
/// <summary>
@@ -361,6 +372,7 @@
defaults["reset_pooled_conn"] = true;
defaults["procedure cache size"] = 25;
defaults["ignore prepare"] = true;
+ defaults["procedure bodies"] = true;
}
return (Hashtable)defaults.Clone();
}
@@ -438,6 +450,11 @@
hash["ignore prepare"] = boolVal;
break;
+ case "procedure bodies":
+ case "use procedure bodies":
+ hash["procedure bodies"] = boolVal;
+ break;
+
default:
if (!base.ConnectionParameterParsed(hash, key, value))
throw new ArgumentException(Resources.KeywordNotSupported, key);
Modified: branches/1.0/mysqlclient/Resources.Designer.cs
===================================================================
--- branches/1.0/mysqlclient/Resources.Designer.cs 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/mysqlclient/Resources.Designer.cs 2007-02-20 19:40:41 UTC (rev 595)
@@ -261,10 +261,19 @@
}
}
+ internal static string NoBodiesAndTypeNotSet
+ {
+ get
+ {
+ return ResourceManager.GetString("NoBodiesAndTypeNotSet", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Nested transactions are not supported..
/// </summary>
- internal static string NoNestedTransactions {
+ internal static string NoNestedTransactions
+ {
get {
return ResourceManager.GetString("NoNestedTransactions", resourceCulture);
}
Modified: branches/1.0/mysqlclient/Resources.resx
===================================================================
--- branches/1.0/mysqlclient/Resources.resx 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/mysqlclient/Resources.resx 2007-02-20 19:40:41 UTC (rev 595)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8" ?>
<root>
- <!--
+ <!--
Microsoft ResX Schema
Version 2.0
@@ -59,197 +59,200 @@
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="BadVersionFormat" xml:space="preserve">
- <value>Version string not in acceptable format</value>
- </data>
- <data name="NamedPipeNoSeek" xml:space="preserve">
- <value>NamedPipeStream does not support seeking</value>
- </data>
- <data name="StreamAlreadyClosed" xml:space="preserve">
- <value>The stream has already been closed</value>
- </data>
- <data name="BufferCannotBeNull" xml:space="preserve">
- <value> The buffer cannot be null</value>
- </data>
- <data name="BufferNotLargeEnough" xml:space="preserve">
- <value> Buffer is not large enough</value>
- </data>
- <data name="OffsetCannotBeNegative" xml:space="preserve">
- <value> Offset cannot be negative</value>
- </data>
- <data name="CountCannotBeNegative" xml:space="preserve">
- <value> Count cannot be negative</value>
- </data>
- <data name="StreamNoRead" xml:space="preserve">
- <value> The stream does not support reading</value>
- </data>
- <data name="NamedPipeNoSetLength" xml:space="preserve">
- <value>NamedPipeStream doesn't support SetLength</value>
- </data>
- <data name="StreamNoWrite" xml:space="preserve">
- <value>The stream does not support writing</value>
- </data>
- <data name="ErrorCreatingSocket" xml:space="preserve">
- <value>Error creating socket connection</value>
- </data>
- <data name="SocketNoSeek" xml:space="preserve">
- <value>Socket streams do not support seeking</value>
- </data>
- <data name="UnixSocketsNotSupported" xml:space="preserve">
- <value>Unix sockets are not supported on Windows</value>
- </data>
- <data name="OffsetMustBeValid" xml:space="preserve">
- <value>Offset must be a valid position in buffer</value>
- </data>
- <data name="CSNoSetLength" xml:space="preserve">
- <value>SetLength is not a valid operation on CompressedStream</value>
- </data>
- <data name="FromIndexMustBeValid" xml:space="preserve">
- <value>From index must be a valid index inside the from buffer</value>
- </data>
- <data name="FromAndLengthTooBig" xml:space="preserve">
- <value>From index and length use more bytes than from contains</value>
- </data>
- <data name="IndexMustBeValid" xml:space="preserve">
- <value>Index must be a valid position in the buffer</value>
- </data>
- <data name="IndexAndLengthTooBig" xml:space="preserve">
- <value>Index and length use more bytes than to has room for</value>
- </data>
- <data name="PasswordMustHaveLegalChars" xml:space="preserve">
- <value>Password must be valid and contain length characters</value>
- </data>
- <data name="ParameterCannotBeNegative" xml:space="preserve">
- <value>Parameter cannot have a negative value</value>
- </data>
- <data name="ConnectionMustBeOpen" xml:space="preserve">
- <value>Connection must be valid and open</value>
- </data>
- <data name="DataReaderOpen" xml:space="preserve">
- <value>There is already an open DataReader associated with this Connection which must be closed first.</value>
- </data>
- <data name="SPNotSupported" xml:space="preserve">
- <value>Stored procedures are not supported on this version of MySQL</value>
- </data>
- <data name="ConnectionNotSet" xml:space="preserve">
- <value>The connection property has not been set.</value>
- </data>
- <data name="ConnectionNotOpen" xml:space="preserve">
- <value>The connection is not open.</value>
- </data>
- <data name="AdapterIsNull" xml:space="preserve">
- <value>Improper MySqlCommandBuilder state: adapter is null</value>
- </data>
- <data name="AdapterSelectIsNull" xml:space="preserve">
- <value>Improper MySqlCommandBuilder state: adapter's SelectCommand is null</value>
- </data>
- <data name="CBMultiTableNotSupported" xml:space="preserve">
- <value>MySqlCommandBuilder does not support multi-table statements</value>
- </data>
- <data name="CBNoKeyColumn" xml:space="preserve">
- <value>MySqlCommandBuilder cannot operate on tables with no unique or key columns</value>
- </data>
- <data name="ParameterCannotBeNull" xml:space="preserve">
- <value>Parameter cannot be null</value>
- </data>
- <data name="ChaosNotSupported" xml:space="preserve">
- <value>Chaos isolation level is not supported</value>
- </data>
- <data name="ParameterIsInvalid" xml:space="preserve">
- <value>Parameter is invalid.</value>
- </data>
- <data name="ConnectionAlreadyOpen" xml:space="preserve">
- <value>The connection is already open.</value>
- </data>
- <data name="KeywordNotSupported" xml:space="preserve">
- <value>Keyword not supported.</value>
- </data>
- <data name="WriteToStreamFailed" xml:space="preserve">
- <value>Writing to the stream failed.</value>
- </data>
- <data name="ReadFromStreamFailed" xml:space="preserve">
- <value>Reading from the stream has failed.</value>
- </data>
- <data name="QueryTooLarge" xml:space="preserve">
- <value>Packets larger than max_allowed_packet are not allowed.</value>
- </data>
- <data name="UnableToExecuteSP" xml:space="preserve">
- <value>Unable to execute stored procedure '{0}'.</value>
- </data>
- <data name="NoNestedTransactions" xml:space="preserve">
- <value>Nested transactions are not supported.</value>
- </data>
- <data name="CommandTextNotInitialized" xml:space="preserve">
- <value>The CommandText property has not been properly initialized.</value>
- </data>
- <data name="WrongParameterName" xml:space="preserve">
- <value>Parameter '{0}' is not found but a parameter with the name '{1}' is found. Parameter names must include the leading parameter marker.</value>
- </data>
- <data name="ReturnParameterExists" xml:space="preserve">
- <value>A return value parameter already exists in the parameter collection.</value>
- </data>
- <data name="UnableToConnectToHost" xml:space="preserve">
- <value>Unable to connect to any of the specified MySQL hosts.</value>
- </data>
- <data name="UnableToRetrieveSProcData" xml:space="preserve">
- <value>Unable to retrieve stored procedure metadata. Either grant SELECTprivilege to mysql.proc for this user or use "noAccessToProcedureBody=true" with your connection string.</value>
- </data>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="BadVersionFormat" xml:space="preserve">
+ <value>Version string not in acceptable format</value>
+ </data>
+ <data name="NamedPipeNoSeek" xml:space="preserve">
+ <value>NamedPipeStream does not support seeking</value>
+ </data>
+ <data name="StreamAlreadyClosed" xml:space="preserve">
+ <value>The stream has already been closed</value>
+ </data>
+ <data name="BufferCannotBeNull" xml:space="preserve">
+ <value> The buffer cannot be null</value>
+ </data>
+ <data name="BufferNotLargeEnough" xml:space="preserve">
+ <value> Buffer is not large enough</value>
+ </data>
+ <data name="OffsetCannotBeNegative" xml:space="preserve">
+ <value> Offset cannot be negative</value>
+ </data>
+ <data name="CountCannotBeNegative" xml:space="preserve">
+ <value> Count cannot be negative</value>
+ </data>
+ <data name="StreamNoRead" xml:space="preserve">
+ <value> The stream does not support reading</value>
+ </data>
+ <data name="NamedPipeNoSetLength" xml:space="preserve">
+ <value>NamedPipeStream doesn't support SetLength</value>
+ </data>
+ <data name="StreamNoWrite" xml:space="preserve">
+ <value>The stream does not support writing</value>
+ </data>
+ <data name="ErrorCreatingSocket" xml:space="preserve">
+ <value>Error creating socket connection</value>
+ </data>
+ <data name="SocketNoSeek" xml:space="preserve">
+ <value>Socket streams do not support seeking</value>
+ </data>
+ <data name="UnixSocketsNotSupported" xml:space="preserve">
+ <value>Unix sockets are not supported on Windows</value>
+ </data>
+ <data name="OffsetMustBeValid" xml:space="preserve">
+ <value>Offset must be a valid position in buffer</value>
+ </data>
+ <data name="CSNoSetLength" xml:space="preserve">
+ <value>SetLength is not a valid operation on CompressedStream</value>
+ </data>
+ <data name="FromIndexMustBeValid" xml:space="preserve">
+ <value>From index must be a valid index inside the from buffer</value>
+ </data>
+ <data name="FromAndLengthTooBig" xml:space="preserve">
+ <value>From index and length use more bytes than from contains</value>
+ </data>
+ <data name="IndexMustBeValid" xml:space="preserve">
+ <value>Index must be a valid position in the buffer</value>
+ </data>
+ <data name="IndexAndLengthTooBig" xml:space="preserve">
+ <value>Index and length use more bytes than to has room for</value>
+ </data>
+ <data name="PasswordMustHaveLegalChars" xml:space="preserve">
+ <value>Password must be valid and contain length characters</value>
+ </data>
+ <data name="ParameterCannotBeNegative" xml:space="preserve">
+ <value>Parameter cannot have a negative value</value>
+ </data>
+ <data name="ConnectionMustBeOpen" xml:space="preserve">
+ <value>Connection must be valid and open</value>
+ </data>
+ <data name="DataReaderOpen" xml:space="preserve">
+ <value>There is already an open DataReader associated with this Connection which must be closed first.</value>
+ </data>
+ <data name="SPNotSupported" xml:space="preserve">
+ <value>Stored procedures are not supported on this version of MySQL</value>
+ </data>
+ <data name="ConnectionNotSet" xml:space="preserve">
+ <value>The connection property has not been set.</value>
+ </data>
+ <data name="ConnectionNotOpen" xml:space="preserve">
+ <value>The connection is not open.</value>
+ </data>
+ <data name="AdapterIsNull" xml:space="preserve">
+ <value>Improper MySqlCommandBuilder state: adapter is null</value>
+ </data>
+ <data name="AdapterSelectIsNull" xml:space="preserve">
+ <value>Improper MySqlCommandBuilder state: adapter's SelectCommand is null</value>
+ </data>
+ <data name="CBMultiTableNotSupported" xml:space="preserve">
+ <value>MySqlCommandBuilder does not support multi-table statements</value>
+ </data>
+ <data name="CBNoKeyColumn" xml:space="preserve">
+ <value>MySqlCommandBuilder cannot operate on tables with no unique or key columns</value>
+ </data>
+ <data name="ParameterCannotBeNull" xml:space="preserve">
+ <value>Parameter cannot be null</value>
+ </data>
+ <data name="ChaosNotSupported" xml:space="preserve">
+ <value>Chaos isolation level is not supported</value>
+ </data>
+ <data name="ParameterIsInvalid" xml:space="preserve">
+ <value>Parameter is invalid.</value>
+ </data>
+ <data name="ConnectionAlreadyOpen" xml:space="preserve">
+ <value>The connection is already open.</value>
+ </data>
+ <data name="KeywordNotSupported" xml:space="preserve">
+ <value>Keyword not supported.</value>
+ </data>
+ <data name="WriteToStreamFailed" xml:space="preserve">
+ <value>Writing to the stream failed.</value>
+ </data>
+ <data name="ReadFromStreamFailed" xml:space="preserve">
+ <value>Reading from the stream has failed.</value>
+ </data>
+ <data name="QueryTooLarge" xml:space="preserve">
+ <value>Packets larger than max_allowed_packet are not allowed.</value>
+ </data>
+ <data name="UnableToExecuteSP" xml:space="preserve">
+ <value>Unable to execute stored procedure '{0}'.</value>
+ </data>
+ <data name="NoNestedTransactions" xml:space="preserve">
+ <value>Nested transactions are not supported.</value>
+ </data>
+ <data name="CommandTextNotInitialized" xml:space="preserve">
+ <value>The CommandText property has not been properly initialized.</value>
+ </data>
+ <data name="WrongParameterName" xml:space="preserve">
+ <value>Parameter '{0}' is not found but a parameter with the name '{1}' is found. Parameter names must include the leading parameter marker.</value>
+ </data>
+ <data name="ReturnParameterExists" xml:space="preserve">
+ <value>A return value parameter already exists in the parameter collection.</value>
+ </data>
+ <data name="UnableToConnectToHost" xml:space="preserve">
+ <value>Unable to connect to any of the specified MySQL hosts.</value>
+ </data>
+ <data name="UnableToRetrieveSProcData" xml:space="preserve">
+ <value>Unable to retrieve stored procedure metadata. Either grant SELECT privilege to mysql.proc for this user or use "Use Procedure Bodies=false" with your connection string.</value>
+ </data>
+ <data name="NoBodiesAndTypeNotSet" d2p1:space="preserve" xmlns:d2p1="http://www.w3.org/XML/1998/namespace">
+ <value>When calling stored procedures and 'Use Procedure Bodies' is false, all parameters must have their type explicitly set.</value>
+ </data>
</root>
\ No newline at end of file
Modified: branches/1.0/mysqlclient/StoredProcedure.cs
===================================================================
--- branches/1.0/mysqlclient/StoredProcedure.cs 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/mysqlclient/StoredProcedure.cs 2007-02-20 19:40:41 UTC (rev 595)
@@ -259,6 +259,22 @@
return name;
}
+ private IEnumerable GetParameters(MySqlConnection connection, MySqlCommand cmd)
+ {
+ // if we can use mysql.proc, then do so
+ if (connection.Settings.UseProcedureBodies)
+ return connection.ProcedureCache.GetProcedure(connection, cmd.CommandText);
+
+ foreach (MySqlParameter p in cmd.Parameters)
+ {
+ // in this mode, all parameters must have their type set
+ if (!p.TypeHasBeenSet)
+ throw new InvalidOperationException(Resources.NoBodiesAndTypeNotSet);
+ }
+ return cmd.Parameters;
+ }
+
+
/// <summary>
/// Creates the proper command text for executing the given stored procedure
/// </summary>
@@ -270,8 +286,7 @@
try
{
- ArrayList parameters = connection.ProcedureCache.GetProcedure(
- connection, cmd.CommandText);
+ IEnumerable parameters = GetParameters(connection, cmd);
bool isReturn = GetReturnParameter(parameters) != null;
Modified: branches/1.0/mysqlclient/docs/MySqlConnection.xml
===================================================================
--- branches/1.0/mysqlclient/docs/MySqlConnection.xml 2007-02-20 17:28:56 UTC (rev 594)
+++ branches/1.0/mysqlclient/docs/MySqlConnection.xml 2007-02-20 19:40:41 UTC (rev 595)
@@ -1016,6 +1016,16 @@
encountered with MySQL prepared statements.
</td>
</tr>
+ <tr>
+ <td>Use Procedure Bodies</td>
+ <td>true</td>
+ <td>
+ Instructs the provider to attempt to call the procedure without first resolving the metadata. Thjis
+ is useful in situations where the calling user does not have access to the mysql.proc table. To
+ use this mode, the parameters for the procedure must be added to the command in the same order
+ as they appear in the procedure definition and their types must be explicitly set.
+ </td>
+ </tr>
</table>
</div>
<para>
| Thread |
|---|
| • Connector/NET commit: r595 - in branches/1.0: . TestSuite mysqlclient mysqlclient/docs | rburnett | 20 Feb |