#At file:///D:/bzr-connector-net/trunk/ based on revid:reggie.burnett@stripped
853 Reggie Burnett 2010-03-11 [merge]
merged
modified:
CHANGES
MySql.Data/Provider/Properties/Resources.Designer.cs
MySql.Data/Provider/Properties/Resources.resx
MySql.Data/Provider/Source/ResultSet.cs
MySql.Data/Provider/Source/datareader.cs
MySql.Data/Tests/Source/DataReaderTests.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES 2010-03-10 19:18:57 +0000
+++ b/CHANGES 2010-03-11 21:04:56 +0000
@@ -1,9 +1,11 @@
-Version 6.3.2
- added feature where sql queries that are longer than 300 chars are normalized and a new
query normalized log line is issues right after query opened to give the query normalized text
- fixed bug in sql generation when using a negated binary fragment in EF (bug #49850)
- fixed bug in tokenization where a nonterminated string in sql will cause a CLR exception
rather than throwing a syntax exception (bug #51788)
+- added two requested features -- MySqlDataReader.GetFieldType(string columnname) &
+ MySqlDataReader.GetOrdinal() includes the name of the column in the exception when not found
+ (bug #47467)
Version 6.3.1
- fixed bug where giving a connection string option like (option=) and then trying to read
=== modified file 'MySql.Data/Provider/Properties/Resources.Designer.cs'
--- a/MySql.Data/Provider/Properties/Resources.Designer.cs 2010-03-08 21:23:04 +0000
+++ b/MySql.Data/Provider/Properties/Resources.Designer.cs 2010-03-11 21:04:56 +0000
@@ -21,9 +21,7 @@
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-#if !CF
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-#endif
public class Resources {
private static global::System.Resources.ResourceManager resourceMan;
@@ -216,7 +214,7 @@
}
/// <summary>
- /// Looks up a localized string similar to Could not find specified column in results.
+ /// Looks up a localized string similar to Could not find specified column in results: {0}.
/// </summary>
public static string CouldNotFindColumnName {
get {
=== modified file 'MySql.Data/Provider/Properties/Resources.resx'
--- a/MySql.Data/Provider/Properties/Resources.resx 2010-03-08 21:23:04 +0000
+++ b/MySql.Data/Provider/Properties/Resources.resx 2010-03-11 21:04:56 +0000
@@ -367,7 +367,7 @@
<value>The host {0} does not support SSL connections.</value>
</data>
<data name="CouldNotFindColumnName" xml:space="preserve">
- <value>Could not find specified column in results</value>
+ <value>Could not find specified column in results: {0}</value>
</data>
<data name="InvalidColumnOrdinal" xml:space="preserve">
<value>You have specified an invalid column ordinal.</value>
=== modified file 'MySql.Data/Provider/Source/ResultSet.cs'
--- a/MySql.Data/Provider/Source/ResultSet.cs 2009-10-09 20:38:36 +0000
+++ b/MySql.Data/Provider/Source/ResultSet.cs 2010-03-11 21:02:47 +0000
@@ -135,7 +135,8 @@
return (int)ordinal;
// Throw an exception if the ordinal cannot be found.
- throw new IndexOutOfRangeException(Resources.CouldNotFindColumnName);
+ throw new IndexOutOfRangeException(
+ String.Format(Resources.CouldNotFindColumnName, name));
}
/// <summary>
=== modified file 'MySql.Data/Provider/Source/datareader.cs'
--- a/MySql.Data/Provider/Source/datareader.cs 2009-12-03 18:25:19 +0000
+++ b/MySql.Data/Provider/Source/datareader.cs 2010-03-11 21:04:56 +0000
@@ -454,7 +454,12 @@
return Convert.ToDouble(v.Value);
}
- /// <summary>
+ public Type GetFieldType(string column)
+ {
+ return GetFieldType(GetOrdinal(column));
+ }
+
+ /// <summary>
/// Gets the Type that is the data type of the object.
/// </summary>
/// <param name="i"></param>
=== modified file 'MySql.Data/Tests/Source/DataReaderTests.cs'
--- a/MySql.Data/Tests/Source/DataReaderTests.cs 2009-08-31 19:37:35 +0000
+++ b/MySql.Data/Tests/Source/DataReaderTests.cs 2010-03-11 21:01:18 +0000
@@ -773,5 +773,29 @@
string name2 = reader.GetString(1);
}
}
+
+ /// <summary>
+ /// Bug #47467 Two simple changes for DataReader
+ /// </summary>
+ [Test]
+ public void Bug47467()
+ {
+ MySqlCommand cmd = new MySqlCommand("SELECT 1 as c1", conn);
+ using (MySqlDataReader reader = cmd.ExecuteReader())
+ {
+ reader.Read();
+ Type t = reader.GetFieldType("c1");
+
+ try
+ {
+ reader.GetOrdinal("nocol");
+ Assert.Fail("This should have failed");
+ }
+ catch (IndexOutOfRangeException ex)
+ {
+ Assert.IsTrue(ex.Message.IndexOf("nocol") != -1);
+ }
+ }
+ }
}
}
Attachment: [text/bzr-bundle] bzr/reggie.burnett@sun.com-20100311210456-fcfcpzpsyupsmhem.bundle
| Thread |
|---|
| • bzr commit into connector-net-trunk branch (reggie.burnett:853) | Reggie Burnett | 11 Mar 2010 |