Skip to content

Commit ec3472a

Browse files
oops
1 parent 930582b commit ec3472a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

integration_test/myxql/prepare_test.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ defmodule Ecto.Integration.PrepareTest do
88
one = TestRepo.insert!(%Post{title: "one"})
99
two = TestRepo.insert!(%Post{title: "two"})
1010

11+
stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"
12+
1113
# Uncached
1214
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
15+
assert %{rows: [[0]]} = TestRepo.query(stmt_count_query, [])
1316
assert TestRepo.all(Post, prepare: :named) == [one, two]
17+
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
1418

1519
# Cached
1620
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
21+
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
1722
assert TestRepo.all(Post, prepare: :named) == [one, two]
23+
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
1824
end
1925
end

integration_test/pg/prepare_test.exs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ defmodule Ecto.Integration.PrepareTest do
88
one = TestRepo.insert!(%Post{title: "one"})
99
two = TestRepo.insert!(%Post{title: "two"})
1010

11-
stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"
12-
1311
# Uncached
1412
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
15-
assert %{rows: [[0]]} = TestRepo.query(stmt_count_query, [])
1613
assert TestRepo.all(Post, prepare: :named) == [one, two]
17-
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
1814

1915
# Cached
2016
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
21-
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
2217
assert TestRepo.all(Post, prepare: :named) == [one, two]
23-
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
2418
end
2519
end

0 commit comments

Comments
 (0)