Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwater committed May 12, 2021
1 parent 80d02d2 commit e276f72
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sqlx-core/src/sqlite/connection/explain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,26 @@ pub(super) async fn explain(

let mut program_i = 0;
let program_size = program.len();
let mut visited = vec![false; program_size];

while program_i < program_size {
if visited[program_i] {
program_i += 1;
continue;
}
let (_, ref opcode, p1, p2, p3, ref p4) = program[program_i];

match &**opcode {
OP_INIT => {
// start at <p2>
visited[program_i] = true;
program_i = p2 as usize;
continue;
}

OP_GOTO => {
// goto <p2>
visited[program_i] = true;
program_i = p2 as usize;
continue;
}
Expand Down Expand Up @@ -230,6 +237,7 @@ pub(super) async fn explain(
}
}

visited[program_i] = true;
program_i += 1;
}

Expand Down

0 comments on commit e276f72

Please sign in to comment.