#At file:///C:/bzr-connector-net/5.2/ based on revid:reggie.burnett@stripped
699 Reggie Burnett 2009-07-29
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-29 01:43:20 +0000
+++ b/CHANGES 2009-07-29 22:01:58 +0000
@@ -2,6 +2,7 @@
- fixed situation where TreatTinyAsBoolean had no effect with default database character set to UTF8
(bug#46205)
- fixed MySqlScript class so that it respects delimiter statements (bug #46429)
+- 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-29 22:01:58 +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-29 22:01:58 +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-20090729220158-7speo1iz62gm6ulk.bundle
| Thread |
|---|
| • bzr commit into connector-net-5.2 branch (reggie.burnett:699) Bug#46270 | Reggie Burnett | 30 Jul |