File tree 3 files changed +14
-4
lines changed
3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,8 @@ impl ForeignDataWrapper<MssqlFdwError> for MssqlFdw {
192
192
self . table = require_option ( "table" , options) ?. to_string ( ) ;
193
193
self . tgt_cols = columns. to_vec ( ) ;
194
194
195
+ self . iter_idx = 0 ;
196
+
195
197
// create sql server client
196
198
let tcp = self
197
199
. rt
Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ impl RedisFdw {
74
74
const FDW_NAME : & ' static str = "RedisFdw" ;
75
75
const BUF_SIZE : isize = 256 ;
76
76
77
+ fn reset ( & mut self ) {
78
+ self . iter_idx = 0 ;
79
+ self . scan_result . clear ( ) ;
80
+ self . iter_idx_stream = "-" . to_string ( ) ;
81
+ self . scan_result_stream . clear ( ) ;
82
+ }
83
+
77
84
// fetch a target row for list and zset
78
85
fn fetch_row_list ( & mut self ) -> RedisFdwResult < Option < Row > > {
79
86
if let Some ( ref mut conn) = & mut self . conn {
@@ -271,6 +278,8 @@ impl ForeignDataWrapper<RedisFdwError> for RedisFdw {
271
278
272
279
let mut conn = self . client . get_connection ( ) ?;
273
280
281
+ self . reset ( ) ;
282
+
274
283
match src_type. as_str ( ) {
275
284
"list" | "zset" => {
276
285
check_target_columns (
@@ -366,10 +375,7 @@ impl ForeignDataWrapper<RedisFdwError> for RedisFdw {
366
375
}
367
376
368
377
fn re_scan ( & mut self ) -> RedisFdwResult < ( ) > {
369
- self . iter_idx = 0 ;
370
- self . scan_result . clear ( ) ;
371
- self . iter_idx_stream = "-" . to_string ( ) ;
372
- self . scan_result_stream . clear ( ) ;
378
+ self . reset ( ) ;
373
379
Ok ( ( ) )
374
380
}
375
381
Original file line number Diff line number Diff line change @@ -660,6 +660,8 @@ impl ForeignDataWrapper<StripeFdwError> for StripeFdw {
660
660
) -> StripeFdwResult < ( ) > {
661
661
let obj = require_option ( "object" , options) ?;
662
662
663
+ self . iter_idx = 0 ;
664
+
663
665
if let Some ( client) = & self . client {
664
666
let page_size = 100 ; // maximum page size limit for Stripe API
665
667
let page_cnt = if let Some ( limit) = limit {
You can’t perform that action at this time.
0 commit comments