duckdb 0.3.3-dev1422.0 → 0.3.3-dev1425.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.3-dev1422.0",
4
+ "version": "0.3.3-dev1425.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -129455,6 +129455,7 @@ unique_ptr<BaseStatistics> StatisticsPropagator::PropagateExpression(BoundAggreg
129455
129455
 
129456
129456
 
129457
129457
 
129458
+
129458
129459
  namespace duckdb {
129459
129460
 
129460
129461
  unique_ptr<Expression> CastHugeintToSmallestType(unique_ptr<Expression> expr, NumericStatistics &num_stats) {
@@ -129517,23 +129518,21 @@ unique_ptr<Expression> TemplatedCastToSmallestType(unique_ptr<Expression> expr,
129517
129518
  return expr;
129518
129519
  }
129519
129520
 
129520
- // Prevent signed integer overflow - we can't range map these
129521
- if (std::is_signed<T>() && signed_min_val < -((T)1 << (sizeof(T) * 8 - 2)) &&
129522
- signed_max_val > ((T)1 << (sizeof(T) * 8 - 2))) {
129521
+ // Compute range, cast to unsigned to prevent comparing signed with unsigned
129522
+ T signed_range;
129523
+ if (!TrySubtractOperator::Operation(signed_min_val, signed_max_val, signed_range)) {
129524
+ // overflow in subtraction: cannot do any simplification
129523
129525
  return expr;
129524
129526
  }
129525
-
129526
- // Compute range, cast to unsigned to prevent comparing signed with unsigned
129527
- auto signed_range = signed_max_val - signed_min_val;
129528
129527
  auto range = static_cast<typename std::make_unsigned<decltype(signed_range)>::type>(signed_range);
129529
129528
 
129530
129529
  // Check if this range fits in a smaller type
129531
129530
  LogicalType cast_type;
129532
- if (range < NumericLimits<uint8_t>().Maximum()) {
129531
+ if (range < NumericLimits<uint8_t>::Maximum()) {
129533
129532
  cast_type = LogicalType::UTINYINT;
129534
- } else if (sizeof(T) > sizeof(uint16_t) && range < NumericLimits<uint16_t>().Maximum()) {
129533
+ } else if (sizeof(T) > sizeof(uint16_t) && range < NumericLimits<uint16_t>::Maximum()) {
129535
129534
  cast_type = LogicalType::USMALLINT;
129536
- } else if (sizeof(T) > sizeof(uint32_t) && range < NumericLimits<uint32_t>().Maximum()) {
129535
+ } else if (sizeof(T) > sizeof(uint32_t) && range < NumericLimits<uint32_t>::Maximum()) {
129537
129536
  cast_type = LogicalType::UINTEGER;
129538
129537
  } else {
129539
129538
  return expr;
package/src/duckdb.hpp CHANGED
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
13
  #define DUCKDB_AMALGAMATION_EXTENDED 1
14
- #define DUCKDB_SOURCE_ID "f3371d736"
15
- #define DUCKDB_VERSION "v0.3.3-dev1422"
14
+ #define DUCKDB_SOURCE_ID "f9fcdc7d0"
15
+ #define DUCKDB_VERSION "v0.3.3-dev1425"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //