From: Date: January 23 2007 6:13pm Subject: Connector/NET commit: r565 - in branches/1.0: . mysqlclient List-Archive: http://lists.mysql.com/commits/18643 X-Bug: 25726 Message-Id: <200701231713.l0NHDVcU003449@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/1.0/CHANGES branches/1.0/mysqlclient/nativedriver.cs Log: Bug #25726 MySqlConnection throws NullReferenceException and ArgumentNullException during connection, SupportsBatch is called but the server props hash has not been populated. We add a check to make sure the values are not null before we check. Modified: branches/1.0/CHANGES =================================================================== --- branches/1.0/CHANGES 2007-01-23 17:13:01 UTC (rev 564) +++ branches/1.0/CHANGES 2007-01-23 17:13:31 UTC (rev 565) @@ -22,6 +22,7 @@ Bug #25614 After connection is closed, and opened again UTF-8 characters are not read well Bug #25625 Crashes when calling with CommandType set to StoredProcedure Bug #25651 SELECT does not work properly when WHERE contains UTF-8 characters + Bug #25726 MySqlConnection throws NullReferenceException and ArgumentNullException Other changes ------------- Modified: branches/1.0/mysqlclient/nativedriver.cs =================================================================== --- branches/1.0/mysqlclient/nativedriver.cs 2007-01-23 17:13:01 UTC (rev 564) +++ branches/1.0/mysqlclient/nativedriver.cs 2007-01-23 17:13:31 UTC (rev 565) @@ -71,20 +71,23 @@ /// public override bool SupportsBatch { - get - { - if ((Flags & ClientFlags.MULTI_STATEMENTS) != 0) - { - if (version.isAtLeast(4, 1, 0) && !version.isAtLeast(4, 1, 10)) - { - if (serverProps["query_cache_type"].Equals("ON") && - !serverProps["query_cache_size"].Equals("0")) return false; - } - return true; - } - return false; - } - } + get + { + if ((Flags & ClientFlags.MULTI_STATEMENTS) != 0) + { + if (version.isAtLeast(4, 1, 0) && !version.isAtLeast(4, 1, 10)) + { + object qtType = serverProps["query_cache_type"]; + object qtSize = serverProps["query_cache_size"]; + if (qtType != null && qtType.Equals("ON") && + (qtSize != null && !qtSize.Equals("0"))) + return false; + } + return true; + } + return false; + } + } private void ExecuteCommand(DBCmd cmd, byte[] bytes, int length) {