tiny_tds 3.3.0-x86_64-linux-gnu → 3.4.1-x86_64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 824abea6555e6409ea68831ee528c911077da3f94abb1850b160413103c53779
4
- data.tar.gz: a3de6f4460b6d76c0511f131278ede0a79e71ae4e9a52b7a86bd35ef820d137d
3
+ metadata.gz: 0fb974568785447c7f854ac2c096cd52d402379cffc2fd006968d2993d7f8325
4
+ data.tar.gz: d061b95f9d523afc4f4240167427f126fe95bd786a27d651245c19219a065985
5
5
  SHA512:
6
- metadata.gz: 2484d253bf0a1dc2b7bd78513f09d9e373e945462d693a5682af2b86c457b81e181567bbae9eb59c7a60aa5d73a179173fd5efc7a3e4243141f7e498334881f9
7
- data.tar.gz: 525420751fba06e0e155d091928f9d304a2502d21deba13f2fbf1271080cbb599fc068fdfc14afa005ca637c8e222d08c4ad85e1bed075c903fc78b185878410
6
+ metadata.gz: ed66f184d8894af0e2061a142e67f9dd3e9e3ae00bcc28af6b0112b6c838dcfa97d34a8caef801eb07fa494e9c8de17fe9f3fe422e01e8604fbed1b7bc0926bc
7
+ data.tar.gz: d1bb510afb9492a12be593372f0d45355abcdaa4c3c6891e14ea16b1730b504861b75690349db8ea9fe1db6f19f323c6a2aed3fd9c54237bfd87086d0b44b96e
@@ -60,7 +60,6 @@ jobs:
60
60
  fail-fast: false
61
61
  matrix:
62
62
  ruby-version:
63
- - "2.7"
64
63
  - "3.0"
65
64
 
66
65
  name: install-windows-mingw
@@ -112,7 +111,6 @@ jobs:
112
111
  - 2019
113
112
  - 2022
114
113
  ruby-version:
115
- - "2.7"
116
114
  - "3.0"
117
115
 
118
116
  name: test-windows-mingw
@@ -179,6 +177,7 @@ jobs:
179
177
  - "3.2"
180
178
  - "3.3"
181
179
  - "3.4"
180
+ - "4.0"
182
181
 
183
182
  name: install-windows-ucrt
184
183
  runs-on: windows-latest
@@ -233,6 +232,7 @@ jobs:
233
232
  - "3.2"
234
233
  - "3.3"
235
234
  - "3.4"
235
+ - "4.0"
236
236
 
237
237
  name: test-windows-ucrt
238
238
  runs-on: windows-latest
@@ -301,6 +301,7 @@ jobs:
301
301
  - "3.2"
302
302
  - "3.3"
303
303
  - "3.4"
304
+ - "4.0"
304
305
 
305
306
  name: install-windows-native
306
307
  runs-on: windows-latest
@@ -353,12 +354,12 @@ jobs:
353
354
  - "aarch64-linux-musl"
354
355
 
355
356
  ruby-version:
356
- - "2.7"
357
357
  - "3.0"
358
358
  - "3.1"
359
359
  - "3.2"
360
360
  - "3.3"
361
361
  - "3.4"
362
+ - "4.0"
362
363
 
363
364
  include:
364
365
  - platform: x86_64-linux-musl
@@ -414,12 +415,12 @@ jobs:
414
415
  - 2022
415
416
 
416
417
  ruby-version:
417
- - "2.7"
418
418
  - "3.0"
419
419
  - "3.1"
420
420
  - "3.2"
421
421
  - "3.3"
422
422
  - "3.4"
423
+ - "4.0"
423
424
 
424
425
  runs-on: ubuntu-22.04
425
426
  steps:
@@ -482,6 +483,7 @@ jobs:
482
483
  - "3.2"
483
484
  - "3.3"
484
485
  - "3.4"
486
+ - "4.0"
485
487
 
486
488
  name: install-linux-native
487
489
  runs-on: ubuntu-22.04
@@ -528,6 +530,7 @@ jobs:
528
530
  - "3.2"
529
531
  - "3.3"
530
532
  - "3.4"
533
+ - "4.0"
531
534
 
532
535
  name: install-macos-m1
533
536
  runs-on: macos-14
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ## (unreleased)
2
2
 
3
+ ## 3.4.1
4
+
5
+ * Register the C globals that hold Ruby classes and modules with the GC, so raising `TinyTds::Error` after GC compaction no longer crashes with a segmentation fault. Fixes #608.
6
+ * Use freetds v1.5.19 and OpenSSL v3.6.5 for Windows and Linux builds.
7
+
8
+ ## 3.4.0
9
+
10
+ * Add Ruby 4.0 to the cross compile list
11
+ * No longer ship a precompiled Gem for Ruby 2.7
12
+ * This is due to an [upstream change](https://github.com/rake-compiler/rake-compiler-dock/releases/tag/v1.11.0). Users on Windows and Linux on Ruby v2.7 are advised to either upgrade or install FreeTDS manually.
13
+ * Use freetds v1.5.10 and OpenSSL v3.6.0 for Windows and Linux builds.
14
+ * Lower `bigdecimal` requirement to `>= 2.0.0` (was 3.0 only) to allow `bigdecimal` 4.0 on Ruby 4.0. Closes #601.
15
+
3
16
  ## 3.3.0
4
17
 
5
18
  * Use freetds v1.5.4 and OpenSSL v3.5.2 for Windows and Linux builds.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.4.1
@@ -541,6 +541,7 @@ static VALUE rb_tinytds_connect(VALUE self, VALUE opts)
541
541
  void init_tinytds_client()
542
542
  {
543
543
  cTinyTdsClient = rb_define_class_under(mTinyTds, "Client", rb_cObject);
544
+ rb_global_variable(&cTinyTdsClient);
544
545
  rb_define_alloc_func(cTinyTdsClient, allocate);
545
546
  /* Define TinyTds::Client Public Methods */
546
547
  rb_define_method(cTinyTdsClient, "tds_version", rb_tinytds_tds_version, 0);
@@ -1,8 +1,8 @@
1
1
  ICONV_VERSION = ENV["TINYTDS_ICONV_VERSION"] || "1.18"
2
2
  ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz"
3
3
 
4
- OPENSSL_VERSION = ENV["TINYTDS_OPENSSL_VERSION"] || "3.5.2"
4
+ OPENSSL_VERSION = ENV["TINYTDS_OPENSSL_VERSION"] || "3.6.5"
5
5
  OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"
6
6
 
7
- FREETDS_VERSION = ENV["TINYTDS_FREETDS_VERSION"] || "1.5.4"
7
+ FREETDS_VERSION = ENV["TINYTDS_FREETDS_VERSION"] || "1.5.19"
8
8
  FREETDS_SOURCE_URI = "http://www.freetds.org/files/stable/freetds-#{FREETDS_VERSION}.tar.bz2"
@@ -702,9 +702,12 @@ void init_tinytds_result()
702
702
  {
703
703
  /* Data Classes */
704
704
  cKernel = rb_const_get(rb_cObject, rb_intern("Kernel"));
705
+ rb_global_variable(&cKernel);
705
706
  cDate = rb_const_get(rb_cObject, rb_intern("Date"));
707
+ rb_global_variable(&cDate);
706
708
  /* Define TinyTds::Result */
707
709
  cTinyTdsResult = rb_define_class_under(mTinyTds, "Result", rb_cObject);
710
+ rb_global_variable(&cTinyTdsResult);
708
711
  rb_undef_alloc_func(cTinyTdsResult);
709
712
  /* Define TinyTds::Result Public Methods */
710
713
  rb_define_method(cTinyTdsResult, "fields", rb_tinytds_result_fields, 0);
@@ -8,8 +8,10 @@ VALUE mTinyTds, cTinyTdsError;
8
8
 
9
9
  void Init_tiny_tds()
10
10
  {
11
- mTinyTds = rb_define_module("TinyTds");
11
+ mTinyTds = rb_define_module("TinyTds");
12
+ rb_global_variable(&mTinyTds);
12
13
  cTinyTdsError = rb_const_get(mTinyTds, rb_intern("Error"));
14
+ rb_global_variable(&cTinyTdsError);
13
15
  init_tinytds_client();
14
16
  init_tinytds_result();
15
17
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -7,7 +7,7 @@ CrossLibraries.each do |xlib|
7
7
 
8
8
  RakeCompilerDock.sh <<-EOT, platform: platform
9
9
  bundle install &&
10
- rake native:#{platform} pkg/#{SPEC.full_name}-#{platform}.gem MAKEOPTS=-j`nproc` RUBY_CC_VERSION=#{RakeCompilerDock.set_ruby_cc_version("~> 2.7", "~> 3.0")} MAKEFLAGS="V=1"
10
+ rake native:#{platform} pkg/#{SPEC.full_name}-#{platform}.gem MAKEOPTS=-j`nproc` RUBY_CC_VERSION=#{RakeCompilerDock.set_ruby_cc_version("~> 3.0", "~> 4.0")} MAKEFLAGS="V=1"
11
11
  EOT
12
12
  end
13
13
 
@@ -0,0 +1,37 @@
1
+ require "test_helper"
2
+ require "open3"
3
+ require "rbconfig"
4
+
5
+ class GcCompactionTest < Minitest::Spec
6
+ describe "after GC compaction" do
7
+ it "raises TinyTds::Error instead of crashing when a connection fails" do
8
+ skip "GC compaction is not supported on this platform" if !GC.respond_to?(:verify_compaction_references)
9
+
10
+ # Ruby 3.2 renamed the double_heap: keyword to expand_heap:
11
+ heap_keyword =
12
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2")
13
+ "expand_heap"
14
+ else
15
+ "double_heap"
16
+ end
17
+
18
+ script = <<~RUBY
19
+ require "tiny_tds"
20
+
21
+ GC.verify_compaction_references(#{heap_keyword}: true, toward: :empty)
22
+
23
+ begin
24
+ TinyTds::Client.new(host: "127.0.0.1", port: 1, username: "unused", password: "unused", login_timeout: 1)
25
+ rescue TinyTds::Error
26
+ exit 0
27
+ end
28
+
29
+ exit 1
30
+ RUBY
31
+
32
+ output, status = Open3.capture2e(RbConfig.ruby, "-I", File.expand_path("../lib", __dir__), "-e", script)
33
+
34
+ assert status.success?, "expected TinyTds::Error to be raised, got #{status.inspect}:\n#{output}"
35
+ end
36
+ end
37
+ end
data/test/thread_test.rb CHANGED
@@ -1,12 +1,9 @@
1
1
  require "test_helper"
2
- require "logger"
3
2
  require "benchmark"
4
3
 
5
4
  class ThreadTest < TinyTds::TestCase
6
5
  describe "Threaded SELECT queries" do
7
6
  before do
8
- @logger = Logger.new $stdout
9
- @logger.level = Logger::WARN
10
7
  @poolsize = 4
11
8
  @numthreads = 10
12
9
  @query = "waitfor delay '00:00:01'"
@@ -22,19 +19,14 @@ class ThreadTest < TinyTds::TestCase
22
19
  x = Benchmark.realtime do
23
20
  threads = []
24
21
  @numthreads.times do |i|
25
- start = Time.new
26
22
  threads << Thread.new do
27
- ts = Time.new
28
23
  @pool.with { |c| c.execute(@query).do }
29
- te = Time.new
30
- @logger.info "Thread #{i} finished in #{te - ts} thread seconds, #{te - start} real seconds"
31
24
  end
32
25
  end
33
26
  threads.each { |t| t.join }
34
27
  end
35
28
  assert x < @numthreads, "#{x} is not faster than #{@numthreads} seconds"
36
29
  mintime = (1.0 * @numthreads / @poolsize).ceil
37
- @logger.info "#{@numthreads} queries on #{@poolsize} threads: #{x} sec. Minimum time: #{mintime} sec."
38
30
  assert x > mintime, "#{x} is not slower than #{mintime} seconds"
39
31
  end
40
32
 
data/tiny_tds.gemspec CHANGED
@@ -18,14 +18,17 @@ Gem::Specification.new do |s|
18
18
  s.license = "MIT"
19
19
  s.required_ruby_version = ">= 2.7.0"
20
20
  s.metadata["msys2_mingw_dependencies"] = "freetds"
21
- s.add_dependency "bigdecimal", "~> 3"
21
+ s.add_dependency "bigdecimal", ">= 2.0.0"
22
22
  s.add_development_dependency "mini_portile2", "~> 2.8.0"
23
- s.add_development_dependency "rake", "~> 13.0.0"
23
+ s.add_development_dependency "rake", "~> 13.2.0"
24
24
  s.add_development_dependency "rake-compiler", "~> 1.2"
25
- s.add_development_dependency "rake-compiler-dock", "~> 1.9.1"
25
+ s.add_development_dependency "rake-compiler-dock", "~> 1.11.0"
26
26
  s.add_development_dependency "minitest", "~> 5.25"
27
27
  s.add_development_dependency "minitest-reporters", "~> 1.6.1"
28
28
  s.add_development_dependency "connection_pool", "~> 2.2.0"
29
29
  s.add_development_dependency "toxiproxy", "~> 2.0.0"
30
30
  s.add_development_dependency "standard", "~> 1.31.0"
31
+ # ostruct can be dropped when updating to Rubocop 1.65+
32
+ s.add_development_dependency "ostruct"
33
+ s.add_development_dependency "benchmark"
31
34
  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: 3.3.0
4
+ version: 3.4.1
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - Ken Collins
@@ -9,22 +9,22 @@ authors:
9
9
  - Will Bond
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-09-08 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bigdecimal
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '3'
20
+ version: 2.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '3'
27
+ version: 2.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mini_portile2
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 13.0.0
48
+ version: 13.2.0
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 13.0.0
55
+ version: 13.2.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake-compiler
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 1.9.1
76
+ version: 1.11.0
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: 1.9.1
83
+ version: 1.11.0
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: minitest
86
86
  requirement: !ruby/object:Gem::Requirement
@@ -151,6 +151,34 @@ dependencies:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
153
  version: 1.31.0
154
+ - !ruby/object:Gem::Dependency
155
+ name: ostruct
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ - !ruby/object:Gem::Dependency
169
+ name: benchmark
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
154
182
  description: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
155
183
  Developed for the ActiveRecord SQL Server adapter.
156
184
  email:
@@ -192,12 +220,12 @@ files:
192
220
  - ext/tiny_tds/tiny_tds_ext.c
193
221
  - ext/tiny_tds/tiny_tds_ext.h
194
222
  - lib/tiny_tds.rb
195
- - lib/tiny_tds/2.7/tiny_tds.so
196
223
  - lib/tiny_tds/3.0/tiny_tds.so
197
224
  - lib/tiny_tds/3.1/tiny_tds.so
198
225
  - lib/tiny_tds/3.2/tiny_tds.so
199
226
  - lib/tiny_tds/3.3/tiny_tds.so
200
227
  - lib/tiny_tds/3.4/tiny_tds.so
228
+ - lib/tiny_tds/4.0/tiny_tds.so
201
229
  - lib/tiny_tds/bin.rb
202
230
  - lib/tiny_tds/client.rb
203
231
  - lib/tiny_tds/error.rb
@@ -217,6 +245,7 @@ files:
217
245
  - test/bin/install-freetds.sh
218
246
  - test/bin/restore-from-native-gem.ps1
219
247
  - test/client_test.rb
248
+ - test/gc_compaction_test.rb
220
249
  - test/gem_test.rb
221
250
  - test/result_test.rb
222
251
  - test/schema/1px.gif
@@ -240,17 +269,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
269
  requirements:
241
270
  - - ">="
242
271
  - !ruby/object:Gem::Version
243
- version: '2.7'
272
+ version: '3.0'
244
273
  - - "<"
245
274
  - !ruby/object:Gem::Version
246
- version: 3.5.dev
275
+ version: 4.1.dev
247
276
  required_rubygems_version: !ruby/object:Gem::Requirement
248
277
  requirements:
249
278
  - - ">="
250
279
  - !ruby/object:Gem::Version
251
280
  version: 3.3.22
252
281
  requirements: []
253
- rubygems_version: 3.6.2
282
+ rubygems_version: 4.0.3
254
283
  specification_version: 4
255
284
  summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
256
285
  test_files: []
Binary file