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 c180233 commit 04d6464
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions integration_test/myxql/prepare_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,23 @@ defmodule Ecto.Integration.PrepareTest do
assert %{rows: [[_, orig_count]]} = TestRepo.query!(stmt_count_query, [])
orig_count = String.to_integer(orig_count)

query = from p in Post, select: fragment("'mxql test prepare option'")

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

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

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

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

0 comments on commit 04d6464

Please sign in to comment.