File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -386,14 +386,14 @@ impl QueryRouter {
386386 }
387387 }
388388
389- /// Determines if a query is mutable or not.
390- fn query_is_mutable_statement ( q : & sqlparser:: ast:: Query ) -> bool {
389+ /// Determines if a query is a mutation or not.
390+ fn is_mutation_query ( q : & sqlparser:: ast:: Query ) -> bool {
391391 use sqlparser:: ast:: * ;
392392
393393 match q. body . as_ref ( ) {
394394 SetExpr :: Insert ( _) => true ,
395395 SetExpr :: Update ( _) => true ,
396- SetExpr :: Query ( q) => Self :: query_is_mutable_statement ( q) ,
396+ SetExpr :: Query ( q) => Self :: is_mutation_query ( q) ,
397397 _ => false ,
398398 }
399399 }
@@ -440,9 +440,9 @@ impl QueryRouter {
440440 } ;
441441
442442 let has_locks = !query. locks . is_empty ( ) ;
443- let is_mutable_statement = Self :: query_is_mutable_statement ( query) ;
443+ let has_mutation = Self :: is_mutation_query ( query) ;
444444
445- if has_locks || is_mutable_statement {
445+ if has_locks || has_mutation {
446446 self . active_role = Some ( Role :: Primary ) ;
447447 } else if !visited_write_statement {
448448 // If we already visited a write statement, we should be going to the primary.
You can’t perform that action at this time.
0 commit comments