Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski committed Jan 3, 2025
1 parent b329d48 commit c180233
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions integration_test/myxql/prepare_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@ defmodule Ecto.Integration.PrepareTest do

stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"
assert %{rows: [[_, orig_count]]} = TestRepo.query!(stmt_count_query, [])
orig_count = String.to_integer(orig_count)

# Uncached
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
%{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
assert new_count == orig_count
assert String.to_integer(new_count) == orig_count
assert TestRepo.all(Post, prepare: :named) == [one, two]
assert %{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
assert new_count == orig_count + 1
assert String.to_integer(new_count) == orig_count + 1

# Cached
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
assert %{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
assert new_count == orig_count + 1
assert String.to_integer(new_count) == orig_count + 1
assert TestRepo.all(Post, prepare: :named) == [one, two]
assert %{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
assert new_count == orig_count + 1
assert String.to_integer(new_count) == orig_count + 1
end
end

0 comments on commit c180233

Please sign in to comment.