tiny_tds 0.7.0-x64-mingw32 → 0.9.5.beta.1-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_helper.rb CHANGED
@@ -26,9 +26,7 @@ module TinyTds
26
26
 
27
27
  end
28
28
 
29
- after do
30
- @client.close if defined?(@client) && @client.is_a?(TinyTds::Client)
31
- end
29
+ after { close_client }
32
30
 
33
31
  protected
34
32
 
@@ -46,6 +44,10 @@ module TinyTds
46
44
  self.class.sqlserver?
47
45
  end
48
46
 
47
+ def close_client(client=@client)
48
+ client.close if defined?(client) && client.is_a?(TinyTds::Client)
49
+ end
50
+
49
51
  def new_connection(options={})
50
52
  client = TinyTds::Client.new(connection_options(options))
51
53
  if sybase_ase?
@@ -97,17 +99,21 @@ module TinyTds
97
99
  def assert_new_connections_work
98
100
  client = new_connection
99
101
  client.execute("SELECT 'new_connections_work' as [new_connections_work]").each
102
+ client.close
100
103
  end
101
104
 
102
105
  def assert_raise_tinytds_error(action)
106
+ result = nil
103
107
  error_raised = false
104
108
  begin
105
- action.call
109
+ result = action.call
106
110
  rescue TinyTds::Error => e
107
111
  error_raised = true
108
112
  end
109
113
  assert error_raised, 'expected a TinyTds::Error but none happened'
110
114
  yield e
115
+ ensure
116
+ close_client(result)
111
117
  end
112
118
 
113
119
  def inspect_tinytds_exception
@@ -136,9 +142,9 @@ module TinyTds
136
142
  loader = new_connection
137
143
  schema_file = File.expand_path File.join(File.dirname(__FILE__), 'schema', "#{current_schema}.sql")
138
144
  schema_sql = File.open(schema_file,"rb:UTF-8") { |f|f.read }
139
- loader.execute(drop_sql).each
140
- loader.execute(schema_sql).cancel
141
- loader.execute(sp_sql).cancel
145
+ loader.execute(drop_sql).do
146
+ loader.execute(schema_sql).do
147
+ loader.execute(sp_sql).do
142
148
  loader.close
143
149
  true
144
150
  end
@@ -198,7 +204,6 @@ module TinyTds
198
204
  client.execute("ROLLBACK TRANSACTION").do
199
205
  end
200
206
 
201
-
202
207
  end
203
208
  end
204
209
 
data/test/thread_test.rb CHANGED
@@ -15,17 +15,19 @@ class ThreadTest < TinyTds::TestCase
15
15
  @pool = ConnectionPool.new(:size => @poolsize, :timeout => 5) { new_connection }
16
16
  end
17
17
 
18
+ after do
19
+ @pool.shutdown { |c| c.close }
20
+ end
21
+
18
22
  it 'should finish faster in parallel' do
23
+ skip if sqlserver_azure?
19
24
  x = Benchmark.realtime do
20
25
  threads = []
21
26
  @numthreads.times do |i|
22
27
  start = Time.new
23
28
  threads << Thread.new do
24
29
  ts = Time.new
25
- @pool.with do |client|
26
- result = client.execute @query
27
- result.each { |r| puts r }
28
- end
30
+ @pool.with { |c| c.execute(@query).do }
29
31
  te = Time.new
30
32
  @logger.info "Thread #{i} finished in #{te - ts} thread seconds, #{te - start} real seconds"
31
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_tds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.5.beta.1
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Ken Collins
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-08-09 00:00:00.000000000 Z
13
+ date: 2015-12-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: mini_portile
16
+ name: mini_portile2
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - '='
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 0.6.2
21
+ version: '2.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - '='
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 0.6.2
28
+ version: '2.0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +101,8 @@ description: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using
101
101
  email:
102
102
  - ken@metaskills.net
103
103
  - will@wbond.net
104
- executables: []
104
+ executables:
105
+ - tsql
105
106
  extensions: []
106
107
  extra_rdoc_files: []
107
108
  files:
@@ -112,10 +113,14 @@ files:
112
113
  - MIT-LICENSE
113
114
  - README.md
114
115
  - Rakefile
116
+ - VERSION
115
117
  - appveyor.yml
118
+ - bin/tsql
119
+ - exe/.keep
116
120
  - ext/tiny_tds/client.c
117
121
  - ext/tiny_tds/client.h
118
122
  - ext/tiny_tds/extconf.rb
123
+ - ext/tiny_tds/extconsts.rb
119
124
  - ext/tiny_tds/result.c
120
125
  - ext/tiny_tds/result.h
121
126
  - ext/tiny_tds/tiny_tds_ext.c
@@ -128,12 +133,13 @@ files:
128
133
  - lib/tiny_tds/error.rb
129
134
  - lib/tiny_tds/result.rb
130
135
  - lib/tiny_tds/version.rb
131
- - ports/patches/freetds/0.91/Makefile.in.diff
132
- - ports/patches/freetds/0.91/dblib-30-char-username.diff
133
- - ports/x86_64-w64-mingw32/bin/libeay32-1.0.2d-x86_64-w64-mingw32.dll
136
+ - ports/patches/freetds/0.91.112/Makefile.in.diff
137
+ - ports/patches/freetds/0.91.112/dblib-30-char-username.diff
138
+ - ports/patches/freetds/0.95.75/0001-mingw_missing_inet_pton.diff
139
+ - ports/x86_64-w64-mingw32/bin/libeay32-1.0.2e-x86_64-w64-mingw32.dll
134
140
  - ports/x86_64-w64-mingw32/bin/libiconv-2.dll
135
141
  - ports/x86_64-w64-mingw32/bin/libsybdb-5.dll
136
- - ports/x86_64-w64-mingw32/bin/ssleay32-1.0.2d-x86_64-w64-mingw32.dll
142
+ - ports/x86_64-w64-mingw32/bin/ssleay32-1.0.2e-x86_64-w64-mingw32.dll
137
143
  - test/appveyor/dbsetup.ps1
138
144
  - test/appveyor/dbsetup.sql
139
145
  - test/benchmark/query.rb
@@ -164,12 +170,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
170
  requirements:
165
171
  - - ">="
166
172
  - !ruby/object:Gem::Version
167
- version: '0'
173
+ version: 2.0.0
168
174
  required_rubygems_version: !ruby/object:Gem::Requirement
169
175
  requirements:
170
- - - ">="
176
+ - - ">"
171
177
  - !ruby/object:Gem::Version
172
- version: '0'
178
+ version: 1.3.1
173
179
  requirements: []
174
180
  rubyforge_project:
175
181
  rubygems_version: 2.4.8