From: Date: December 19 2006 6:39pm Subject: Connector/NET commit: r510 - in trunk: TestSuite mysqlclient/core List-Archive: http://lists.mysql.com/commits/17174 X-Bug: 25178 Message-Id: <200612191739.kBJHd7i8016080@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: trunk/TestSuite/Syntax.cs trunk/mysqlclient/core/MySqlStream.cs Log: Bug #25178 Addition message in error Fixed this by parsing off the state code that precedes the message. Modified: trunk/TestSuite/Syntax.cs =================================================================== --- trunk/TestSuite/Syntax.cs 2006-12-19 17:25:47 UTC (rev 509) +++ trunk/TestSuite/Syntax.cs 2006-12-19 17:39:06 UTC (rev 510) @@ -415,5 +415,23 @@ Assert.Fail(ex.Message); } } + + /// + /// Bug #25178 Addition message in error + /// + [Test] + public void ErrorMessage() + { + MySqlCommand cmd = new MySqlCommand("SELEKT NOW() as theTime", conn); + try + { + object o = cmd.ExecuteScalar(); + } + catch (MySqlException ex) + { + string s = ex.Message; + Assert.IsFalse(s.StartsWith("#")); + } + } } } Modified: trunk/mysqlclient/core/MySqlStream.cs =================================================================== --- trunk/mysqlclient/core/MySqlStream.cs 2006-12-19 17:25:47 UTC (rev 509) +++ trunk/mysqlclient/core/MySqlStream.cs 2006-12-19 17:39:06 UTC (rev 510) @@ -163,6 +163,11 @@ int code = ReadInteger(2); string msg = ReadString(); + if (msg.StartsWith("#")) + { + string stateCode = msg.Substring(1, 5); + msg = msg.Substring(6); + } throw new MySqlException(msg, code); } isLastPacket = (peek == 0xfe && (inLength < 9));