Skip to content

Commit c27d801

Browse files
authored
Rename a couple of variables (#839)
1 parent 186e722 commit c27d801

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/query_router.rs

+5-5
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)