From: Date: November 11 2008 11:03pm Subject: Connector/NET commit: r1451 - branches/5.2/MySql.Data/Provider/Source List-Archive: http://lists.mysql.com/commits/58505 X-Bug: 40231 Message-Id: <200811112203.mABM357A004040@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/5.2/MySql.Data/Provider/Source/CharSetMap.cs Log: small tweak to the fix for bug #40231. The argument to lock must always be non-null Modified: branches/5.2/MySql.Data/Provider/Source/CharSetMap.cs =================================================================== --- branches/5.2/MySql.Data/Provider/Source/CharSetMap.cs 2008-11-11 21:58:54 UTC (rev 1450) +++ branches/5.2/MySql.Data/Provider/Source/CharSetMap.cs 2008-11-11 22:03:05 UTC (rev 1451) @@ -34,8 +34,8 @@ internal class CharSetMap { #if NET20 - private static Dictionary defaultCollations; - private static Dictionary maxLengths; + private static Dictionary defaultCollations = new Dictionary(); + private static Dictionary maxLengths = new Dictionary(); private static Dictionary mapping; #else private static Hashtable mapping; @@ -150,9 +150,6 @@ internal static void InitCollections(MySqlConnection connection) { - defaultCollations = new Dictionary(); - maxLengths = new Dictionary(); - MySqlCommand cmd = new MySqlCommand("SHOW CHARSET", connection); using (MySqlDataReader reader = cmd.ExecuteReader()) { @@ -168,7 +165,7 @@ { lock (defaultCollations) { - if (defaultCollations == null) + if (defaultCollations.Count == 0) InitCollections(connection); } if (!defaultCollations.ContainsKey(charset)) @@ -182,7 +179,7 @@ // is on the same lock as us. lock (defaultCollations) { - if (maxLengths == null) + if (maxLengths.Count == 0) InitCollections(connection); }