Modified:
trunk/CHANGES
trunk/Client.build
trunk/Installer/main.wxs
trunk/Package.build
trunk/README
trunk/TestSuite/BaseTest.cs
trunk/TestSuite/BlobTests.cs
trunk/TestSuite/CharacterSetTests.cs
trunk/TestSuite/CommandBuilderTests.cs
trunk/TestSuite/CommandTests.cs
trunk/TestSuite/DataAdapterTests.cs
trunk/TestSuite/DataTypeTests.cs
trunk/TestSuite/GetSchemaTests.cs
trunk/TestSuite/PreparedStatements.cs
trunk/TestSuite/StoredProcedure.cs
trunk/TestSuite/StressTests.cs
trunk/TestSuite/Syntax.cs
trunk/TestSuite/Threading.cs
trunk/TestSuite/UsageAdvisor.cs
trunk/gpl-banner.txt
trunk/mysqlclient/CommandBuilder.cs
trunk/mysqlclient/MySql.Data.2005.csproj
trunk/mysqlclient/MySqlStream.cs
trunk/mysqlclient/NativeDriver.cs
trunk/mysqlclient/ProcedureCache.cs
trunk/mysqlclient/SchemaProvider.cs
trunk/mysqlclient/docs/MySqlCommand.xml
trunk/mysqlclient/docs/MySqlCommandBuilder.xml
trunk/mysqlclient/docs/MySqlDataReader.xml
Log:
A few last second changes
Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/CHANGES 2006-08-02 14:39:40 UTC (rev 291)
@@ -18,9 +18,10 @@
Implemented MySqlClientFactory class
Implemented classes and interfaces for ADO.Net 2.0 support
Replaced use of ICSharpCode with .NET 2.0 internal deflate support
- Refactored test suite to test all protocols in a single pass
+ Refactored test suite to test all protocols in a single pass
+ Completely refactored how column values are handled to avoid boxing in some cases
-<unreleased> - Version 1.0.8
+Version 1.0.8 (not yet released)
Other changes
-------------
Modified: trunk/Client.build
===================================================================
--- trunk/Client.build 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/Client.build 2006-08-02 14:39:40 UTC (rev 291)
@@ -1,7 +1,7 @@
<project name="MySqlClient" default="allframeworks"
xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd">
<description>MySQLClient Managed Provider for MySQL</description>
- <property name="nunit" value="C:\Program Files (x86)\NUnit"/>
+ <property name="nunit" value="C:\Program Files\NUnit"/>
<property name="ncover.executable" value="c:\program
files\ncover\ncover.console.exe"/>
<property name="fxcop.executable" value="c:\program files\fxcop\fxcopcmd.exe"/>
@@ -95,7 +95,8 @@
<property name="framework" value="net-2.0"/>
<property name="defines" value="NET20"/>
<call target="client"/>
- </target>
+ <call target="Docs"/>
+</target>
<!-- core managed driver target mono 1.0 -->
<target name="mono-1.0" description="Mono 1.0 Target">
@@ -204,7 +205,7 @@
<!-- documentation target -->
<target name="Docs" description="Documentation">
<ndoc>
- <assemblies basedir="bin/${framework}/${buildType}">
+ <assemblies basedir="${build.dir}/mysqlclient/bin/${framework}/${buildType}">
<include name="MySQL.Data.dll" />
</assemblies>
<summaries>
@@ -212,7 +213,7 @@
</summaries>
<documenters>
<documenter name="MSDN">
- <property name="OutputDirectory"
value="${build.dir}/bin/${framework}/${buildType}/doc/VS.Net" />
+ <property name="OutputDirectory"
value="${build.dir}/mysqlclient/bin/${framework}/${buildType}/doc/VS.Net" />
<property name="HtmlHelpName" value="MySql.Data" />
<property name="HtmlHelpCompilerFilename" value="hhc.exe" />
<property name="IncludeFavorites" value="False" />
@@ -230,7 +231,7 @@
<property name="DocumentPrivates" value="False" />
<property name="DocumentEmptyNamespaces" value="False" />
<property name="IncludeAssemblyVersion" value="False" />
- <property name="CopyrightText" value="Copyright MySQL AB
2004-2005" />
+ <property name="CopyrightText" value="Copyright MySQL AB
2004-2006" />
<property name="CopyrightHref" value="http://www.mysql.com" />
</documenter>
</documenters>
@@ -238,8 +239,8 @@
<!-- now copy the generated docs to the doc folder -->
<mkdir dir="doc"/>
- <copy file="bin/${framework}/${buildType}/doc/VS.Net/MySql.Data.chm"
todir="doc"/>
- <delete dir="bin/${framework}/${buildType}/doc" failonerror="false"/>
+ <copy file="mysqlclient/bin/${framework}/${buildType}/doc/VS.Net/MySql.Data.chm"
todir="doc"/>
+ <delete dir="mysqlclient/bin/${framework}/${buildType}/doc" failonerror="false"/>
</target>
<!-- Remove all generated files target -->
Modified: trunk/Installer/main.wxs
===================================================================
--- trunk/Installer/main.wxs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/Installer/main.wxs 2006-08-02 14:39:40 UTC (rev 291)
@@ -11,6 +11,7 @@
<Directory Id="TARGETDIR" Name="SourceDir">
<Component Id="BaseComponents" Guid="d2192cc7-7915-46a5-bf36-383e432fb79e">
<File Id="ChangeLog" Name="CLog" LongName="CHANGES" src="..\CHANGES"
DiskId="1"/>
+ <File Id="ReleaseNotes" Name="RelNotes" LongName="Release Notes.txt"
src="..\mysqlclient\Release Notes.txt" DiskId="1"/>
<?if $(var.IsGPL) = true ?>
<File Id="EXCEPTIONS" Name="EXC" LongName="EXCEPTIONS" src="..\EXCEPTIONS"
DiskId="1"/>
<File Id="COPYING" Name="COPY" LongName="COPYING" src="..\COPYING" DiskId="1"
/>
@@ -24,7 +25,8 @@
<Directory Id="BinFolder" Name="bin">
<Directory Id="Bin20" Name="NET20" LongName=".NET 2.0">
<Component Id="Net20" Guid="5e1cc5ab-ccba-4dff-82ce-c39d78901d30">
- <File Id="CoreBin20" Name="MD20" LongName="MySql.Data.dll"
src="..\bin\net-2.0\$(var.build)\mysql.data.dll" DiskId="1" />
+ <File Id="CoreBin20" Name="MD20" LongName="MySql.Data.dll"
src="..\mysqlclient\bin\net-2.0\$(var.build)\mysql.data.dll" DiskId="1" />
+ <Registry Id="vs80registry" Root="HKLM"
Key="Software\Microsoft\VisualStudio\8.0\AssemblyFolders\MySQL Connector Net
$(var.ProductVersion)" Type="string" KeyPath="yes" Value="[TARGETDIR]bin\.NET 2.0\" />
</Component>
</Directory>
<Directory Id="Bin11" Name="NET11" LongName=".NET 1.1">
@@ -44,6 +46,10 @@
<File Id="CoreMono10" Name="MOD10" LongName="MySql.Data.dll"
src="..\bin\mono-1.0\$(var.build)\mysql.data.dll" DiskId="1" />
</Component>
</Directory>
+ <Component Id="GACFiles20" Guid="9D1C9A94-8B78-4225-9E87-6DED3A7D19B4">
+ <Condition><![CDATA[REGISTERGAC="1"]]></Condition>
+ <File Id="CoreBin20GAC" Name="MD20" LongName="MySql.Data.dll"
src="..\bin\net-2.0\$(var.build)\mysql.data.dll" DiskId="1" Assembly=".net" KeyPath="yes"
/>
+ </Component>
<Component Id="GACFiles11" Guid="61a90246-01e8-449a-a59c-afc16938b49f">
<Condition><![CDATA[REGISTERGAC="1"]]></Condition>
<File Id="CoreBin11GAC" Name="MD11" LongName="MySql.Data.dll"
src="..\bin\net-1.1\$(var.build)\mysql.data.dll" DiskId="1" Assembly=".net" KeyPath="yes"
/>
@@ -64,7 +70,6 @@
<File Id="teCS3" Name="Form1.cs" src="..\Samples\TableEditor\cs\Form1.cs"
DiskId="1"/>
<File Id="teCS4" Name="Form1.res" LongName="Form1.resx"
src="..\Samples\TableEditor\cs\Form1.resx" DiskId="1"/>
<File Id="teCS5" Name="te.csp" LongName="TableEditor.csproj"
src="..\Samples\TableEditor\cs\TableEditor.csproj" DiskId="1"/>
- <File Id="teCS6" Name="te.csu" LongName="TableEditor.csproj.user"
src="..\Samples\TableEditor\cs\TableEditor.csproj.user" DiskId="1"/>
<File Id="teCS7" Name="def.bld" LongName="TableEditor.build"
src="..\Samples\TableEditor\cs\TableEditor.build" DiskId="1"/>
</Component>
</Directory>
@@ -74,7 +79,6 @@
<File Id="teVB3" Name="Form1.vb" src="..\Samples\TableEditor\vb\Form1.vb"
DiskId="1"/>
<File Id="teVB4" Name="Form1.res" LongName="Form1.resx"
src="..\Samples\TableEditor\vb\Form1.resx" DiskId="1"/>
<File Id="teVB5" Name="te.vbp" LongName="TableEditor.vbproj"
src="..\Samples\TableEditor\vb\TableEditor.vbproj" DiskId="1"/>
- <File Id="teVB6" Name="te.vbu" LongName="TableEditor.vbproj.user"
src="..\Samples\TableEditor\vb\TableEditor.vbproj.user" DiskId="1"/>
<File Id="teVB7" Name="te.bld" LongName="TableEditor.build"
src="..\Samples\TableEditor\vb\TableEditor.build" DiskId="1"/>
</Component>
</Directory>
Modified: trunk/Package.build
===================================================================
--- trunk/Package.build 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/Package.build 2006-08-02 14:39:40 UTC (rev 291)
@@ -13,7 +13,6 @@
<include name="README"/>
<include name="MySql.Data.csproj"/>
<include name="Samples/**" />
- <include name="ICSharpCode.SharpZipLib.dll"/>
</fileset>
<fileset id="SourceGPL">
Modified: trunk/README
===================================================================
--- trunk/README 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/README 2006-08-02 14:39:40 UTC (rev 291)
@@ -1,6 +1,6 @@
-MySQL Connector/Net 1.0.5
+MySQL Connector/Net 5.0.0
MySQL AB's ADO.Net Driver for MySQL
-Copyright (c) 2004-2005 MySQL AB
+Copyright (c) 2004-2006 MySQL AB
CONTENTS
Modified: trunk/TestSuite/BaseTest.cs
===================================================================
--- trunk/TestSuite/BaseTest.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/BaseTest.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -102,7 +102,11 @@
protected bool Is50
{
- get { return conn.ServerVersion.StartsWith("5.0"); }
+ get
+ {
+ string v = conn.ServerVersion;
+ return v.StartsWith("5.0") || v.StartsWith("5.1");
+ }
}
protected bool Is41
Modified: trunk/TestSuite/BlobTests.cs
===================================================================
--- trunk/TestSuite/BlobTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/BlobTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -372,7 +372,7 @@
#region Configs
- [Category("NotWorking")]
+ [Explicit]
public class BlobTestsSocketCompressed : BlobTests
{
protected override string GetConnectionInfo()
@@ -389,7 +389,7 @@
}
}
- [Category("NotWorking")]
+ [Explicit]
public class BlobTestsPipeCompressed : BlobTests
{
protected override string GetConnectionInfo()
@@ -398,6 +398,7 @@
}
}
+ [Explicit]
public class BlobTestsSharedMemory : BlobTests
{
protected override string GetConnectionInfo()
@@ -406,7 +407,7 @@
}
}
- [Category("NotWorking")]
+ [Explicit]
public class BlobTestsSharedMemoryCompressed : BlobTests
{
protected override string GetConnectionInfo()
Modified: trunk/TestSuite/CharacterSetTests.cs
===================================================================
--- trunk/TestSuite/CharacterSetTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/CharacterSetTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -105,7 +105,7 @@
-
+
Modified: trunk/TestSuite/CommandBuilderTests.cs
===================================================================
--- trunk/TestSuite/CommandBuilderTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/CommandBuilderTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -31,9 +31,6 @@
public void FixtureSetup()
{
Open();
-
- execSQL("DROP TABLE IF EXISTS Test");
- execSQL("CREATE TABLE Test (id INT NOT NULL, name VARCHAR(100), dt DATETIME, tm TIME,
`multi word` int, PRIMARY KEY(id))");
}
[TestFixtureTearDown]
@@ -42,6 +39,14 @@
Close();
}
+ protected override void Setup()
+ {
+ base.Setup();
+
+ execSQL("DROP TABLE IF EXISTS Test");
+ execSQL("CREATE TABLE Test (id INT NOT NULL, name VARCHAR(100), dt DATETIME,
tm TIME, `multi word` int, PRIMARY KEY(id))");
+ }
+
[Test]
public void MultiWord()
{
@@ -80,7 +85,7 @@
execSQL("INSERT INTO Test (id, name) VALUES (1, 'Test')");
MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM Test", conn);
- MySqlCommandBuilder cb = new MySqlCommandBuilder(da, true);
+ MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
cb.ConflictOption = ConflictOption.OverwriteChanges;
DataTable dt = new DataTable();
da.Fill( dt );
@@ -163,7 +168,8 @@
Assert.AreEqual("test1", dt.Rows[0]["name"]);
da.SelectCommand.CommandText = "SELECT *, now() as stime FROM test WHERE id<4";
- cb = new MySqlCommandBuilder(da, true);
+ cb = new MySqlCommandBuilder(da);
+ cb.ConflictOption = ConflictOption.OverwriteChanges;
da.InsertCommand = cb.GetInsertCommand();
}
Modified: trunk/TestSuite/CommandTests.cs
===================================================================
--- trunk/TestSuite/CommandTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/CommandTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -384,6 +384,7 @@
#region Configs
+ [Explicit]
public class CommandTestsSocketCompressed : CommandTests
{
protected override string GetConnectionInfo()
@@ -400,6 +401,7 @@
}
}
+ [Explicit]
public class CommandTestsPipeCompressed : CommandTests
{
protected override string GetConnectionInfo()
@@ -408,6 +410,7 @@
}
}
+ [Explicit]
public class CommandTestsSharedMemory : CommandTests
{
protected override string GetConnectionInfo()
@@ -416,6 +419,7 @@
}
}
+ [Explicit]
public class CommandTestsSharedMemoryCompressed : CommandTests
{
protected override string GetConnectionInfo()
Modified: trunk/TestSuite/DataAdapterTests.cs
===================================================================
--- trunk/TestSuite/DataAdapterTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/DataAdapterTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -412,7 +412,7 @@
/// Bug #8514 CURRENT_TIMESTAMP default not respected
/// </summary>
[Test]
- [Category("NotWorking")]
+ [Explicit]
public void DefaultValues()
{
execSQL("DROP TABLE IF EXISTS test");
Modified: trunk/TestSuite/DataTypeTests.cs
===================================================================
--- trunk/TestSuite/DataTypeTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/DataTypeTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -489,8 +489,16 @@
Assert.AreEqual(1, reader.GetInt32(0));
Assert.AreEqual(2, reader.GetInt32(1));
Assert.AreEqual(120, reader.GetInt32(2));
- Assert.AreEqual(240, reader.GetInt32(3));
- Assert.AreEqual(1000, reader.GetInt32(4));
+ if (Is50)
+ {
+ Assert.AreEqual(240, reader.GetInt32(3));
+ Assert.AreEqual(1000, reader.GetInt32(4));
+ }
+ else
+ {
+ Assert.AreEqual(127, reader.GetInt32(3));
+ Assert.AreEqual(127, reader.GetInt32(4));
+ }
}
catch (Exception ex)
{
Modified: trunk/TestSuite/GetSchemaTests.cs
===================================================================
--- trunk/TestSuite/GetSchemaTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/GetSchemaTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -44,7 +44,7 @@
public void Collections()
{
DataTable dt = conn.GetSchema();
- Assert.AreEqual(17, dt.Rows.Count);
+
Assert.AreEqual("MetaDataCollections", dt.Rows[0][0]);
Assert.AreEqual("DataSourceInformation", dt.Rows[1][0]);
Assert.AreEqual("DataTypes", dt.Rows[2][0]);
@@ -57,18 +57,25 @@
Assert.AreEqual("Foreign Keys", dt.Rows[9][0]);
Assert.AreEqual("IndexColumns", dt.Rows[10][0]);
Assert.AreEqual("Indexes", dt.Rows[11][0]);
- Assert.AreEqual("Views", dt.Rows[12][0]);
- Assert.AreEqual("ViewColumns", dt.Rows[13][0]);
- Assert.AreEqual("Procedure Parameters", dt.Rows[14][0]);
- Assert.AreEqual("Procedures", dt.Rows[15][0]);
- Assert.AreEqual("Triggers", dt.Rows[16][0]);
+
+ if (Is50)
+ {
+ Assert.AreEqual("Views", dt.Rows[12][0]);
+ Assert.AreEqual("ViewColumns", dt.Rows[13][0]);
+ Assert.AreEqual("Procedure Parameters", dt.Rows[14][0]);
+ Assert.AreEqual("Procedures", dt.Rows[15][0]);
+ Assert.AreEqual("Triggers", dt.Rows[16][0]);
+ }
}
[Test]
public void Databases()
{
DataTable dt = conn.GetSchema("Databases");
- Assert.IsTrue(dt.Rows.Count >= 3);
+ if (Is50)
+ Assert.IsTrue(dt.Rows.Count >= 3);
+ else
+ Assert.IsTrue(dt.Rows.Count >= 2);
Assert.AreEqual("Databases", dt.TableName);
dt = conn.GetSchema("Databases", new string[1] { "mysql" });
Modified: trunk/TestSuite/PreparedStatements.cs
===================================================================
--- trunk/TestSuite/PreparedStatements.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/PreparedStatements.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -669,6 +669,7 @@
#region Configs
+ [Explicit]
public class PreparedStatementsSocketCompressed : PreparedStatements
{
protected override string GetConnectionInfo()
@@ -685,6 +686,7 @@
}
}
+ [Explicit]
public class PreparedStatementsPipeCompressed : PreparedStatements
{
protected override string GetConnectionInfo()
@@ -693,6 +695,7 @@
}
}
+ [Explicit]
public class PreparedStatementsSharedMemory : PreparedStatements
{
protected override string GetConnectionInfo()
@@ -701,6 +704,7 @@
}
}
+ [Explicit]
public class PreparedStatementsSharedMemoryCompressed : PreparedStatements
{
protected override string GetConnectionInfo()
Modified: trunk/TestSuite/StoredProcedure.cs
===================================================================
--- trunk/TestSuite/StoredProcedure.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/StoredProcedure.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -495,7 +495,7 @@
/// <summary>
/// Bug #13590 ExecuteScalar returns only Int64 regardless of actual SQL type
/// </summary>
- [Category("NotWorking")]
+ [Explicit]
[Test]
public void TestSelectingInts()
{
@@ -676,7 +676,7 @@
}
[Test]
- [Category("NotWorking")]
+ [Explicit]
public void CallingSPWithPrepare()
{
execSQL("DROP PROCEDURE IF EXISTS spTest");
@@ -784,9 +784,17 @@
DataSet ds = new DataSet();
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
- da.Fill(ds);
+ try
+ {
+ da.Fill(ds);
+ }
+ catch (MySqlException)
+ {
+ // on 5.1 this throws an exception that no rows were returned.
+ }
}
+ [Explicit]
[Category("5.0")]
[Test]
public void ProcedureCache()
Modified: trunk/TestSuite/StressTests.cs
===================================================================
--- trunk/TestSuite/StressTests.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/StressTests.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -117,6 +117,7 @@
#region Configs
+ [Explicit]
public class StressTestsSocketCompressed : PreparedStatements
{
protected override string GetConnectionInfo()
@@ -133,6 +134,7 @@
}
}
+ [Explicit]
public class StressTestsPipeCompressed : StressTests
{
protected override string GetConnectionInfo()
@@ -141,6 +143,7 @@
}
}
+ [Explicit]
public class StressTestsSharedMemory : StressTests
{
protected override string GetConnectionInfo()
@@ -149,6 +152,7 @@
}
}
+ [Explicit]
public class StressTestsSharedMemoryCompressed : StressTests
{
protected override string GetConnectionInfo()
Modified: trunk/TestSuite/Syntax.cs
===================================================================
--- trunk/TestSuite/Syntax.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/Syntax.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -96,7 +96,7 @@
}
}
- [Category("NotWorking")]
+ [Explicit]
[Test]
public void LoadDataLocalInfile()
{
Modified: trunk/TestSuite/Threading.cs
===================================================================
--- trunk/TestSuite/Threading.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/Threading.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -113,6 +113,7 @@
/// <summary>
/// Bug #17106 MySql.Data.MySqlClient.CharSetMap.GetEncoding thread
synchronization issue
/// </summary>
+ [Explicit]
[Test]
public void MultipleThreads()
{
Modified: trunk/TestSuite/UsageAdvisor.cs
===================================================================
--- trunk/TestSuite/UsageAdvisor.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/TestSuite/UsageAdvisor.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -44,6 +44,7 @@
Close();
}
+ [Explicit]
[Test]
public void NotReadingEveryField()
{
@@ -86,6 +87,7 @@
}
+ [Explicit]
[Test]
public void NotReadingEveryRow()
{
Modified: trunk/gpl-banner.txt
===================================================================
--- trunk/gpl-banner.txt 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/gpl-banner.txt 2006-08-02 14:39:40 UTC (rev 291)
@@ -1,4 +1,4 @@
-// Copyright (C) 2004 MySQL AB
+// 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
Modified: trunk/mysqlclient/CommandBuilder.cs
===================================================================
--- trunk/mysqlclient/CommandBuilder.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/CommandBuilder.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -37,16 +37,7 @@
#endif
public sealed class MySqlCommandBuilder : DbCommandBuilder
{
- private DataTable _schema;
- private string tableName;
- private string schemaName;
-
- private MySqlCommand _updateCmd;
- private MySqlCommand _insertCmd;
- private MySqlCommand _deleteCmd;
-
private char marker = '?';
- private bool lastOneWins;
#region Constructors
@@ -56,25 +47,12 @@
QuotePrefix = QuoteSuffix = "`";
}
- /// <include file='docs/MySqlCommandBuilder.xml' path='docs/Ctor1/*'/>
- public MySqlCommandBuilder(bool lastOneWins) : this()
- {
- this.lastOneWins = lastOneWins;
- }
-
/// <include file='docs/MySqlCommandBuilder.xml' path='docs/Ctor2/*'/>
public MySqlCommandBuilder(MySqlDataAdapter adapter) : this()
{
DataAdapter = adapter;
}
- /// <include file='docs/MySqlCommandBuilder.xml' path='docs/Ctor3/*'/>
- public MySqlCommandBuilder(MySqlDataAdapter adapter, bool lastOneWins) :
- this(lastOneWins)
- {
- DataAdapter = adapter;
- }
-
#endregion
#region Properties
@@ -86,33 +64,10 @@
set { base.DataAdapter = value; }
}
-/* /// <include file='docs/MySqlCommandBuilder.xml' path='docs/QuotePrefix/*'/>
- public override string QuotePrefix
- {
- get { return _QuotePrefix; }
- set { _QuotePrefix = value; }
- }
-
- /// <include file='docs/MySqlCommandBuilder.xml' path='docs/QuoteSuffix/*'/>
- public string QuoteSuffix
- {
- get { return _QuoteSuffix; }
- set { _QuoteSuffix = value; }
- }
-*/
- private string TableName
- {
- get
- {
- if (schemaName != null && schemaName.Length > 0)
- return Quote(schemaName) + "." + Quote(tableName);
- return Quote(tableName);
- }
- }
-
#endregion
#region Public Methods
+
/// <summary>
/// Retrieves parameter information from the stored procedure specified
/// in the MySqlCommand and populates the Parameters collection of the
@@ -194,91 +149,13 @@
return (MySqlCommand)GetInsertCommand(false);
}
-/* /// <include file='docs/MySqlCommandBuilder.xml'
path='docs/GetDeleteCommand/*'/>
- public new MySqlCommand GetDeleteCommand()
- {
- if (_schema == null)
- GenerateSchema();
- return CreateDeleteCommand();
- }
-
- /// <include file='docs/MySqlCommandBuilder.xml' path='docs/GetInsertCommand/*'/>
- public new MySqlCommand GetInsertCommand()
- {
- if (_schema == null)
- GenerateSchema();
- return CreateInsertCommand();
- }
-
- /// <include file='docs/MySqlCommandBuilder.xml' path='docs/GetUpdateCommand/*'/>
- public new MySqlCommand GetUpdateCommand()
- {
- if (_schema == null)
- GenerateSchema();
- return CreateUpdateCommand();
- }
-*/
/// <include file='docs/MySqlCommandBuilder.xml' path='docs/RefreshSchema/*'/>
public override void RefreshSchema()
{
- _schema = null;
- _insertCmd = null;
- _deleteCmd = null;
- _updateCmd = null;
- tableName = null;
- schemaName = null;
}
#endregion
- #region Private Methods
- private void GenerateSchema()
- {
- if (DataAdapter == null)
- throw new MySqlException(Resources.AdapterIsNull);
- if (DataAdapter.SelectCommand == null)
- throw new MySqlException(Resources.AdapterSelectIsNull);
-
- // set the parameter marker
- MySqlConnection conn = (MySqlConnection)DataAdapter.SelectCommand.Connection;
- marker = conn.ParameterMarker;
-
- MySqlDataReader dr =
DataAdapter.SelectCommand.ExecuteReader(CommandBehavior.SchemaOnly |
CommandBehavior.KeyInfo);
- _schema = dr.GetSchemaTable();
- dr.Close();
-
- // make sure we got at least one unique or key field and count base table names
- bool hasKeyOrUnique=false;
-
- foreach (DataRow row in _schema.Rows)
- {
- string rowTableName = row["BaseTableName"].ToString();
- string rowSchemaName = row["BaseSchemaName"].ToString();
-
- if (true == (bool)row["IsKey"] || true == (bool)row["IsUnique"])
- hasKeyOrUnique=true;
-
- if (tableName == null)
- {
- schemaName = rowSchemaName;
- tableName = rowTableName;
- }
- else if (tableName != rowTableName && rowTableName != null &&
rowTableName.Length > 0)
- throw new InvalidOperationException(Resources.CBMultiTableNotSupported);
- else if (schemaName != rowSchemaName && rowSchemaName != null &&
rowSchemaName.Length > 0)
- throw new InvalidOperationException(Resources.CBMultiTableNotSupported);
- }
- if (! hasKeyOrUnique)
- throw new InvalidOperationException(Resources.CBNoKeyColumn);
- }
-
- private string Quote(string table_or_column)
- {
- if (QuotePrefix == null || QuoteSuffix == null)
- return table_or_column;
- return QuotePrefix + table_or_column + QuoteSuffix;
- }
-
/// <summary>
///
/// </summary>
@@ -299,265 +176,6 @@
return sb.ToString();
}
- private MySqlParameter CreateParameter(DataRow row, bool Original)
- {
- MySqlParameter p;
- string colName = GetParameterName( row["ColumnName"].ToString() );
- MySqlDbType type = (MySqlDbType)row["ProviderType"];
-
- if (Original)
- p = new MySqlParameter( "Original_" + colName, type, ParameterDirection.Input,
- (string)row["ColumnName"], DataRowVersion.Original, DBNull.Value );
- else
- p = new MySqlParameter( colName, type, ParameterDirection.Input,
- (string)row["ColumnName"], DataRowVersion.Current, DBNull.Value );
- return p;
- }
-
- private MySqlCommand CreateBaseCommand()
- {
- MySqlCommand cmd = new MySqlCommand();
- cmd.Connection = DataAdapter.SelectCommand.Connection;
- cmd.CommandTimeout = DataAdapter.SelectCommand.CommandTimeout;
- cmd.Transaction = DataAdapter.SelectCommand.Transaction;
- return cmd;
- }
-
- private MySqlCommand CreateDeleteCommand()
- {
- if (_deleteCmd != null) return _deleteCmd;
-
- MySqlCommand cmd = CreateBaseCommand();
-
- cmd.CommandText = "DELETE FROM " + TableName +
- " WHERE " + CreateOriginalWhere(cmd);
-
- _deleteCmd = cmd;
- return cmd;
- }
-
- private string CreateFinalSelect(bool forinsert)
- {
- StringBuilder sel = new StringBuilder();
- StringBuilder where = new StringBuilder();
-
- foreach (DataRow row in _schema.Rows)
- {
- // don't include functions in where clause
- string baseTableName = (string)row["BaseTableName"];
- if (baseTableName == null || baseTableName.Length == 0)
- continue;
-
- string colname = Quote(row["ColumnName"].ToString());
- string parmName = GetParameterName( row["ColumnName"].ToString() );
-
- if (sel.Length > 0)
- sel.Append(", ");
- sel.Append( colname );
- if ((bool)row["IsKey"] == false) continue;
- if (where.Length > 0)
- where.Append(" AND ");
- where.Append( "(" + colname + "=" );
- if (forinsert)
- {
- if ((bool)row["IsAutoIncrement"])
- where.Append("last_insert_id()");
- else if ((bool)row["IsKey"])
- where.Append( marker + parmName);
- }
- else
- {
- where.Append(marker + "Original_" + parmName);
- }
- where.Append(")");
- }
- return "SELECT " + sel.ToString() + " FROM " + TableName +
- " WHERE " + where.ToString();
- }
-
- private string CreateOriginalWhere(MySqlCommand cmd)
- {
- StringBuilder wherestr = new StringBuilder();
-
- foreach (DataRow row in _schema.Rows)
- {
- // don't include functions in where clause
- string baseTableName = (string)row["BaseTableName"];
- if (baseTableName == null || baseTableName.Length == 0)
- continue;
-
- // if we are doing last one wins and this column is not a key or is not
- // unique, then we don't care about it
- if (true != (bool)row["IsKey"] && true != (bool)row["IsUnique"] &&
lastOneWins)
- continue;
-
- if (! IncludedInWhereClause(row)) continue;
-
- // first update the where clause since it will contain all parameters
-// if (wherestr.Length > 0)
-// wherestr.Append(" AND ");
- string colname = Quote((string)row["ColumnName"]);
-
- MySqlParameter op = CreateParameter(row, true);
- cmd.Parameters.Add(op);
-
- wherestr.Append( colname + " <=> " + marker + op.ParameterName + " AND ");
-// if ((bool)row["AllowDBNull"] == true)
-// wherestr.Append( " or (" + colname + " IS NULL and ?" + op.ParameterName + " IS
NULL)");
- //wherestr.Append(")");
- }
- wherestr.Remove( wherestr.Length-5, 5 ); // remove the trailling " AND "
- return wherestr.ToString();
- }
-
- private MySqlCommand CreateUpdateCommand()
- {
- if (_updateCmd != null) return _updateCmd;
-
- MySqlCommand cmd = CreateBaseCommand();
-
- StringBuilder setstr = new StringBuilder();
-
- foreach (DataRow schemaRow in _schema.Rows)
- {
- // don't include functions in where clause
- string baseTableName = (string)schemaRow["BaseTableName"];
- if (baseTableName == null || baseTableName.Length == 0)
- continue;
-
- string colname = Quote((string)schemaRow["ColumnName"]);
-
- if (! IncludedInUpdate(schemaRow)) continue;
-
- if (setstr.Length > 0)
- setstr.Append(", ");
-
- MySqlParameter p = CreateParameter(schemaRow, false);
- cmd.Parameters.Add(p);
-
- setstr.Append( colname + "=" + marker + p.ParameterName );
- }
-
- cmd.CommandText = "UPDATE " + TableName + " SET " + setstr.ToString() +
- " WHERE " + CreateOriginalWhere(cmd);
- cmd.CommandText += "; " + CreateFinalSelect(false);
-
- _updateCmd = cmd;
- return cmd;
- }
-
- private MySqlCommand CreateInsertCommand()
- {
- if (_insertCmd != null) return _insertCmd;
-
- MySqlCommand cmd = CreateBaseCommand();
-
- StringBuilder setstr = new StringBuilder();
- StringBuilder valstr = new StringBuilder();
- foreach (DataRow schemaRow in _schema.Rows)
- {
- // don't include functions in where clause
- string baseTableName = (string)schemaRow["BaseTableName"];
- if (baseTableName == null || baseTableName.Length == 0)
- continue;
-
- string colname = Quote((string)schemaRow["ColumnName"]);
-
- if (!IncludedInInsert(schemaRow)) continue;
-
- if (setstr.Length > 0)
- {
- setstr.Append(", ");
- valstr.Append(", ");
- }
-
- MySqlParameter p = CreateParameter(schemaRow, false);
- cmd.Parameters.Add(p);
-
- setstr.Append( colname );
- valstr.Append( marker + p.ParameterName );
- }
-
- cmd.CommandText = "INSERT INTO " + TableName + " (" + setstr.ToString() + ") " +
- " VALUES (" + valstr.ToString() + ")";
- cmd.CommandText += "; " + CreateFinalSelect(true);
-
- _insertCmd = cmd;
- return cmd;
- }
-
- private static bool IncludedInInsert (DataRow schemaRow)
- {
- // If the parameter has one of these properties, then we don't include it in the
insert:
- // AutoIncrement, Hidden, Expression, RowVersion, ReadOnly
-
-// if ((bool) schemaRow ["IsAutoIncrement"])
-// return false;
- /* if ((bool) schemaRow ["IsHidden"])
- return false;
- if ((bool) schemaRow ["IsExpression"])
- return false;*/
- if ((bool) schemaRow ["IsRowVersion"])
- return false;
- if ((bool) schemaRow ["IsReadOnly"])
- return false;
- return true;
- }
-
- private static bool IncludedInUpdate (DataRow schemaRow)
- {
- // If the parameter has one of these properties, then we don't include it in the
insert:
- // AutoIncrement, Hidden, RowVersion
-
- //if ((bool) schemaRow ["IsAutoIncrement"])
- // return false;
- // if ((bool) schemaRow ["IsHidden"])
- // return false;
- if ((bool) schemaRow ["IsRowVersion"])
- return false;
- return true;
- }
-
- private static bool IncludedInWhereClause (DataRow schemaRow)
- {
- // if ((bool) schemaRow ["IsLong"])
- // return false;
- return true;
- }
-
- private static void SetParameterValues(MySqlCommand cmd, DataRow dataRow)
- {
- foreach (MySqlParameter p in cmd.Parameters)
- {
- if (p.SourceVersion == DataRowVersion.Original)
-// if (p.ParameterName.Length >= 8 && p.ParameterName.Substring(0,
8).Equals("Original"))
- p.Value = dataRow[p.SourceColumn, DataRowVersion.Original];
- else
- p.Value = dataRow[p.SourceColumn, DataRowVersion.Current];
- }
- }
-
- private void OnRowUpdating(object sender, MySqlRowUpdatingEventArgs args)
- {
- // make sure we are still to proceed
- if (args.Status != UpdateStatus.Continue) return;
-
- if (_schema == null)
- GenerateSchema();
-
- if (StatementType.Delete == args.StatementType)
- args.Command = CreateDeleteCommand();
- else if (StatementType.Update == args.StatementType)
- args.Command = CreateUpdateCommand();
- else if (StatementType.Insert == args.StatementType)
- args.Command = CreateInsertCommand();
- else if (StatementType.Select == args.StatementType)
- return;
-
- SetParameterValues(args.Command, args.Row);
- }
- #endregion
-
protected override DbCommand InitializeCommand(DbCommand command)
{
return base.InitializeCommand(command);
@@ -575,30 +193,6 @@
}
return schema;
- // make sure we got at least one unique or key field and count base table
names
-/* bool hasKeyOrUnique = false;
-
- foreach (DataRow row in _schema.Rows)
- {
- string rowTableName = row["BaseTableName"].ToString();
- string rowSchemaName = row["BaseSchemaName"].ToString();
-
- if (true == (bool)row["IsKey"] || true == (bool)row["IsUnique"])
- hasKeyOrUnique = true;
-
- if (tableName == null)
- {
- schemaName = rowSchemaName;
- tableName = rowTableName;
- }
- else if (tableName != rowTableName && rowTableName != null
&& rowTableName.Length > 0)
- throw new
InvalidOperationException(Resources.GetString("CBMultiTableNotSupported"));
- else if (schemaName != rowSchemaName && rowSchemaName != null
&& rowSchemaName.Length > 0)
- throw new
InvalidOperationException(Resources.GetString("CBMultiTableNotSupported"));
- }
- if (!hasKeyOrUnique)
- throw new
InvalidOperationException(Resources.GetString("CBNoKeyColumn"));
- * */
}
protected override void ApplyParameterInfo(DbParameter parameter, DataRow row,
Modified: trunk/mysqlclient/MySql.Data.2005.csproj
===================================================================
--- trunk/mysqlclient/MySql.Data.2005.csproj 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/MySql.Data.2005.csproj 2006-08-02 14:39:40 UTC (rev 291)
@@ -178,6 +178,7 @@
<Content Include="docs\MySqlParameter.xml" />
<Content Include="docs\MySqlParameterCollection.xml" />
<Content Include="docs\MySqlTransaction.xml" />
+ <Content Include="Release Notes.txt" />
<Content Include="ReservedWords.txt" />
</ItemGroup>
<ItemGroup>
Modified: trunk/mysqlclient/MySqlStream.cs
===================================================================
--- trunk/mysqlclient/MySqlStream.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/MySqlStream.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -138,8 +138,13 @@
/// </summary>
public void OpenPacket()
{
+ if (HasMoreData)
+ {
+ SkipBytes((int)(inLength - inPos));
+ Trace.WriteLine("HasMoreData is true");
+ }
// make sure we have read all the data from the previous packet
- Debug.Assert(HasMoreData == false, "HasMoreData is true in OpenPacket");
+ //Debug.Assert(HasMoreData == false, "HasMoreData is true in OpenPacket");
LoadPacket();
Modified: trunk/mysqlclient/NativeDriver.cs
===================================================================
--- trunk/mysqlclient/NativeDriver.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/NativeDriver.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -456,7 +456,7 @@
affectedRows = (ulong)stream.ReadFieldLength();
lastInsertId = (long)stream.ReadFieldLength();
- if ( version.isAtLeast(4,1,0) )
+ if (version.isAtLeast(4,1,0))
{
serverStatus = (ServerStatusFlags)stream.ReadInteger(2);
warningCount = stream.ReadInteger(2);
Modified: trunk/mysqlclient/ProcedureCache.cs
===================================================================
--- trunk/mysqlclient/ProcedureCache.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/ProcedureCache.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -109,10 +109,9 @@
restrictions[2] = name;
DataTable procTable = connection.GetSchema("procedures", restrictions);
if (procTable.Rows.Count > 1)
- throw new InvalidOperationException(Resources.ProcAndFuncSameName);
+ throw new MySqlException(Resources.ProcAndFuncSameName);
if (procTable.Rows.Count == 0)
- throw new InvalidOperationException(
- String.Format(Resources.InvalidProcName, name, schema));
+ throw new MySqlException(String.Format(Resources.InvalidProcName, name,
schema));
// we don't use GetSchema here because that would cause another
// query of procedures and we don't need that since we already
Modified: trunk/mysqlclient/SchemaProvider.cs
===================================================================
--- trunk/mysqlclient/SchemaProvider.cs 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/SchemaProvider.cs 2006-08-02 14:39:40 UTC (rev 291)
@@ -63,8 +63,19 @@
MySqlDataAdapter da = new MySqlDataAdapter(sql, connection);
DataTable dt = new DataTable();
da.Fill(dt);
- dt.TableName = "Databases";
- return dt;
+
+ DataTable table = new DataTable("Databases");
+ table.Columns.Add("CATALOG_NAME", typeof(string));
+ table.Columns.Add("SCHEMA_NAME", typeof(string));
+
+ foreach (DataRow row in dt.Rows)
+ {
+ DataRow newRow = table.NewRow();
+ newRow[1] = row[0];
+ table.Rows.Add(newRow);
+ }
+
+ return table;
}
public virtual DataTable GetTables(string[] restrictions)
@@ -98,7 +109,7 @@
restrictions[1] = db["SCHEMA_NAME"].ToString();
string table_type = restrictions[1].ToLower() == "information_schema" ?
"SYSTEM VIEW" : "BASE TABLE";
- DataTable tables = FindTables(restrictions, "NOT comment = 'View'");
+ DataTable tables = FindTables(restrictions);
foreach (DataRow table in tables.Rows)
{
DataRow row = dt.NewRow();
@@ -177,7 +188,7 @@
MySqlDataReader reader = null;
try
{
- int pos = 0;
+ int pos = 1;
reader = cmd.ExecuteReader();
while (reader.Read())
{
@@ -185,18 +196,18 @@
if (columnRestriction != null && colName !=
columnRestriction)
continue;
DataRow row = dt.NewRow();
- row["TABLE_CATALOG"] = null;
+ row["TABLE_CATALOG"] = DBNull.Value;
row["TABLE_SCHEMA"] = schema;
row["TABLE_NAME"] = tableName;
row["COLUMN_NAME"] = colName;
row["ORDINAL_POSITION"] = pos++;
- row["COLUMN_DEFAULT"] = reader.GetString(5);
+ row["COLUMN_DEFAULT"] = reader.GetValue(5);
row["IS_NULLABLE"] = reader.GetString(3);
row["DATA_TYPE"] = reader.GetString(1);
- row["CHARACTER_MAXIMUM_LENGTH"] = null;
- row["NUMERIC_PRECISION"] = null;
- row["NUMERIC_SCALE"] = null;
- row["CHARACTER_SET_NAME"] = reader.GetString(2);
+ row["CHARACTER_MAXIMUM_LENGTH"] = DBNull.Value;
+ row["NUMERIC_PRECISION"] = DBNull.Value;
+ row["NUMERIC_SCALE"] = DBNull.Value;
+ row["CHARACTER_SET_NAME"] = reader.GetValue(2);
row["COLLATION_NAME"] = row["CHARACTER_SET_NAME"];
row["COLUMN_TYPE"] = reader.GetString(1);
row["COLUMN_KEY"] = reader.GetString(4);
@@ -236,7 +247,7 @@
string dataLen = dataType.Substring(index + 1, stop - (index + 1));
string lowerType = row["DATA_TYPE"].ToString().ToLower();
if (lowerType == "char" || lowerType == "varchar")
- row["CHARACTER_SET_MAXIMUM"] = dataLen;
+ row["CHARACTER_MAXIMUM_LENGTH"] = dataLen;
else
{
string[] lenparts = dataLen.Split(new char[] { ',' });
@@ -561,7 +572,7 @@
}
}
- private DataTable FindTables(string[] restrictions, string whereSQL)
+ private DataTable FindTables(string[] restrictions)
{
string[] dbres = new string[1];
if (restrictions != null && restrictions.Length >= 2)
@@ -573,17 +584,10 @@
{
StringBuilder sql = new StringBuilder();
StringBuilder where = new StringBuilder();
- sql.AppendFormat("SHOW TABLE STATUS FROM '{0}'", db["SCHEMA_NAME"]);
+ sql.AppendFormat("SHOW TABLE STATUS FROM `{0}`", db["SCHEMA_NAME"]);
if (restrictions != null && restrictions.Length >= 3
&&
restrictions[2] != null)
- where.AppendFormat(" WHERE NAME='{0}'", restrictions[2]);
- if (whereSQL != null)
- {
- if (where.Length > 0)
- where.AppendFormat(" AND {0}", whereSQL);
- else
- where.AppendFormat(" WHERE {0}", whereSQL);
- }
+ where.AppendFormat(" LIKE '{0}'", restrictions[2]);
sql.Append(where.ToString());
MySqlDataAdapter da = new MySqlDataAdapter(sql.ToString(), connection);
da.Fill(tables);
Modified: trunk/mysqlclient/docs/MySqlCommand.xml
===================================================================
--- trunk/mysqlclient/docs/MySqlCommand.xml 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/docs/MySqlCommand.xml 2006-08-02 14:39:40 UTC (rev 291)
@@ -579,7 +579,9 @@
the <B>CommandText</B> property should be set to the name of the stored
procedure.
The user may be required to use escape character syntax if the stored procedure name
contains any special characters. The command executes this stored procedure when
- you call one of the Execute methods.
+ you call one of the Execute methods. Starting with Connector/Net 5.0, having both a
stored function
+ and stored procedure with the same name in the same database is not supported. It
is
+ suggested that you provide unqiue names for your stored routines.
</para>
</remarks>
<example>
Modified: trunk/mysqlclient/docs/MySqlCommandBuilder.xml
===================================================================
--- trunk/mysqlclient/docs/MySqlCommandBuilder.xml 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/docs/MySqlCommandBuilder.xml 2006-08-02 14:39:40 UTC (rev 291)
@@ -111,25 +111,6 @@
</summary>
</Ctor>
-<Ctor1>
- <summary>
- Initializes a new instance of the <see cref="MySqlCommandBuilder"/> class
- and sets the last one wins property.
- </summary>
- <param name="lastOneWins">False to generate change protection code. True
otherwise.</param>
- <remarks>
- <para>
- The <i>lastOneWins</i> parameter indicates whether SQL code should be
included
- with the generated DELETE and UPDATE commands that checks the underlying data
- for changes. If <i>lastOneWins</i> is true then this code is not included
and
- data records could be overwritten in a multi-user or multi-threaded environments.
- Setting <i>lastOneWins</i> to false will include this check which will cause
a
- concurrency exception to be thrown if the underlying data record has changed without
- our knowledge.
- </para>
- </remarks>
-</Ctor1>
-
<Ctor2>
<summary>
Initializes a new instance of the <see cref="MySqlCommandBuilder"/> class
@@ -150,35 +131,6 @@
</remarks>
</Ctor2>
-<Ctor3>
- <summary>
- Initializes a new instance of the <see cref="MySqlCommandBuilder"/> class
- with the associated <see cref="MySqlDataAdapter"/> object.
- </summary>
- <param name="adapter">The <see cref="MySqlDataAdapter"/> to
use.</param>
- <param name="lastOneWins">False to generate change protection code. True
otherwise.</param>
- <remarks>
- <para>
- The <see cref="MySqlCommandBuilder"/> registers itself as a listener for
- <see cref="MySqlDataAdapter.RowUpdating"/> events that are generated by the
- <see cref="MySqlDataAdapter"/> specified in this property.
- </para>
- <para>
- When you create a new instance <B>MySqlCommandBuilder</B>, any existing
- <B>MySqlCommandBuilder</B> associated with this
<B>MySqlDataAdapter</B>
- is released.
- </para>
- <para>
- The <i>lastOneWins</i> parameter indicates whether SQL code should be
included
- with the generated DELETE and UPDATE commands that checks the underlying data
- for changes. If <i>lastOneWins</i> is true then this code is not included
and
- data records could be overwritten in a multi-user or multi-threaded environments.
- Setting <i>lastOneWins</i> to false will include this check which will cause
a
- concurrency exception to be thrown if the underlying data record has changed without
- our knowledge.
- </para>
- </remarks>
-</Ctor3>
<DataAdapter>
<summary>
Modified: trunk/mysqlclient/docs/MySqlDataReader.xml
===================================================================
--- trunk/mysqlclient/docs/MySqlDataReader.xml 2006-08-01 04:40:40 UTC (rev 290)
+++ trunk/mysqlclient/docs/MySqlDataReader.xml 2006-08-02 14:39:40 UTC (rev 291)
@@ -1,195 +1,292 @@
-<docs>
-<ClassSummary>
+<docs>
+<ClassSummary>
<summary>
Provides a means of reading a forward-only stream of rows from a MySQL database. This
class cannot be inherited.
</summary>
- <remarks>
- <para>To create a <B>MySQLDataReader</B>, you must call the <see
cref="MySqlCommand.ExecuteReader()"/>
- method of the <see cref="MySqlCommand"/> object, rather than directly using a
constructor.
- </para>
- <para>While the <B>MySqlDataReader</B> is in use, the associated
<see cref="MySqlConnection"/>
- is busy serving the <B>MySqlDataReader</B>, and no other operations can
be performed
- on the <B>MySqlConnection</B> other than closing it. This is the case
until the
- <see cref="MySqlDataReader.Close"/> method of the
<B>MySqlDataReader</B> is called.
- </para>
- <para><see cref="MySqlDataReader.IsClosed"/> and <see
cref="MySqlDataReader.RecordsAffected"/>
- are the only properties that you can call after the <B>MySqlDataReader</B>
is
- closed. Though the <B>RecordsAffected</B> property may be accessed at any
time
- while the <B>MySqlDataReader</B> exists, always call
<B>Close</B> before returning
- the value of <B>RecordsAffected</B> to ensure an accurate return value.
- </para>
- <para>For optimal performance, <B>MySqlDataReader</B> avoids
creating
- unnecessary objects or making unnecessary copies of data. As a result, multiple calls
- to methods such as <see cref="MySqlDataReader.GetValue"/> return a reference to
the
- same object. Use caution if you are modifying the underlying value of the objects
- returned by methods such as <B>GetValue</B>.
- </para>
- </remarks>
-
-<example>
- The following example creates a <see cref="MySqlConnection"/>,
- a <see cref="MySqlCommand"/>, and a <B>MySqlDataReader</B>. The
example reads through
- the data, writing it out to the console. Finally, the example closes the
<B>MySqlDataReader</B>, then the
- <B>MySqlConnection</B>.
- <code lang="Visual Basic">
-Public Sub ReadMyData(myConnString As String)
- Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"
- Dim myConnection As New MySqlConnection(myConnString)
- Dim myCommand As New MySqlCommand(mySelectQuery, myConnection)
- myConnection.Open()
- Dim myReader As MySqlDataReader
- myReader = myCommand.ExecuteReader()
- ' Always call Read before accessing data.
- While myReader.Read()
- Console.WriteLine((myReader.GetInt32(0) & ", " &
myReader.GetString(1)))
- End While
- ' always call Close when done reading.
- myReader.Close()
- ' Close the connection when done with it.
- myConnection.Close()
-End Sub 'ReadMyData
- </code>
- <code lang="C#">
-public void ReadMyData(string myConnString) {
- string mySelectQuery = "SELECT OrderID, CustomerID FROM Orders";
- MySqlConnection myConnection = new MySqlConnection(myConnString);
- MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection);
- myConnection.Open();
- MySqlDataReader myReader;
- myReader = myCommand.ExecuteReader();
- // Always call Read before accessing data.
- while (myReader.Read()) {
- Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1));
- }
- // always call Close when done reading.
- myReader.Close();
- // Close the connection when done with it.
- myConnection.Close();
- }
- </code>
-</example>
-</ClassSummary>
-
-<GetBytes>
- <remarks>
- <para><B>GetBytes</B> returns the number of available bytes in the
field. In most
- cases this is the exact length of the field. However, the number returned may be
- less than the true length of the field if <B>GetBytes</B> has already been
used
- to obtain bytes from the field. This may be the case, for example, if the
- <see cref="MySqlDataReader"/> is reading a large data structure into a buffer.
- For more information, see the <B>SequentialAccess</B> setting for
- <see cref="MySqlCommand.CommandBehavior"/>.</para>
- <para>If you pass a buffer that is a null reference (<B>Nothing</B>
in Visual
- Basic), <B>GetBytes</B> returns the length of the field in
bytes.</para>
- <para>No conversions are performed; therefore the data retrieved must already be
a
- byte array.</para>
- </remarks>
-</GetBytes>
-
-<GetTimeSpan>
- <summary>Gets the value of the specified column as a <see cref="TimeSpan"/>
object.</summary>
- <remarks>
- </remarks>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetTimeSpan>
-
-<GetDateTime>
- <summary>Gets the value of the specified column as a <see cref="DateTime"/>
object.</summary>
- <remarks>
- <note>
- <para>
- MySql allows date columns to contain the value '0000-00-00' and datetime
- columns to contain the value '0000-00-00 00:00:00'. The DateTime structure cannot
contain
- or represent these values. To read a datetime value from a column that might
- contain zero values, use <see cref="GetMySqlDateTime"/>.
- </para>
- <para>
- The behavior of reading a zero datetime column using this method is defined by the
- <i>ZeroDateTimeBehavior</i> connection string option. For more information
on this option,
- please refer to <see cref="MySqlConnection.ConnectionString"/>.
- </para>
- </note>
- </remarks>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetDateTime>
-
-<GetMySqlDateTime>
- <summary>Gets the value of the specified column as a <see
cref="MySql.Data.Types.MySqlDateTime"/> object.</summary>
- <remarks>
- </remarks>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetMySqlDateTime>
-
-<GetString>
- <summary>Gets the value of the specified column as a <see cref="String"/>
object.</summary>
- <remarks></remarks>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetString>
-
-<GetDecimal>
- <summary>Gets the value of the specified column as a <see cref="Decimal"/>
object.</summary>
- <remarks></remarks>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetDecimal>
-
-<GetDouble>
- <summary>Gets the value of the specified column as a double-precision floating
point number.</summary>
- <remarks></remarks>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetDouble>
-
-<GetFloat>
- <summary>Gets the value of the specified column as a single-precision floating
point number.</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetFloat>
-
-<GetGiud>
- <summary>Gets the value of the specified column as a globally-unique identifier
(GUID).</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetGiud>
-
-<GetInt16>
- <summary>Gets the value of the specified column as a 16-bit signed
integer.</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetInt16>
-
-<GetInt32>
- <summary>Gets the value of the specified column as a 32-bit signed
integer.</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetInt32>
-
-<GetInt64>
- <summary>Gets the value of the specified column as a 64-bit signed
integer.</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetInt64>
-
-<GetUInt16>
- <summary>Gets the value of the specified column as a 16-bit unsigned
integer.</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetUInt16>
-
-<GetUInt32>
- <summary>Gets the value of the specified column as a 32-bit unsigned
integer.</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetUInt32>
-
-<GetUInt64>
- <summary>Gets the value of the specified column as a 64-bit unsigned
integer.</summary>
- <param name="index">The zero-based column ordinal.</param>
- <returns>The value of the specified column.</returns>
-</GetUInt64>
-
+ <remarks>
+ <para>To create a <B>MySQLDataReader</B>, you must call the <see
cref="MySqlCommand.ExecuteReader()"/>
+ method of the <see cref="MySqlCommand"/> object, rather than directly using a
constructor.
+ </para>
+ <para>While the <B>MySqlDataReader</B> is in use, the associated
<see cref="MySqlConnection"/>
+ is busy serving the <B>MySqlDataReader</B>, and no other operations can
be performed
+ on the <B>MySqlConnection</B> other than closing it. This is the case
until the
+ <see cref="MySqlDataReader.Close"/> method of the
<B>MySqlDataReader</B> is called.
+ </para>
+ <para><see cref="MySqlDataReader.IsClosed"/> and <see
cref="MySqlDataReader.RecordsAffected"/>
+ are the only properties that you can call after the <B>MySqlDataReader</B>
is
+ closed. Though the <B>RecordsAffected</B> property may be accessed at any
time
+ while the <B>MySqlDataReader</B> exists, always call
<B>Close</B> before returning
+ the value of <B>RecordsAffected</B> to ensure an accurate return value.
+ </para>
+ <para>For optimal performance, <B>MySqlDataReader</B> avoids
creating
+ unnecessary objects or making unnecessary copies of data. As a result, multiple calls
+ to methods such as <see cref="MySqlDataReader.GetValue"/> return a reference to
the
+ same object. Use caution if you are modifying the underlying value of the objects
+ returned by methods such as <B>GetValue</B>.
+ </para>
+ </remarks>
+
+<example>
+ The following example creates a <see cref="MySqlConnection"/>,
+ a <see cref="MySqlCommand"/>, and a <B>MySqlDataReader</B>. The
example reads through
+ the data, writing it out to the console. Finally, the example closes the
<B>MySqlDataReader</B>, then the
+ <B>MySqlConnection</B>.
+ <code lang="Visual Basic">
+Public Sub ReadMyData(myConnString As String)
+ Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"
+ Dim myConnection As New MySqlConnection(myConnString)
+ Dim myCommand As New MySqlCommand(mySelectQuery, myConnection)
+ myConnection.Open()
+ Dim myReader As MySqlDataReader
+ myReader = myCommand.ExecuteReader()
+ ' Always call Read before accessing data.
+ While myReader.Read()
+ Console.WriteLine((myReader.GetInt32(0) & ", " &
myReader.GetString(1)))
+ End While
+ ' always call Close when done reading.
+ myReader.Close()
+ ' Close the connection when done with it.
+ myConnection.Close()
+End Sub 'ReadMyData
+ </code>
+ <code lang="C#">
+public void ReadMyData(string myConnString) {
+ string mySelectQuery = "SELECT OrderID, CustomerID FROM Orders";
+ MySqlConnection myConnection = new MySqlConnection(myConnString);
+ MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection);
+ myConnection.Open();
+ MySqlDataReader myReader;
+ myReader = myCommand.ExecuteReader();
+ // Always call Read before accessing data.
+ while (myReader.Read()) {
+ Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1));
+ }
+ // always call Close when done reading.
+ myReader.Close();
+ // Close the connection when done with it.
+ myConnection.Close();
+ }
+ </code>
+</example>
+</ClassSummary>
+
+<GetBytes>
+ <remarks>
+ <para><B>GetBytes</B> returns the number of available bytes in the
field. In most
+ cases this is the exact length of the field. However, the number returned may be
+ less than the true length of the field if <B>GetBytes</B> has already been
used
+ to obtain bytes from the field. This may be the case, for example, if the
+ <see cref="MySqlDataReader"/> is reading a large data structure into a buffer.
+ For more information, see the <B>SequentialAccess</B> setting for
+ <see cref="MySqlCommand.CommandBehavior"/>.</para>
+ <para>If you pass a buffer that is a null reference (<B>Nothing</B>
in Visual
+ Basic), <B>GetBytes</B> returns the length of the field in
bytes.</para>
+ <para>No conversions are performed; therefore the data retrieved must already be
a
+ byte array.</para>
+ </remarks>
+</GetBytes>
+
+<GetTimeSpan>
+ <summary>Gets the value of the specified column as a <see cref="TimeSpan"/>
object.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>Time</b> value.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetTimeSpan>
+
+<GetDateTime>
+ <summary>Gets the value of the specified column as a <see cref="DateTime"/>
object.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>DateTime</b> object.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ <note>
+ <para>
+ MySql allows date columns to contain the value '0000-00-00' and datetime
+ columns to contain the value '0000-00-00 00:00:00'. The DateTime structure cannot
contain
+ or represent these values. To read a datetime value from a column that might
+ contain zero values, use <see cref="GetMySqlDateTime"/>.
+ </para>
+ <para>
+ The behavior of reading a zero datetime column using this method is defined by the
+ <i>ZeroDateTimeBehavior</i> connection string option. For more information
on this option,
+ please refer to <see cref="MySqlConnection.ConnectionString"/>.
+ </para>
+ </note>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetDateTime>
+
+<GetMySqlDateTime>
+ <summary>Gets the value of the specified column as a <see
cref="MySql.Data.Types.MySqlDateTime"/> object.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>DateTime</b> object.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetMySqlDateTime>
+
+<GetString>
+ <summary>Gets the value of the specified column as a <see cref="String"/>
object.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>String</b> object.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetString>
+
+<GetDecimal>
+ <summary>Gets the value of the specified column as a <see cref="Decimal"/>
object.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>Decimal</b> object.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetDecimal>
+
+<GetDouble>
+ <summary>Gets the value of the specified column as a double-precision floating
point number.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>Double</b> object.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetDouble>
+
+<GetFloat>
+ <summary>
+ Gets the value of the specified column as a single-precision floating point number.
+ </summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>Float</b> object.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetFloat>
+
+<GetGiud>
+ <summary>Gets the value of the specified column as a globally-unique identifier
(GUID).</summary>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetGiud>
+
+<GetInt16>
+ <summary>Gets the value of the specified column as a 16-bit signed
integer.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>16 bit integer</b> value.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetInt16>
+
+<GetInt32>
+ <summary>Gets the value of the specified column as a 32-bit signed
integer.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>32 bit integer</b> value.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetInt32>
+
+<GetInt64>
+ <summary>Gets the value of the specified column as a 64-bit signed
integer.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>64 bit integer</b> value.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetInt64>
+
+<GetUInt16>
+ <summary>Gets the value of the specified column as a 16-bit unsigned
integer.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>16 bit unsigned integer</b> value.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetUInt16>
+
+<GetUInt32>
+ <summary>Gets the value of the specified column as a 32-bit unsigned
integer.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>32 bit unsigned integer</b> value.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetUInt32>
+
+<GetUInt64>
+ <summary>Gets the value of the specified column as a 64-bit unsigned
integer.</summary>
+ <remarks>
+ <para>
+ No conversions are performed; therefore, the data retrieved must already be a
<b>64 bit unsigned integer</b> value.
+ </para>
+ <para>
+ Call IsDBNull to check for null values before calling this method.
+ </para>
+ </remarks>
+ <param name="index">The zero-based column ordinal.</param>
+ <returns>The value of the specified column.</returns>
+</GetUInt64>
+
</docs>
\ No newline at end of file
| Thread |
|---|
| • Connector/NET commit: r291 - in trunk: . Installer TestSuite mysqlclient mysqlclient/docs | rburnett | 2 Aug |