#At file:///C:/bzr-connector-net/5.2/ based on revid:vvaintroub@stripped
698 Reggie Burnett 2009-07-28
- fixed "column" schema collection so that it will return set and enum datatypes correctly (bug #46270)
modified:
CHANGES
MySql.Data/Provider/Source/SchemaProvider.cs
MySql.Data/Tests/Source/GetSchemaTests.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES 2009-07-28 20:13:31 +0000
+++ b/CHANGES 2009-07-28 21:21:21 +0000
@@ -1,6 +1,7 @@
Version 5.2.8
- fixed situation where TreatTinyAsBoolean had no effect with default database character set to UTF8
(bug#46205)
+- fixed "column" schema collection so that it will return set and enum datatypes correctly (bug #46270)
Version 5.2.7 7/13/09
- fixed procedure parameters collection so that an exception is thrown if we can't get the
=== modified file 'MySql.Data/Provider/Source/SchemaProvider.cs'
--- a/MySql.Data/Provider/Source/SchemaProvider.cs 2009-05-18 20:21:06 +0000
+++ b/MySql.Data/Provider/Source/SchemaProvider.cs 2009-07-28 21:21:21 +0000
@@ -235,7 +235,9 @@
int stop = dataType.IndexOf(')', index);
string dataLen = dataType.Substring(index + 1, stop - (index + 1));
string lowerType = row["DATA_TYPE"].ToString().ToLower();
- if (lowerType == "char" || lowerType == "varchar")
+ if (lowerType == "set" || lowerType == "enum")
+ row["DATA_TYPE"] = dataType;
+ else if (lowerType == "char" || lowerType == "varchar")
row["CHARACTER_MAXIMUM_LENGTH"] = dataLen;
else
{
=== modified file 'MySql.Data/Tests/Source/GetSchemaTests.cs'
--- a/MySql.Data/Tests/Source/GetSchemaTests.cs 2009-05-18 20:21:06 +0000
+++ b/MySql.Data/Tests/Source/GetSchemaTests.cs 2009-07-28 21:21:21 +0000
@@ -226,6 +226,21 @@
Assert.AreEqual("TINYINT", dt.Rows[3]["DATA_TYPE"].ToString().ToUpper());
}
+ /// <summary>
+ /// Bug #46270 connection.GetSchema("Columns") fails on MySQL 4.1
+ /// </summary>
+ [Test]
+ public void EnumAndSetColumns()
+ {
+ execSQL("DROP TABLE IF EXISTS test");
+ execSQL("CREATE TABLE test (col1 set('A','B','C'), col2 enum('A','B','C'))");
+
+ DataTable dt = conn.GetSchema("Columns", new string[] { null, null, "test", null });
+ Assert.AreEqual(2, dt.Rows.Count);
+ Assert.AreEqual("set('A','B','C')", dt.Rows[0]["DATA_TYPE"]);
+ Assert.AreEqual("enum('A','B','C')", dt.Rows[1]["DATA_TYPE"]);
+ }
+
[Test]
public void Procedures()
{
Attachment: [text/bzr-bundle] bzr/reggie.burnett@sun.com-20090728212121-c6okge4rvg8z56vy.bundle
| Thread |
|---|
| • bzr commit into connector-net-5.2 branch (reggie.burnett:698) Bug#46270 | Reggie Burnett | 28 Jul |