tiny_tds 2.1.4-x64-mingw32 → 2.1.5-x64-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: eee18a4258c6cb84405f71e6fb6fe00cd3d7f86f3c00fa717ddacfed641167e1
4
- data.tar.gz: a720ff2ad40d530328ab2a967da61d52c95ceb256e63b53cd50306fd488cb614
3
+ metadata.gz: 67f523a732b6d4b9e39320e3331465de0f566cddec1049460c9b2bbb1d5fc8c8
4
+ data.tar.gz: f411a519c17e3a4ff53c187f84018ef3d0ebe516aaae2778ce18ef8fc6c21016
5
5
  SHA512:
6
- metadata.gz: 7edcb9e4dac57369d255b4a4da54df7158918546cfb540a62874453e7350873e6fd52254862dc0d7240278ca0da6d61f363cfb15ba7f4f47be3ed51fb3822ac2
7
- data.tar.gz: 93c906a62b51cbd9a10762a5420335a27202cbc5dfe7be2e40be2e45c9dfc6788b138fc60c4592f07588812cf9c2e57ea99fb628189757c12a04ec08225bd34a
6
+ metadata.gz: 46a60fddcfff07dbe8b7fe4c0a1aaf1520b9bcbeff5759dbcdade07b22b15cdf118fd8cf515f4750729c3e785a5d9a9fa7a463971a0b8229bfc030e1cea02650
7
+ data.tar.gz: 27cffc6e51817b4d8d828079f7495ad8c4b683fe272246aab792a48547866e7e183d9d3f1d14c85a3bfadf9ebea4fb8be8542e94c8518836ce3054a1a73b34d9
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: x64-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