File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -812,8 +812,9 @@ internal void FinishQuerying(bool hasWarnings)
812
812
{
813
813
var errors = new List < MySqlError > ( ) ;
814
814
using ( var command = new MySqlCommand ( "SHOW WARNINGS;" , this ) )
815
- using ( var reader = command . ExecuteReader ( ) )
816
815
{
816
+ command . Transaction = CurrentTransaction ;
817
+ using var reader = command . ExecuteReader ( ) ;
817
818
while ( reader . Read ( ) )
818
819
errors . Add ( new ( reader . GetString ( 0 ) , reader . GetInt32 ( 1 ) , reader . GetString ( 2 ) ) ) ;
819
820
}
Original file line number Diff line number Diff line change @@ -40,6 +40,30 @@ public void GotInfoMessageForNonExistentTable()
40
40
Assert . True ( gotEvent ) ;
41
41
}
42
42
43
+ [ Fact ]
44
+ public void GotInfoMessageForNonExistentTableInTransaction ( )
45
+ {
46
+ using var connection = new MySqlConnection ( AppConfig . ConnectionString ) ;
47
+ connection . Open ( ) ;
48
+ using var transaction = connection . BeginTransaction ( ) ;
49
+
50
+ var gotEvent = false ;
51
+ connection . InfoMessage += ( s , a ) =>
52
+ {
53
+ gotEvent = true ;
54
+ #if BASELINE
55
+ Assert . Single ( a . errors ) ;
56
+ Assert . Equal ( ( int ) MySqlErrorCode . BadTable , a . errors [ 0 ] . Code ) ;
57
+ #else
58
+ Assert . Single ( a . Errors ) ;
59
+ Assert . Equal ( ( int ) MySqlErrorCode . BadTable , a . Errors [ 0 ] . Code ) ;
60
+ #endif
61
+ } ;
62
+
63
+ connection . Execute ( @"drop table if exists table_does_not_exist;" , transaction : transaction ) ;
64
+ Assert . True ( gotEvent ) ;
65
+ }
66
+
43
67
[ Fact ]
44
68
public void NoInfoMessageWhenNotLastStatementInBatch ( )
45
69
{
You can’t perform that action at this time.
0 commit comments