From: Date: May 7 2008 5:45pm Subject: Connector/NET commit: r1286 - in branches/5.1: . Driver/Source TestSuite/Source List-Archive: http://lists.mysql.com/commits/46466 X-Bug: 35619 Message-Id: <200805071545.m47FjMkC010284@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/5.1/CHANGES branches/5.1/Driver/Source/Connection.cs branches/5.1/TestSuite/Source/ConnectionTests.cs Log: - Fixed problem where setting the ConnectionString property of MySqlConnection to null would throw an exception (bug #35619) Modified: branches/5.1/CHANGES =================================================================== --- branches/5.1/CHANGES 2008-05-07 14:27:39 UTC (rev 1285) +++ branches/5.1/CHANGES 2008-05-07 15:45:22 UTC (rev 1286) @@ -21,6 +21,8 @@ - Fixed data type processing so that geometry fields are returned as binary. (bug #36081) - Fixed problem that kept our provider from showing up in the provider list when configuring a new connection from a SqlDataSource + - Fixed problem where setting the ConnectionString property of MySqlConnection to null + would throw an exception (bug #35619) Version 5.1.5 - - Fixed problem with membership provider where FindUserByEmail would fail trying to add Modified: branches/5.1/Driver/Source/Connection.cs =================================================================== --- branches/5.1/Driver/Source/Connection.cs 2008-05-07 14:27:39 UTC (rev 1285) +++ branches/5.1/Driver/Source/Connection.cs 2008-05-07 15:45:22 UTC (rev 1286) @@ -260,11 +260,16 @@ MySqlConnectionStringBuilder newSettings; lock (connectionStringCache) { - newSettings = (MySqlConnectionStringBuilder)connectionStringCache[value]; - if (null == newSettings) + if (value == null) + newSettings = new MySqlConnectionStringBuilder(); + else { - newSettings = new MySqlConnectionStringBuilder(value); - connectionStringCache.Add(value, newSettings); + newSettings = (MySqlConnectionStringBuilder)connectionStringCache[value]; + if (null == newSettings) + { + newSettings = new MySqlConnectionStringBuilder(value); + connectionStringCache.Add(value, newSettings); + } } } Modified: branches/5.1/TestSuite/Source/ConnectionTests.cs =================================================================== --- branches/5.1/TestSuite/Source/ConnectionTests.cs 2008-05-07 14:27:39 UTC (rev 1285) +++ branches/5.1/TestSuite/Source/ConnectionTests.cs 2008-05-07 15:45:22 UTC (rev 1286) @@ -473,5 +473,15 @@ Assert.Fail(ex.Message); } } + + /// + /// Bug #35619 creating a MySql connection from toolbox generates an error + /// + [Test] + public void NullConnectionString() + { + MySqlConnection c = new MySqlConnection(); + c.ConnectionString = null; + } } }