File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,18 @@ defmodule Ecto.Integration.PrepareTest do
8
8
one = TestRepo . insert! ( % Post { title: "one" } )
9
9
two = TestRepo . insert! ( % Post { title: "two" } )
10
10
11
+ stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"
12
+
11
13
# Uncached
12
14
assert TestRepo . all ( Post , prepare: :unnamed ) == [ one , two ]
15
+ assert % { rows: [ [ 0 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
13
16
assert TestRepo . all ( Post , prepare: :named ) == [ one , two ]
17
+ assert % { rows: [ [ 1 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
14
18
15
19
# Cached
16
20
assert TestRepo . all ( Post , prepare: :unnamed ) == [ one , two ]
21
+ assert % { rows: [ [ 1 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
17
22
assert TestRepo . all ( Post , prepare: :named ) == [ one , two ]
23
+ assert % { rows: [ [ 1 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
18
24
end
19
25
end
Original file line number Diff line number Diff line change @@ -8,18 +8,12 @@ defmodule Ecto.Integration.PrepareTest do
8
8
one = TestRepo . insert! ( % Post { title: "one" } )
9
9
two = TestRepo . insert! ( % Post { title: "two" } )
10
10
11
- stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"
12
-
13
11
# Uncached
14
12
assert TestRepo . all ( Post , prepare: :unnamed ) == [ one , two ]
15
- assert % { rows: [ [ 0 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
16
13
assert TestRepo . all ( Post , prepare: :named ) == [ one , two ]
17
- assert % { rows: [ [ 1 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
18
14
19
15
# Cached
20
16
assert TestRepo . all ( Post , prepare: :unnamed ) == [ one , two ]
21
- assert % { rows: [ [ 1 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
22
17
assert TestRepo . all ( Post , prepare: :named ) == [ one , two ]
23
- assert % { rows: [ [ 1 ] ] } = TestRepo . query ( stmt_count_query , [ ] )
24
18
end
25
19
end
You can’t perform that action at this time.
0 commit comments