File tree Expand file tree Collapse file tree 2 files changed +34
-5
lines changed
net-questdb-client/Buffers Expand file tree Collapse file tree 2 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -993,6 +993,33 @@ public async Task CancelLine()
993993 Assert . That ( srv . PrintBuffer ( ) , Is . EqualTo ( expected ) ) ;
994994 }
995995
996+
997+ [ Test ]
998+ public async Task CancelLineAfterClear ( )
999+ {
1000+ using var srv = new DummyHttpServer ( ) ;
1001+ await srv . StartAsync ( HttpPort ) ;
1002+ using var sender = Sender . New ( $ "http::addr={ Host } :{ HttpPort } ;auto_flush=off;") ;
1003+
1004+ sender . Table ( "good" ) ;
1005+ sender . Symbol ( "asdf" , "sdfad" ) ;
1006+ sender . Column ( "ddd" , 123 ) ;
1007+ sender . At ( new DateTime ( 1970 , 1 , 2 ) ) ;
1008+
1009+ sender . Table ( "bad" ) ;
1010+ sender . Symbol ( "asdf" , "sdfad" ) ;
1011+ sender . Column ( "asdf" , 123 ) ;
1012+ sender . Clear ( ) ;
1013+ sender . CancelRow ( ) ;
1014+
1015+ sender . Table ( "good" ) ;
1016+ await sender . AtAsync ( new DateTime ( 1970 , 1 , 2 ) ) ;
1017+ await sender . SendAsync ( ) ;
1018+
1019+ var expected = "good 86400000000000\n " ;
1020+ Assert . That ( srv . PrintBuffer ( ) , Is . EqualTo ( expected ) ) ;
1021+ }
1022+
9961023 [ Test ]
9971024 public async Task CannotConnect ( )
9981025 {
Original file line number Diff line number Diff line change @@ -135,11 +135,13 @@ public void Clear()
135135 _buffers [ i ] = ( _buffers [ i ] . Buffer , 0 ) ;
136136 }
137137
138- Position = 0 ;
139- RowCount = 0 ;
140- Length = 0 ;
141- WithinTransaction = false ;
142- _currentTableName = "" ;
138+ Position = 0 ;
139+ RowCount = 0 ;
140+ Length = 0 ;
141+ WithinTransaction = false ;
142+ _currentTableName = "" ;
143+ _lineStartBufferIndex = 0 ;
144+ _lineStartBufferPosition = 0 ;
143145 }
144146
145147 /// <inheritdoc />
You can’t perform that action at this time.
0 commit comments