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
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
1925end
Original file line number Diff line number Diff 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
2519end
You can’t perform that action at this time.
0 commit comments