exwiw 1.1.2 → 1.1.3

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: 0014e16bc315ba2aee359cdf8aeebc71edb91da1ae2a6dc1792d4da55f81593f
4
- data.tar.gz: bec818638046dc447be1624043639240743bda93bd25607fc3977475cfc4c68c
3
+ metadata.gz: 0feed4cda7c72c24738b7ccc03fa5cadc5321b636e48a86e07d8a169c5b7d941
4
+ data.tar.gz: 50241d3f38a64485adcfbc8740e5558e8049c136762068f56e9b505a93251d19
5
5
  SHA512:
6
- metadata.gz: 773b59703dd74b61cb4da1665f73492fe6c35b906134d26cb406ce174e5919859a5e4c6418a660dfb8f3972a75fc908da4bac77606c39474c11e015edc180638
7
- data.tar.gz: 366f12162f6ddace018a027efbaa9a2563023dc51d4e26da20cebab8d988671419d4a3055f13dbe7b2d384030279443865b4e239d0d19fd903dba28ea4b8632a
6
+ metadata.gz: 1fad77e8f61f216afc2c9af89f54784e90fc50bfa691b29bd198727be29a6114d208d867e261c89e6b14d3ad27d385c6e981bd133df4803d2cab4c201eb9e090
7
+ data.tar.gz: a874e74e0c5c6fe674511de041baf80b80c7dc6495b7c96a950d5200f393a9e6e6dfa004f0d341245fdf576e4f42c0425079225895e9143f8001612a6d403383
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.1.3] - 2026-09-08
6
+
7
+ ### Fixed
8
+
9
+ - **MySQL (mysql2): `query` no longer reads the field list after draining the result.** mysql2 frees the underlying `MYSQL_RES` as soon as the last row has been fetched, and `Result#fields` dereferences it afterwards, so a buffered query followed by `fields` was a use-after-free. It went unnoticed on the export path, which issues only a handful of such queries, but `exwiw schema check --from-db` / `schema generate --from-db` issue several per table and crashed with a segmentation fault on Ruby 4.0 with MariaDB Connector/C 3.4. The field list is now captured before the rows are read.
10
+
5
11
  ## [1.1.2] - 2026-09-07
6
12
 
7
13
  ### Added
@@ -110,8 +110,10 @@ module Exwiw
110
110
  # mysql2 returns nil for a statement with no result set (SET, DDL, ...).
111
111
  return Result.new([], []) if res.nil?
112
112
 
113
+ # mysql2 frees the MYSQL_RES once every row is fetched; #fields after that is a use-after-free.
114
+ fields = res.fields
113
115
  rows = res.to_a.map { |row| row.map { |value| self.class.stringify_value(value) } }
114
- Result.new(res.fields, rows)
116
+ Result.new(fields, rows)
115
117
  when :trilogy
116
118
  res = raw.query(sql)
117
119
  rows = res.rows.map { |row| row.map { |value| self.class.stringify_value(value) } }
data/lib/exwiw/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exwiw
4
- VERSION = "1.1.2"
4
+ VERSION = "1.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exwiw
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shia