Skip to content

Commit 04d6464

Browse files
oops
1 parent c180233 commit 04d6464

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

integration_test/myxql/prepare_test.exs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@ defmodule Ecto.Integration.PrepareTest do
1212
assert %{rows: [[_, orig_count]]} = TestRepo.query!(stmt_count_query, [])
1313
orig_count = String.to_integer(orig_count)
1414

15+
query = from p in Post, select: fragment("'mxql test prepare option'")
16+
1517
# Uncached
16-
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
18+
assert TestRepo.all(query, prepare: :unnamed) == [one, two]
1719
%{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
1820
assert String.to_integer(new_count) == orig_count
19-
assert TestRepo.all(Post, prepare: :named) == [one, two]
21+
22+
assert TestRepo.all(query, prepare: :named) == [one, two]
2023
assert %{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
2124
assert String.to_integer(new_count) == orig_count + 1
2225

2326
# Cached
24-
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
27+
assert TestRepo.all(query, prepare: :unnamed) == [one, two]
2528
assert %{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
2629
assert String.to_integer(new_count) == orig_count + 1
27-
assert TestRepo.all(Post, prepare: :named) == [one, two]
30+
31+
assert TestRepo.all(query, prepare: :named) == [one, two]
2832
assert %{rows: [[_, new_count]]} = TestRepo.query!(stmt_count_query, [])
2933
assert String.to_integer(new_count) == orig_count + 1
3034
end

0 commit comments

Comments
 (0)