tiny_tds 0.9.5.beta.11-x86-mingw32 → 0.9.5.beta.12-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13457f00e3296a5ecf825d62a2058ec6c2b049b9
4
- data.tar.gz: b157daa2f311358383b566ce6b4b094fc8043e2a
3
+ metadata.gz: d24a535649389b45f7c264ef99a075123e47e642
4
+ data.tar.gz: 3943b0d4a5c71b92b79346d4f4f975987acdb399
5
5
  SHA512:
6
- metadata.gz: 3127e52a425e75990f0acf3f1c6ac690abdbfd2a749c54a32809d78574c81cfdde60f3cb905ffeb8d6776ddc6ce7de7820f4d8ccf75a4f41aeb33ab8038f657d
7
- data.tar.gz: 41f723a2e11cac417010fcdfb02596297658c5af96839fd413fa7991d3c191645801dbd6399c540ebf5890852f376dffd68fb6141f43f434da69cd4b9d419fb0
6
+ metadata.gz: cf1f467cc8503fafe7b87afc208710700d6e3f12b879b92a05e766fd56872e2af47cdcad6e600b172ec3b3368414192227959692fbd4cd96019bd2a583c9a123
7
+ data.tar.gz: 625e006e846bf15794b5b4b0873ce5ae4d8cf984f3c690a4e34c92a2e8af9e9dc15afd96e311c881eb4b13403f21d9e224eae292a03f7a4c1904aeb392ad9aee
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5.beta.11
1
+ 0.9.5.beta.12
data/appveyor.yml CHANGED
@@ -40,11 +40,11 @@ test_script:
40
40
  - bundle exec rake TINYTDS_UNIT_HOST_TEST=%CI_AZURE_HOST% TINYTDS_UNIT_HOST=%CI_AZURE_HOST% TINYTDS_SCHEMA=sqlserver_azure TDSVER=7.3
41
41
  environment:
42
42
  CI_AZURE_HOST:
43
- secure: b7kG0e0O6hPi/7niF3YTGih1WtdO/dmuyg0k+Le+zEE=
43
+ secure: Qkf6IJGISn6/WK9Feu71wLLQx7g0RMNfjj/YwNE+zJE=
44
44
  TINYTDS_UNIT_AZURE_USER:
45
- secure: Clk9RCYMZ0vz0IfMMnOtJW/ufcCKW3nQC3BgCipdM+c=
45
+ secure: a/9Rph59mNJMObcpJ7mrimqZ+pOth8NLY9iiroFUob4=
46
46
  TINYTDS_UNIT_AZURE_PASS:
47
- secure: D3vsNNzv/Th+RqMNrm3WJw==
47
+ secure: fYKSKV4v+36OFQp2nZdX4DfUpgmy5cm0wuR73cgdmEk=
48
48
  matrix:
49
49
  - ruby_version: "200"
50
50
  - ruby_version: "22"
data/exe/defncopy.exe CHANGED
Binary file
data/exe/tsql.exe CHANGED
Binary file
Binary file
Binary file
Binary file
@@ -64,9 +64,12 @@ module TinyTds
64
64
  end
65
65
 
66
66
  def parse_username(opts)
67
+ host = opts[:host]
67
68
  username = opts[:username]
68
- return username if username.nil? || !opts[:azure] || !username.include?("@")
69
+ return username if username.nil? || !opts[:azure]
70
+ return username if username.include?("@") && !username.include?("database.windows.net")
69
71
  user, domain = username.split("@")
72
+ domain ||= host
70
73
  "#{user}@#{domain.split('.').first}"
71
74
  end
72
75
 
data/test/client_test.rb CHANGED
@@ -151,15 +151,9 @@ class ClientTest < TinyTds::TestCase
151
151
  options = connection_options :username => 'willnotwork'
152
152
  action = lambda { new_connection(options) }
153
153
  assert_raise_tinytds_error(action) do |e|
154
- if sqlserver_azure?
155
- assert_equal 40532, e.db_error_number
156
- assert_equal 20, e.severity
157
- assert_match %r{login failed}i, e.message, 'ignore if non-english test run'
158
- else
159
- assert_equal sybase_ase? ? 4002 : 18456, e.db_error_number
160
- assert_equal 14, e.severity
161
- assert_match %r{login failed}i, e.message, 'ignore if non-english test run'
162
- end
154
+ assert_equal sybase_ase? ? 4002 : 18456, e.db_error_number
155
+ assert_equal 14, e.severity
156
+ assert_match %r{login failed}i, e.message, 'ignore if non-english test run'
163
157
  end
164
158
  assert_new_connections_work
165
159
  end
@@ -171,18 +165,48 @@ class ClientTest < TinyTds::TestCase
171
165
  let(:client) { @client = new_connection }
172
166
 
173
167
  it '#parse_username returns username if azure is not true' do
174
- username = 'user@long.domain.name.com'
168
+ username = 'user@abc123.database.windows.net'
175
169
  client.send(:parse_username, username: username).must_equal username
176
170
  end
177
171
 
178
172
  it '#parse_username returns short username if azure is true' do
179
- username = 'user@long.domain.name.com'
180
- client.send(:parse_username, username: username, azure: true).must_equal 'user@long'
173
+ client.send(:parse_username,
174
+ username: 'user@abc123.database.windows.net',
175
+ host: 'abc123.database.windows.net',
176
+ azure: true
177
+ ).must_equal 'user@abc123'
178
+ end
179
+
180
+ it '#parse_username returns full username if azure is false' do
181
+ client.send(:parse_username,
182
+ username: 'user@abc123.database.windows.net',
183
+ host: 'abc123.database.windows.net',
184
+ azure: false
185
+ ).must_equal 'user@abc123.database.windows.net'
181
186
  end
182
187
 
183
188
  it '#parse_username returns short username if passed and azure is true' do
184
- username = 'user@short'
185
- client.send(:parse_username, username: username, azure: true).must_equal 'user@short'
189
+ client.send(:parse_username,
190
+ username: 'user@abc123',
191
+ host: 'abc123.database.windows.net',
192
+ azure: true
193
+ ).must_equal 'user@abc123'
194
+ end
195
+
196
+ it '#parse_username returns username with servername if passed and azure is true' do
197
+ client.send(:parse_username,
198
+ username: 'user',
199
+ host: 'abc123.database.windows.net',
200
+ azure: true
201
+ ).must_equal 'user@abc123'
202
+ end
203
+
204
+ it '#parse_username returns username with servername if passed and azure is false' do
205
+ client.send(:parse_username,
206
+ username: 'user',
207
+ host: 'abc123.database.windows.net',
208
+ azure: false
209
+ ).must_equal 'user'
186
210
  end
187
211
 
188
212
  end
data/test/test_helper.rb CHANGED
@@ -89,7 +89,7 @@ module TinyTds
89
89
  end
90
90
 
91
91
  def connection_timeout
92
- sqlserver_azure? ? 15 : 5
92
+ sqlserver_azure? ? 20 : 5
93
93
  end
94
94
 
95
95
  def assert_client_works(client)
data/test/thread_test.rb CHANGED
@@ -41,6 +41,7 @@ class ThreadTest < TinyTds::TestCase
41
41
  end
42
42
 
43
43
  it 'should not crash on error in parallel' do
44
+ skip if sqlserver_azure?
44
45
  threads = []
45
46
  @numthreads.times do |i|
46
47
  threads << Thread.new do
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.9.5.beta.11
4
+ version: 0.9.5.beta.12
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Ken Collins
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-16 00:00:00.000000000 Z
13
+ date: 2016-01-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mini_portile2