File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,15 @@ where
89
89
90
90
loop {
91
91
match responses. next ( ) . await ? {
92
- Message :: ParseComplete
93
- | Message :: BindComplete
94
- | Message :: ParameterDescription ( _)
95
- | Message :: NoData => { }
92
+ Message :: ParseComplete | Message :: BindComplete | Message :: ParameterDescription ( _) => { }
93
+ Message :: NoData => {
94
+ return Ok ( RowStream {
95
+ statement : Statement :: unnamed ( vec ! [ ] , vec ! [ ] ) ,
96
+ responses,
97
+ rows_affected : None ,
98
+ _p : PhantomPinned ,
99
+ } ) ;
100
+ }
96
101
Message :: RowDescription ( row_description) => {
97
102
let mut columns: Vec < Column > = vec ! [ ] ;
98
103
let mut it = row_description. fields ( ) ;
Original file line number Diff line number Diff line change @@ -997,6 +997,13 @@ async fn query_typed_no_transaction() {
997
997
assert_eq ! ( second_row. get:: <_, i32 >( 1 ) , 40 ) ;
998
998
assert_eq ! ( second_row. get:: <_, & str >( 2 ) , "literal" ) ;
999
999
assert_eq ! ( second_row. get:: <_, i32 >( 3 ) , 5 ) ;
1000
+
1001
+ // Test for UPDATE that returns no data
1002
+ let updated_rows = client
1003
+ . query_typed ( "UPDATE foo set age = 33" , & [ ] )
1004
+ . await
1005
+ . unwrap ( ) ;
1006
+ assert_eq ! ( updated_rows. len( ) , 0 ) ;
1000
1007
}
1001
1008
1002
1009
#[ tokio:: test]
@@ -1064,4 +1071,11 @@ async fn query_typed_with_transaction() {
1064
1071
assert_eq ! ( second_row. get:: <_, i32 >( 1 ) , 40 ) ;
1065
1072
assert_eq ! ( second_row. get:: <_, & str >( 2 ) , "literal" ) ;
1066
1073
assert_eq ! ( second_row. get:: <_, i32 >( 3 ) , 5 ) ;
1074
+
1075
+ // Test for UPDATE that returns no data
1076
+ let updated_rows = transaction
1077
+ . query_typed ( "UPDATE foo set age = 33" , & [ ] )
1078
+ . await
1079
+ . unwrap ( ) ;
1080
+ assert_eq ! ( updated_rows. len( ) , 0 ) ;
1067
1081
}
You can’t perform that action at this time.
0 commit comments