duckdb 0.5.1-dev21.0 → 0.5.1-dev25.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.5.1-dev21.0",
4
+ "version": "0.5.1-dev25.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -181201,7 +181201,20 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
181201
181201
  auto &get = (LogicalGet &)*ref->get;
181202
181202
  columns.insert(columns.end(), get.names.begin(), get.names.end());
181203
181203
  }
181204
+
181205
+ case_insensitive_set_t column_name_set;
181206
+ vector<string> non_generated_column_names;
181204
181207
  for (auto &col_name : columns) {
181208
+ if (column_name_set.count(col_name) > 0) {
181209
+ throw BinderException("Vacuum the same column twice(same name in column name list)");
181210
+ }
181211
+ column_name_set.insert(col_name);
181212
+ auto &col = ref->table->GetColumn(col_name);
181213
+ // ignore generated column
181214
+ if (col.Generated()) {
181215
+ continue;
181216
+ }
181217
+ non_generated_column_names.push_back(col_name);
181205
181218
  ColumnRefExpression colref(col_name, ref->table->name);
181206
181219
  auto result = bind_context.BindColumn(colref, 0);
181207
181220
  if (result.HasError()) {
@@ -181209,17 +181222,29 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
181209
181222
  }
181210
181223
  select_list.push_back(move(result.expression));
181211
181224
  }
181212
- auto table_scan = CreatePlan(*ref);
181213
- D_ASSERT(table_scan->type == LogicalOperatorType::LOGICAL_GET);
181214
- auto &get = (LogicalGet &)*table_scan;
181215
- for (idx_t i = 0; i < get.column_ids.size(); i++) {
181216
- stmt.info->column_id_map[i] = get.column_ids[i];
181217
- }
181225
+ stmt.info->columns = move(non_generated_column_names);
181226
+ if (!select_list.empty()) {
181227
+ auto table_scan = CreatePlan(*ref);
181228
+ D_ASSERT(table_scan->type == LogicalOperatorType::LOGICAL_GET);
181218
181229
 
181219
- auto projection = make_unique<LogicalProjection>(GenerateTableIndex(), move(select_list));
181220
- projection->children.push_back(move(table_scan));
181230
+ auto &get = (LogicalGet &)*table_scan;
181231
+
181232
+ D_ASSERT(select_list.size() == get.column_ids.size());
181233
+ D_ASSERT(stmt.info->columns.size() == get.column_ids.size());
181234
+ for (idx_t i = 0; i < get.column_ids.size(); i++) {
181235
+ stmt.info->column_id_map[i] = ref->table->columns[get.column_ids[i]].StorageOid();
181236
+ }
181221
181237
 
181222
- root = move(projection);
181238
+ auto projection = make_unique<LogicalProjection>(GenerateTableIndex(), move(select_list));
181239
+ projection->children.push_back(move(table_scan));
181240
+
181241
+ root = move(projection);
181242
+ } else {
181243
+ // eg. CREATE TABLE test (x AS (1));
181244
+ // ANALYZE test;
181245
+ // Make it not a SINK so it doesn't have to do anything
181246
+ stmt.info->has_table = false;
181247
+ }
181223
181248
  }
181224
181249
  auto vacuum = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_VACUUM, move(stmt.info));
181225
181250
  if (root) {
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 "cf4b8dcee"
15
- #define DUCKDB_VERSION "v0.5.1-dev21"
14
+ #define DUCKDB_SOURCE_ID "7ebad2075"
15
+ #define DUCKDB_VERSION "v0.5.1-dev25"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //