duckdb 0.5.2-dev2256.0 → 0.5.2-dev2278.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
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.5.2-dev2256.0",
5
+ "version": "0.5.2-dev2278.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -186573,7 +186573,7 @@ unique_ptr<ParsedExpression> ExpressionBinder::QualifyColumnName(const string &c
186573
186573
  unique_ptr<Expression> expression;
186574
186574
  if (!using_binding->primary_binding.empty()) {
186575
186575
  // we can! just assign the table name and re-bind
186576
- return make_unique<ColumnRefExpression>(column_name, using_binding->primary_binding);
186576
+ return binder.bind_context.CreateColumnReference(using_binding->primary_binding, column_name);
186577
186577
  } else {
186578
186578
  // // we cannot! we need to bind this as a coalesce between all the relevant columns
186579
186579
  auto coalesce = make_unique<OperatorExpression>(ExpressionType::OPERATOR_COALESCE);
@@ -191306,6 +191306,10 @@ public:
191306
191306
  protected:
191307
191307
  BindResult BindExpression(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth,
191308
191308
  bool root_expression = false) override;
191309
+
191310
+ // check certain column ref Names to make sure they are supported in the returning statement
191311
+ // (i.e rowid)
191312
+ BindResult BindColumnRef(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth);
191309
191313
  };
191310
191314
 
191311
191315
  } // namespace duckdb
@@ -191390,13 +191394,13 @@ BoundStatement Binder::Bind(DeleteStatement &stmt) {
191390
191394
  unique_ptr<LogicalOperator> del_as_logicaloperator = move(del);
191391
191395
  return BindReturning(move(stmt.returning_list), table, update_table_index, move(del_as_logicaloperator),
191392
191396
  move(result));
191393
- } else {
191394
- result.plan = move(del);
191395
- result.names = {"Count"};
191396
- result.types = {LogicalType::BIGINT};
191397
- properties.allow_stream_result = false;
191398
- properties.return_type = StatementReturnType::CHANGED_ROWS;
191399
191397
  }
191398
+ result.plan = move(del);
191399
+ result.names = {"Count"};
191400
+ result.types = {LogicalType::BIGINT};
191401
+ properties.allow_stream_result = false;
191402
+ properties.return_type = StatementReturnType::CHANGED_ROWS;
191403
+
191400
191404
  return result;
191401
191405
  }
191402
191406
 
@@ -191959,13 +191963,13 @@ BoundStatement Binder::Bind(InsertStatement &stmt) {
191959
191963
 
191960
191964
  return BindReturning(move(stmt.returning_list), table, insert_table_index, move(index_as_logicaloperator),
191961
191965
  move(result));
191962
- } else {
191963
- D_ASSERT(result.types.size() == result.names.size());
191964
- result.plan = move(insert);
191965
- properties.allow_stream_result = false;
191966
- properties.return_type = StatementReturnType::CHANGED_ROWS;
191967
- return result;
191968
191966
  }
191967
+
191968
+ D_ASSERT(result.types.size() == result.names.size());
191969
+ result.plan = move(insert);
191970
+ properties.allow_stream_result = false;
191971
+ properties.return_type = StatementReturnType::CHANGED_ROWS;
191972
+ return result;
191969
191973
  }
191970
191974
 
191971
191975
  } // namespace duckdb
@@ -192616,15 +192620,14 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) {
192616
192620
 
192617
192621
  return BindReturning(move(stmt.returning_list), table, update_table_index, move(update_as_logicaloperator),
192618
192622
  move(result));
192619
-
192620
- } else {
192621
- update->table_index = 0;
192622
- result.names = {"Count"};
192623
- result.types = {LogicalType::BIGINT};
192624
- result.plan = move(update);
192625
- properties.allow_stream_result = false;
192626
- properties.return_type = StatementReturnType::CHANGED_ROWS;
192627
192623
  }
192624
+
192625
+ update->table_index = 0;
192626
+ result.names = {"Count"};
192627
+ result.types = {LogicalType::BIGINT};
192628
+ result.plan = move(update);
192629
+ properties.allow_stream_result = false;
192630
+ properties.return_type = StatementReturnType::CHANGED_ROWS;
192628
192631
  return result;
192629
192632
  }
192630
192633
 
@@ -196828,6 +196831,14 @@ namespace duckdb {
196828
196831
  ReturningBinder::ReturningBinder(Binder &binder, ClientContext &context) : ExpressionBinder(binder, context) {
196829
196832
  }
196830
196833
 
196834
+ BindResult ReturningBinder::BindColumnRef(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth) {
196835
+ auto &expr = **expr_ptr;
196836
+ if (expr.GetName() == "rowid") {
196837
+ return BindResult("rowid is not supported in returning statements");
196838
+ }
196839
+ return ExpressionBinder::BindExpression(expr_ptr, depth);
196840
+ }
196841
+
196831
196842
  BindResult ReturningBinder::BindExpression(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth, bool root_expression) {
196832
196843
  auto &expr = **expr_ptr;
196833
196844
  switch (expr.GetExpressionClass()) {
@@ -196835,6 +196846,8 @@ BindResult ReturningBinder::BindExpression(unique_ptr<ParsedExpression> *expr_pt
196835
196846
  return BindResult("SUBQUERY is not supported in returning statements");
196836
196847
  case ExpressionClass::BOUND_SUBQUERY:
196837
196848
  return BindResult("BOUND SUBQUERY is not supported in returning statements");
196849
+ case ExpressionClass::COLUMN_REF:
196850
+ return BindColumnRef(expr_ptr, depth);
196838
196851
  default:
196839
196852
  return ExpressionBinder::BindExpression(expr_ptr, depth);
196840
196853
  }
@@ -201250,18 +201263,16 @@ BindResult TableBinding::Bind(ColumnRefExpression &colref, idx_t depth) {
201250
201263
  if (!success) {
201251
201264
  return BindResult(ColumnNotFoundError(column_name));
201252
201265
  }
201253
- #ifdef DEBUG
201254
201266
  auto entry = GetStandardEntry();
201255
- if (entry) {
201267
+ if (entry && column_index != COLUMN_IDENTIFIER_ROW_ID) {
201256
201268
  D_ASSERT(entry->type == CatalogType::TABLE_ENTRY);
201269
+ // Either there is no table, or the columns category has to be standard
201257
201270
  auto table_entry = (TableCatalogEntry *)entry;
201258
- //! Either there is no table, or the columns category has to be standard
201259
- if (column_index != COLUMN_IDENTIFIER_ROW_ID) {
201260
- D_ASSERT(table_entry->columns.GetColumn(LogicalIndex(column_index)).Category() ==
201261
- TableColumnType::STANDARD);
201262
- }
201271
+ auto &column_entry = table_entry->columns.GetColumn(LogicalIndex(column_index));
201272
+ (void)table_entry;
201273
+ (void)column_entry;
201274
+ D_ASSERT(column_entry.Category() == TableColumnType::STANDARD);
201263
201275
  }
201264
- #endif /* DEBUG */
201265
201276
  // fetch the type of the column
201266
201277
  LogicalType col_type;
201267
201278
  if (column_index == COLUMN_IDENTIFIER_ROW_ID) {
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 "47bb125a91"
15
- #define DUCKDB_VERSION "v0.5.2-dev2256"
14
+ #define DUCKDB_SOURCE_ID "04bbd7a171"
15
+ #define DUCKDB_VERSION "v0.5.2-dev2278"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //