tiny_tds 2.1.4 → 2.1.5

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
  SHA256:
3
- metadata.gz: b1b3c5584f282850876f00b66df7ffda7c42bcb32ad89f8c74ebe4aa116567d9
4
- data.tar.gz: 3d99f342d5964ee82580ce424fe7ac3be3b6128a247ae8e10bbb9463c57203ce
3
+ metadata.gz: 68f96f7fe4be98e8165b7a9716e116dc3989a42511e0d9a5115bcf8e69fe6582
4
+ data.tar.gz: 96cbb636206ff15c987dba8759abe644e62168ed9afa5286acf57b18b95bf6ce
5
5
  SHA512:
6
- metadata.gz: 1eabe9f662404dd47f3e1faac8cc9ffcad7c32b890e73154e7478f0f84f0a7cecf312e21d44fce7e1988db2a8d54ca24eed53109d60489abd04e0f1dfd8cbf63
7
- data.tar.gz: bc7cc00ff8f3d36a066d0d6f2087454a9e2918a0d0439a846b08c34b58eb274b72afa3cc2940a5842a9fd802d6c51e0d8332efa13786fbd45b397d5a954bef98
6
+ metadata.gz: 8679ca4bc997fab7528f8ec2bce4f754b92319835157d08c017a20cf6561bae6638da077300cdd361302935b384a1b5ec00c05e014e7c12700e31bc5fd160d06
7
+ data.tar.gz: d35162380fec76c36ddff7f2407a1715105aa264be7c18ee2b078acfab6aab9a22a24854e815c9da389c295a4d6348668900752623f49fa222d31fd6e5b647a7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## (unreleased)
2
2
 
3
+ ## 2.1.5
4
+
5
+ * Fix compilation errors for Amazon Linux 1. Fixes #495.
6
+ * Fix segfault for login timeouts
7
+
3
8
  ## 2.1.4
4
9
 
5
10
  * Improve handling of network related timeouts
@@ -267,4 +272,3 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
267
272
 
268
273
 
269
274
  ## 0.1.0 Initial release!
270
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.4
1
+ 2.1.5
@@ -96,13 +96,14 @@ int tinytds_err_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, c
96
96
  but we don't ever want to automatically retry. Instead have the app
97
97
  decide what to do.
98
98
  */
99
- if (userdata->timing_out) {
99
+ if (userdata && userdata->timing_out) {
100
100
  return INT_CANCEL;
101
101
  }
102
- else {
102
+ // userdata will not be set if hitting timeout during login so check for it first
103
+ if (userdata) {
103
104
  userdata->timing_out = 1;
104
- return_value = INT_TIMEOUT;
105
105
  }
106
+ return_value = INT_TIMEOUT;
106
107
  cancel = 1;
107
108
  break;
108
109
 
@@ -99,12 +99,14 @@ static void nogvl_cleanup(DBPROCESS *client) {
99
99
  Now that the blocking operation is done, we can finally throw any
100
100
  exceptions based on errors from SQL Server.
101
101
  */
102
- for (short int i = 0; i < userdata->nonblocking_errors_length; i++) {
102
+ short int i;
103
+ for (i = 0; i < userdata->nonblocking_errors_length; i++) {
103
104
  tinytds_errordata error = userdata->nonblocking_errors[i];
104
105
 
105
106
  // lookahead to drain any info messages ahead of raising error
106
107
  if (!error.is_message) {
107
- for (short int j = i; j < userdata->nonblocking_errors_length; j++) {
108
+ short int j;
109
+ for (j = i; j < userdata->nonblocking_errors_length; j++) {
108
110
  tinytds_errordata msg_error = userdata->nonblocking_errors[j];
109
111
  if (msg_error.is_message) {
110
112
  rb_tinytds_raise_error(client, msg_error);
data/test/client_test.rb CHANGED
@@ -176,6 +176,24 @@ class ClientTest < TinyTds::TestCase
176
176
  end
177
177
  end
178
178
 
179
+ it 'raises TinyTds exception with login timeout' do
180
+ skip if ENV['CI'] && ENV['APPVEYOR_BUILD_FOLDER'] # only CI using docker
181
+ begin
182
+ action = lambda do
183
+ Toxiproxy[:sqlserver_test].toxic(:timeout, timeout: 0).apply do
184
+ new_connection login_timeout: 1, port: 1234
185
+ end
186
+ end
187
+ assert_raise_tinytds_error(action) do |e|
188
+ assert_equal 20003, e.db_error_number
189
+ assert_equal 6, e.severity
190
+ assert_match %r{timed out}i, e.message, 'ignore if non-english test run'
191
+ end
192
+ ensure
193
+ assert_new_connections_work
194
+ end
195
+ end
196
+
179
197
  it 'raises TinyTds exception with wrong :username' do
180
198
  skip if ENV['CI'] && sqlserver_azure? # Some issue with db_error_number.
181
199
  options = connection_options :username => 'willnotwork'
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: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
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: 2021-05-10 00:00:00.000000000 Z
13
+ date: 2021-05-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mini_portile2