File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ impl StmtKind {
139
139
) )
140
140
}
141
141
Cmd :: Stmt ( Stmt :: Detach ( _) ) => Some ( Self :: Detach ) ,
142
+ Cmd :: Stmt ( Stmt :: Reindex { .. } ) => Some ( Self :: Write ) ,
142
143
_ => None ,
143
144
}
144
145
}
Original file line number Diff line number Diff line change @@ -355,3 +355,27 @@ fn stream() {
355
355
356
356
sim. run ( ) . unwrap ( ) ;
357
357
}
358
+
359
+ #[ test]
360
+ fn reindex_statement ( ) {
361
+ let mut sim = turmoil:: Builder :: new ( )
362
+ . simulation_duration ( Duration :: from_secs ( 1000 ) )
363
+ . build ( ) ;
364
+ sim. host ( "primary" , super :: make_standalone_server) ;
365
+ sim. client ( "client" , async {
366
+ let db = Database :: open_remote_with_connector ( "http://primary:8080" , "" , TurmoilConnector ) ?;
367
+ let conn = db. connect ( ) ?;
368
+
369
+ conn. execute ( "create table t(x text)" , ( ) ) . await ?;
370
+ conn. execute ( "create index t_idx on t(x)" , ( ) ) . await ?;
371
+ conn. execute ( "insert into t(x) values(?)" , params ! [ "hello" ] )
372
+ . await ?;
373
+ conn. execute ( "insert into t(x) values(?)" , params ! [ "hello" ] )
374
+ . await ?;
375
+ conn. execute ( "reindex t_idx" , ( ) ) . await ?;
376
+
377
+ Ok ( ( ) )
378
+ } ) ;
379
+
380
+ sim. run ( ) . unwrap ( ) ;
381
+ }
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ impl StmtKind {
120
120
} ) => Some ( Self :: Release ) ,
121
121
Cmd :: Stmt ( Stmt :: Attach { .. } ) => Some ( Self :: Attach ) ,
122
122
Cmd :: Stmt ( Stmt :: Detach ( _) ) => Some ( Self :: Detach ) ,
123
+ Cmd :: Stmt ( Stmt :: Reindex { .. } ) => Some ( Self :: Write ) ,
123
124
_ => None ,
124
125
}
125
126
}
You can’t perform that action at this time.
0 commit comments