Modified:
trunk/TestSuite/ConnectionTests.cs
trunk/mysqlclient/Connection.cs
trunk/mysqlclient/SchemaProvider.cs
Log:
Fixed problem where persist security info was not being honored.
Also fixed a problem where the reserved words resource was not always being successfully
retrieved.
Modified: trunk/TestSuite/ConnectionTests.cs
===================================================================
--- trunk/TestSuite/ConnectionTests.cs 2006-09-28 15:57:14 UTC (rev 369)
+++ trunk/TestSuite/ConnectionTests.cs 2006-09-28 17:03:23 UTC (rev 370)
@@ -354,21 +354,28 @@
string s = GetConnectionString(true).ToLower();
int start = s.IndexOf("persist security info");
int end = s.IndexOf(";", start);
- string newConnStr = s.Substring(0, start);
- newConnStr += s.Substring(end, s.Length - (end));
- newConnStr += ";persist security info=false";
+ string connStr = s.Substring(0, start);
+ connStr += s.Substring(end, s.Length - (end));
+ string p = "password";
+ if (connStr.IndexOf("pwd") != -1)
+ p = "pwd";
+ else if (connStr.IndexOf("passwd") != -1)
+ p = "passwd";
+
+ string newConnStr = connStr + ";persist security info=true";
MySqlConnection conn2 = new MySqlConnection(newConnStr);
- string p = "password";
- if (conn2.ConnectionString.IndexOf("pwd") != -1)
- p = "pwd";
- else if (conn2.ConnectionString.IndexOf("passwd") != -1)
- p = "passwd";
-
Assert.IsTrue(conn2.ConnectionString.IndexOf(p) != -1);
conn2.Open();
conn2.Close();
- Assert.IsTrue(conn2.ConnectionString.IndexOf(p) == -1);
+ Assert.IsTrue(conn2.ConnectionString.IndexOf(p) != -1);
+
+ newConnStr = connStr + ";persist security info=false";
+ conn2 = new MySqlConnection(newConnStr);
+ Assert.IsTrue(conn2.ConnectionString.IndexOf(p) != -1);
+ conn2.Open();
+ conn2.Close();
+ Assert.IsTrue(conn2.ConnectionString.IndexOf(p) == -1);
}
/// <summary>
Modified: trunk/mysqlclient/Connection.cs
===================================================================
--- trunk/mysqlclient/Connection.cs 2006-09-28 15:57:14 UTC (rev 369)
+++ trunk/mysqlclient/Connection.cs 2006-09-28 17:03:23 UTC (rev 370)
@@ -220,7 +220,7 @@
{
// Always return exactly what the user set.
// Security-sensitive information may be removed.
- return settings.GetConnectionString(!hasBeenOpen);
+ return settings.GetConnectionString(!hasBeenOpen || settings.PersistSecurityInfo);
}
set
{
Modified: trunk/mysqlclient/SchemaProvider.cs
===================================================================
--- trunk/mysqlclient/SchemaProvider.cs 2006-09-28 15:57:14 UTC (rev 369)
+++ trunk/mysqlclient/SchemaProvider.cs 2006-09-28 17:03:23 UTC (rev 370)
@@ -675,7 +675,7 @@
DataTable dt = new DataTable("ReservedWords");
dt.Columns.Add(new DataColumn("Reserved Word", typeof(string)));
- Stream str = Assembly.GetCallingAssembly().GetManifestResourceStream(
+ Stream str = Assembly.GetExecutingAssembly().GetManifestResourceStream(
"MySql.Data.MySqlClient.ReservedWords.txt");
StreamReader sr = new StreamReader(str);
string line = sr.ReadLine();
| Thread |
|---|
| • Connector/NET commit: r370 - in trunk: TestSuite mysqlclient | rburnett | 28 Sep |