duckdb 0.3.5-dev586.0 → 0.3.5-dev591.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.5-dev586.0",
4
+ "version": "0.3.5-dev591.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -159855,8 +159855,10 @@ BindResult ExpressionBinder::BindExpression(ComparisonExpression &expr, idx_t de
159855
159855
  // now obtain the result type of the input types
159856
159856
  auto input_type = BoundComparisonExpression::BindComparison(left_sql_type, right_sql_type);
159857
159857
  // add casts (if necessary)
159858
- left.expr = BoundCastExpression::AddCastToType(move(left.expr), input_type);
159859
- right.expr = BoundCastExpression::AddCastToType(move(right.expr), input_type);
159858
+ left.expr = BoundCastExpression::AddCastToType(move(left.expr), input_type, input_type.id() == LogicalTypeId::ENUM);
159859
+ right.expr =
159860
+ BoundCastExpression::AddCastToType(move(right.expr), input_type, input_type.id() == LogicalTypeId::ENUM);
159861
+
159860
159862
  if (input_type.id() == LogicalTypeId::VARCHAR) {
159861
159863
  // handle collation
159862
159864
  auto collation = StringType::GetCollation(input_type);
@@ -166455,7 +166457,8 @@ BoundCastExpression::BoundCastExpression(unique_ptr<Expression> child_p, Logical
166455
166457
  try_cast(try_cast_p) {
166456
166458
  }
166457
166459
 
166458
- unique_ptr<Expression> BoundCastExpression::AddCastToType(unique_ptr<Expression> expr, const LogicalType &target_type) {
166460
+ unique_ptr<Expression> BoundCastExpression::AddCastToType(unique_ptr<Expression> expr, const LogicalType &target_type,
166461
+ bool try_cast) {
166459
166462
  D_ASSERT(expr);
166460
166463
  if (expr->expression_class == ExpressionClass::BOUND_PARAMETER) {
166461
166464
  auto &parameter = (BoundParameterExpression &)*expr;
@@ -166472,7 +166475,7 @@ unique_ptr<Expression> BoundCastExpression::AddCastToType(unique_ptr<Expression>
166472
166475
  return expr;
166473
166476
  }
166474
166477
  }
166475
- return make_unique<BoundCastExpression>(move(expr), target_type);
166478
+ return make_unique<BoundCastExpression>(move(expr), target_type, try_cast);
166476
166479
  }
166477
166480
  return expr;
166478
166481
  }
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 "45cb21592"
15
- #define DUCKDB_VERSION "v0.3.5-dev586"
14
+ #define DUCKDB_SOURCE_ID "b0155fd5b"
15
+ #define DUCKDB_VERSION "v0.3.5-dev591"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -12411,7 +12411,8 @@ public:
12411
12411
  }
12412
12412
 
12413
12413
  //! Cast an expression to the specified SQL type if required
12414
- static unique_ptr<Expression> AddCastToType(unique_ptr<Expression> expr, const LogicalType &target_type);
12414
+ static unique_ptr<Expression> AddCastToType(unique_ptr<Expression> expr, const LogicalType &target_type,
12415
+ bool try_cast = false);
12415
12416
  //! Returns true if a cast is invertible (i.e. CAST(s -> t -> s) = s for all values of s). This is not true for e.g.
12416
12417
  //! boolean casts, because that can be e.g. -1 -> TRUE -> 1. This is necessary to prevent some optimizer bugs.
12417
12418
  static bool CastIsInvertible(const LogicalType &source_type, const LogicalType &target_type);