Commit 2c5ec00
committed
Prevent the same reader being closed twice. Fixes #423
Dispose(bool) calls DoClose then (on certain frameworks) base.Dispose(bool) calls Close, which calls DoClose again.
This normally wouldn't be a problem except that when a stored procedure has OUT parameters, they are read from a nested MySqlDataReader. This reentrancy allows a reader to be closed twice if an exception is thrown, which masks the underlying exception and throws InvalidOperationExcepion "Expected state to be Failed but was Connected" instead.1 parent 239dfe6 commit 2c5ec00
File tree
3 files changed
+30
-2
lines changed- src/MySqlConnector/MySql.Data.MySqlClient
- tests/SideBySide
3 files changed
+30
-2
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
| 401 | + | |
| 402 | + | |
401 | 403 | | |
402 | 404 | | |
403 | 405 | | |
| |||
443 | 445 | | |
444 | 446 | | |
445 | 447 | | |
| 448 | + | |
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
120 | 138 | | |
121 | 139 | | |
122 | 140 | | |
| |||
0 commit comments