tiny_tds 2.1.4-x86-mingw32 → 2.1.5-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
  SHA256:
3
- metadata.gz: f4636977a24bb1b48ae9f88cbe8741896c2318accb69f818fd7de9482bf3e127
4
- data.tar.gz: 05c26b702b0ee94899c26f6c30e9f73335ce83d4228e81ed168037d9a5616d47
3
+ metadata.gz: a47a0b05f22db6ade59742f5111b85e537aa9fcda26279b602a3b03c76786d5f
4
+ data.tar.gz: fc0ae0fc2e50983fc90a58e125704a67841d3c80be0c2701d468d79782e66e88
5
5
  SHA512:
6
- metadata.gz: 9276796af730b23fbdeac517e9529b1079d0fb607d810ae15fdb78e88f58277b8a4e23bda85915cddbf22003d0ea837be37d286a09f404294507058f15965231
7
- data.tar.gz: dce67a8b59d159c5752e95620556b6d5384d798338fde8b684753228d7d237136e7a4f33517d972985880bda395b6f046a7116bd9c107a382480ada19d05f868
6
+ metadata.gz: ea1ddb037b387609c7f70b7e7d8b597b9770d8023e5d3a53a0a8c933a237e165bb3df8845e0fbbdcb4048d7bd8569f9ea0a4613ddcb1d6cb911cbda05aa526a0
7
+ data.tar.gz: 72bc298c4ec1ee0de52d4b57a73c4af541dff9c87223cae96e5cdf23de0c923e8b136f3df175291c823ef6bb8e081d5c8023942bed59b636ef0dd3ebbab50917
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: 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: 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