File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
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
You can’t perform that action at this time.
0 commit comments