Bug #53253 | MySqlException often results in a useless stack trace | ||
---|---|---|---|
Submitted: | 28 Apr 2010 14:42 | Modified: | 20 Jul 2010 19:24 |
Reporter: | Craig Fowler | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 6.2.3 | OS: | Linux (Mono 1.9.1/Debian Testing) |
Assigned to: | Reggie Burnett | CPU Architecture: | Any |
Tags: | exception, stack-trace |
[28 Apr 2010 14:42]
Craig Fowler
[28 Apr 2010 14:44]
Craig Fowler
A small test case that demonstrates the issue. See the README included and 'how to reproduce' for info
Attachment: Test.MySqlException.zip (application/zip, text), 11.41 KiB.
[3 May 2010 10:52]
Tonci Grgin
Hi Craig and thanks for your report. Although I wrote nothing inhere I am looking into it.
[3 May 2010 12:00]
Tonci Grgin
Craig, although the re-throw is visible from current stack trace I like yours better. Verified as described and waiting on Reggie to make final decision.
[23 Jun 2010 19:20]
Reggie Burnett
I don't see the issue here. I've checked this with 6.0, 6.1, and 6.2. Here is the stacktrace I see from my testcase. If you can show me more concretely the problem, I'll reconsider. at MySql.Data.MySqlClient.MySqlStream.ReadPacket() in C:\work\connector-net\6.2\MySql.Data\Provider\Source\MySqlStream.cs:line 142 at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) in C:\work\connector-net\6.2 \MySql.Data\Provider\Source\NativeDriver.cs:line 562 at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) in C:\work\connector-net\6.2\MySql.Data\Provider\Source\Driver.cs:line 377 at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) in C:\work\connector-net\6.2\MySql.Data\Provider\Source\Driver.cs:line 366 at MySql.Data.MySqlClient.MySqlDataReader.NextResult() in C:\work\connector-net\6.2\MySql.Data\Provider\Source\datareader.cs:line 858 at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) in C:\work\connector-net\6.2\MySql.Data\Provider\Source\command.cs:line 468 at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() in C:\work\connector-net\6.2\MySql.Data\Provider\Source\command.cs:line 347 at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() in C:\work\connector-net\6.2\MySql.Data\Provider\Source\command.cs:line 305 at MySql.Data.MySqlClient.Tests.ExceptionTests.BadStackTrace() in C:\work\connector-net\6.2\MySql.Data\Tests\Source\ExceptionTests.cs:line 97
[5 Jul 2010 14:00]
Craig Fowler
Sorry for the delay in responding on this. Have re-opened the bug because I'm not sure if anyone will see notifications while it's "!Bg". Either way - that stack trace you posted - I believe/assume that has been produced by Visual Studio's debugging function (since it contains source file names and line numbers, which a normal stack trace doesn't contain). It could be that Visual Studio's debugging environment is behaving differently to the usual execution environment and hiding the issue from you. Are you able to compile and then test outside of Visual Studio? For example, using the standalone NUnit test runner. Does this produce the same stack trace as the one generated inside VS? I am personally using MonoDevelop and the standalone NUnit test runner on Linux/Mono (since I originally reported this I have upgraded to Mono 2.4.4 but I can still replicate the problem). When I can next find some time I will try to put together a .NET framework environment on a Windows XP VM and give it a try in there using csc and the standalone NUnit GUI.
[20 Jul 2010 19:24]
Reggie Burnett
I'm sorry but this is not a good solution. First, throw; is the correct syntax for rethrowing an exception and it works fine with .NET (even outside of VS). If mono is not handling it properly that is a Mono issue. Second, your patch changes the type of exception that surfaces. If a timeout occurs, I want a TimeoutException to surface in user code. The same goes for the generic Exception block. I'm not sure what type of exception is there but I want it to surface in the user code. Closing as !bug.