duckdb 0.8.1.2 → 0.8.1.3

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: def2e5adaab85bedca1363e7c527640eeb7f2cc2938c4bac219b026d8d79e895
4
- data.tar.gz: 2f058e71abd48266432f7486bed43a67fa8ef5e8955ccc150c27a64e023fb7d5
3
+ metadata.gz: a9ce44263b8239010b8a203c7cebadf9e1b07323efc89164877e8ded4e37f768
4
+ data.tar.gz: 44dc20be5aa79c3b29f7bd7b57aa5d9e30524919499a88e7b7d5d50318468554
5
5
  SHA512:
6
- metadata.gz: 388302d5e187b6f8f85877c0cfd2613e78047ba78484067e99e8fe1a6cee16ca61a59918ae4d9090b4b9029e8594f0c4f63e2d9855f3f3a931979b51430ecd8f
7
- data.tar.gz: 27418556352f19324ebc8e90cae28972f05965cd2394dccd92836ccf1dd044604f2e1045ebdb7f05b28afeec493de07fa1d060dde3c3367a60fbcf4fee30038f
6
+ metadata.gz: 41fd80e244cd09100931b695533314aa29c040f7571f64747cb79533da45c8685adc1fc04bc731cff5d59e5c58f8669db2c9cb1eebb8dcdfc78f92b3d7cb49d6
7
+ data.tar.gz: 75e8d32f1d467be39365f0ffe3f3f40471b1b580929f025736ec6d47db9dad62a99beb490a118066a7145837717dfcc337e5f1aaafba7f068c63279ef16770f9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # ChangeLog
2
2
 
3
+ # 0.8.1.3
4
+ - Fix BigDecimal conversion.
5
+
3
6
  # 0.8.1.2
4
7
  - Fix BigDecimal conversion when the value is 0.
5
8
  Thanks to shreeve.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckdb (0.8.1.2)
4
+ duckdb (0.8.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -23,7 +23,8 @@ module DuckDB
23
23
 
24
24
  def _to_decimal_from_vector(_width, scale, lower, upper)
25
25
  v = _to_hugeint_from_vector(lower, upper).to_s
26
- v[-scale, 0] = '.' unless v == '0'
26
+ v = v.rjust(scale + 1, '0') if v.length < scale
27
+ v[-scale, 0] = '.'
27
28
  BigDecimal(v)
28
29
  end
29
30
 
data/lib/duckdb/result.rb CHANGED
@@ -102,10 +102,8 @@ module DuckDB
102
102
  end
103
103
 
104
104
  def _to_decimal_internal(row, col)
105
- lower, upper, _width, scale = __to_decimal_internal(row, col)
106
- v = (upper * Converter::HALF_HUGEINT + lower).to_s
107
- v[-scale, 0] = '.' unless v == '0'
108
- BigDecimal(v)
105
+ lower, upper, width, scale = __to_decimal_internal(row, col)
106
+ Converter._to_decimal_from_vector(width, scale, lower, upper)
109
107
  end
110
108
  end
111
109
  end
@@ -3,5 +3,5 @@
3
3
  module DuckDB
4
4
  # The version string of ruby-duckdb.
5
5
  # Currently, ruby-duckdb is NOT semantic versioning.
6
- VERSION = '0.8.1.2'
6
+ VERSION = '0.8.1.3'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duckdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1.2
4
+ version: 0.8.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Suketa