Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski committed Jan 2, 2025
1 parent 930582b commit ec3472a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions integration_test/myxql/prepare_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ defmodule Ecto.Integration.PrepareTest do
one = TestRepo.insert!(%Post{title: "one"})
two = TestRepo.insert!(%Post{title: "two"})

stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"

# Uncached
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
assert %{rows: [[0]]} = TestRepo.query(stmt_count_query, [])
assert TestRepo.all(Post, prepare: :named) == [one, two]
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])

# Cached
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
assert TestRepo.all(Post, prepare: :named) == [one, two]
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
end
end
6 changes: 0 additions & 6 deletions integration_test/pg/prepare_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ defmodule Ecto.Integration.PrepareTest do
one = TestRepo.insert!(%Post{title: "one"})
two = TestRepo.insert!(%Post{title: "two"})

stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"

# Uncached
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
assert %{rows: [[0]]} = TestRepo.query(stmt_count_query, [])
assert TestRepo.all(Post, prepare: :named) == [one, two]
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])

# Cached
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
assert TestRepo.all(Post, prepare: :named) == [one, two]
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
end
end

0 comments on commit ec3472a

Please sign in to comment.