tiny_tds 3.4.0 → 3.4.1

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: 5c8208aafb2c7bdde1d7e21f319c23aa5bff9a7a2677b0c6fe9bd2775af5d21c
4
- data.tar.gz: 7bb08e91fcbf0283094140ec280dbc659edcdf7d6b968eda3428ad6e879dbde8
3
+ metadata.gz: 06c6defb990f0d995295d2ae58349f78250dd71f0d23caed9ff17ea237e31fae
4
+ data.tar.gz: 13460ca9f788d97380f12585371246612249a39894a2e5ead409472237876f94
5
5
  SHA512:
6
- metadata.gz: aed9efda72201410a5b5b5e4320e655cd930dfd6e8ce3e00c4bd71979c206d3e40732e943fd8f61b8f84498ee3e0e68d85351125eacbfd5d8049489a573e9ff1
7
- data.tar.gz: 6dbfb299b33525c605410c4d2ab01a7d192c509e3f0477d5b49d479a37d8b68daf4866b2ed2d72d6a09ea6c459d3271e028977ea40701b9d26d958b486e1829d
6
+ metadata.gz: 0f42dc8bfad646bfcb424c4621815f9448e1272d564d9a341382fd6be42b05c255fd1730e84c61957e9ca8de97025ddf3d311ebd8e85e9188904b8a512353a63
7
+ data.tar.gz: 88991809d38b321cd6f5275acb101dbbfcfc66ae06d54649cc4946d6d8e2cf326f71bcc67f88e3cd3f2df24ba3ddd1c92e96a7d32e49e08c3a14fab7736b8145
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
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
+
3
8
  ## 3.4.0
4
9
 
5
10
  * Add Ruby 4.0 to the cross compile list
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.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.6.0"
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.10"
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
  }
@@ -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
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_tds
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  - Erik Bryn
9
9
  - Will Bond
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-01-01 00:00:00.000000000 Z
13
+ date: 2026-10-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bigdecimal
@@ -238,6 +238,7 @@ files:
238
238
  - test/bin/install-freetds.sh
239
239
  - test/bin/restore-from-native-gem.ps1
240
240
  - test/client_test.rb
241
+ - test/gc_compaction_test.rb
241
242
  - test/gem_test.rb
242
243
  - test/result_test.rb
243
244
  - test/schema/1px.gif
@@ -254,7 +255,7 @@ licenses:
254
255
  - MIT
255
256
  metadata:
256
257
  msys2_mingw_dependencies: freetds
257
- post_install_message:
258
+ post_install_message:
258
259
  rdoc_options:
259
260
  - "--charset=UTF-8"
260
261
  require_paths:
@@ -271,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
272
  version: '0'
272
273
  requirements: []
273
274
  rubygems_version: 3.1.6
274
- signing_key:
275
+ signing_key:
275
276
  specification_version: 4
276
277
  summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
277
278
  test_files: []