Modified:
branches/5.2/MySql.Web/Providers/Properties/AssemblyInfo.cs
branches/5.2/MySql.Web/Providers/Source/ProfileProvider.cs
branches/5.2/MySql.Web/Tests/ProfileTests.cs
Log:
Fixed bug #41654. We had a typo in our SQL and had not included some necessary columns for the GetProfiles method to work right.
Modified: branches/5.2/MySql.Web/Providers/Properties/AssemblyInfo.cs
===================================================================
--- branches/5.2/MySql.Web/Providers/Properties/AssemblyInfo.cs 2009-03-03 17:25:20 UTC (rev 1519)
+++ branches/5.2/MySql.Web/Providers/Properties/AssemblyInfo.cs 2009-03-03 21:11:53 UTC (rev 1520)
@@ -53,5 +53,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("5.2.5")]
+[assembly: AssemblyVersion("5.2.6")]
[assembly: AssemblyKeyName("ConnectorNet")]
Modified: branches/5.2/MySql.Web/Providers/Source/ProfileProvider.cs
===================================================================
--- branches/5.2/MySql.Web/Providers/Source/ProfileProvider.cs 2009-03-03 17:25:20 UTC (rev 1519)
+++ branches/5.2/MySql.Web/Providers/Source/ProfileProvider.cs 2009-03-03 21:11:53 UTC (rev 1520)
@@ -635,8 +635,9 @@
c.Open();
MySqlCommand cmd = new MySqlCommand(
- @"SELECT p.*, LENGTH(p.stringdata) + LENGTH(p.binarydata) AS profilesize,
- u.name FROM my_aspnet_Profiles p
+ @"SELECT p.*, u.name, u.isAnonymous, u.lastActivityDate,
+ LENGTH(p.stringdata) + LENGTH(p.binarydata) AS profilesize
+ FROM my_aspnet_Profiles p
JOIN my_aspnet_Users u ON u.id = p.userId
WHERE u.applicationId = @appId", c);
cmd.Parameters.AddWithValue("@appId", applicationId);
@@ -667,13 +668,13 @@
reader.GetString("name"),
reader.GetBoolean("isAnonymous"),
reader.GetDateTime("lastActivityDate"),
- reader.GetDateTime("lastUpdatdDate"),
+ reader.GetDateTime("lastUpdatedDate"),
reader.GetInt32("profilesize"));
pic.Add(pi);
}
}
cmd.CommandText = "SELECT FOUND_ROWS()";
- totalRecords = (int)cmd.ExecuteScalar();
+ totalRecords = Convert.ToInt32(cmd.ExecuteScalar());
return pic;
}
}
Modified: branches/5.2/MySql.Web/Tests/ProfileTests.cs
===================================================================
--- branches/5.2/MySql.Web/Tests/ProfileTests.cs 2009-03-03 17:25:20 UTC (rev 1519)
+++ branches/5.2/MySql.Web/Tests/ProfileTests.cs 2009-03-03 21:11:53 UTC (rev 1520)
@@ -250,5 +250,32 @@
SettingsPropertyValue getValue1 = getValues["Name"];
Assert.AreEqual("Fred Flintstone", getValue1.PropertyValue);
}
+
+ /// <summary>
+ /// Bug #41654 FindProfilesByUserName error into Connector .NET
+ /// </summary>
+ [Test]
+ public void GetAllProfiles()
+ {
+ ProfileBase profile = ProfileBase.Create("foo", true);
+ ResetAppId(profile.Providers["MySqlProfileProvider"] as MySQLProfileProvider);
+ profile["Name"] = "Fred Flintstone";
+ profile.Save();
+
+ SettingsPropertyCollection getProps = new SettingsPropertyCollection();
+ SettingsProperty getProp1 = new SettingsProperty("Name");
+ getProp1.PropertyType = typeof(String);
+ getProps.Add(getProp1);
+
+ MySQLProfileProvider provider = InitProfileProvider();
+ SettingsContext ctx = new SettingsContext();
+ ctx.Add("IsAuthenticated", true);
+ ctx.Add("UserName", "foo");
+
+ int total;
+ ProfileInfoCollection profiles = provider.GetAllProfiles(
+ ProfileAuthenticationOption.All, 0, 10, out total);
+ Assert.AreEqual(1, total);
+ }
}
}
| Thread |
|---|
| • Connector/NET commit: r1520 - in branches/5.2/MySql.Web: Providers/Properties Providers/Source Tests | rburnett | 3 Mar |