File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ defmodule Handle0Test do
2+
3+ use ExUnit.Case , async: true
4+
5+ import Tds.TestHelper
6+
7+ alias Tds
8+
9+ @ tag timeout: 50000
10+ @ table "foo"
11+
12+ setup do
13+ opts = Application . fetch_env! ( :tds , :opts )
14+ { :ok , pid } = Tds . start_link ( opts )
15+
16+ { :ok , [ pid: pid ] }
17+ end
18+
19+ test "Could not find prepared statement with handle 0." , % { pid: pid } = context do
20+ query ( "DROP TABLE #{ @ table } " , [ ] )
21+
22+ query (
23+ """
24+ CREATE TABLE #{ @ table } (
25+ [id] int identity(1,1) not null primary key
26+ )
27+ """ ,
28+ [ ]
29+ )
30+
31+ n = 300
32+ for i <- 1 .. n do
33+ result =
34+ Tds . query ( pid , "SELECT * FROM #{ @ table } WHERE id = @id" , [
35+ % Tds.Parameter { name: "@id" , value: "7" , type: :int }
36+ ] )
37+
38+ assert { i , { :ok , _ } } = { i , result }
39+ end
40+
41+ query ( "DROP TABLE #{ @ table } " , [ ] )
42+ end
43+ end
You can’t perform that action at this time.
0 commit comments