duckdb 0.3.2-dev1197.0 → 0.3.2-dev1206.0

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.3.2-dev1197.0",
4
+ "version": "0.3.2-dev1206.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -138047,7 +138047,9 @@ unique_ptr<ConstantExpression> Transformer::TransformValue(duckdb_libpgquery::PG
138047
138047
  return make_unique<ConstantExpression>(Value::HUGEINT(hugeint_value));
138048
138048
  }
138049
138049
  }
138050
- if (try_cast_as_decimal && decimal_position >= 0 && str_val.GetSize() < Decimal::MAX_WIDTH_DECIMAL + 2) {
138050
+ idx_t decimal_offset = val.val.str[0] == '-' ? 3 : 2;
138051
+ if (try_cast_as_decimal && decimal_position >= 0 &&
138052
+ str_val.GetSize() < Decimal::MAX_WIDTH_DECIMAL + decimal_offset) {
138051
138053
  // figure out the width/scale based on the decimal position
138052
138054
  auto width = uint8_t(str_val.GetSize() - 1);
138053
138055
  auto scale = uint8_t(width - decimal_position);