duckdb 0.5.2-dev2133.0 → 0.5.2-dev2164.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-dev2133.0",
5
+ "version": "0.5.2-dev2164.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -6141,7 +6141,7 @@ static DefaultView internal_views[] = {
6141
6141
  {"pg_catalog", "pg_attribute", "SELECT table_oid attrelid, column_name attname, data_type_id atttypid, 0 attstattarget, NULL attlen, column_index attnum, 0 attndims, -1 attcacheoff, case when data_type ilike '%decimal%' then numeric_precision*1000+numeric_scale else -1 end atttypmod, false attbyval, NULL attstorage, NULL attalign, NOT is_nullable attnotnull, column_default IS NOT NULL atthasdef, false atthasmissing, '' attidentity, '' attgenerated, false attisdropped, true attislocal, 0 attinhcount, 0 attcollation, NULL attcompression, NULL attacl, NULL attoptions, NULL attfdwoptions, NULL attmissingval FROM duckdb_columns()"},
6142
6142
  {"pg_catalog", "pg_attrdef", "SELECT column_index oid, table_oid adrelid, column_index adnum, column_default adbin from duckdb_columns() where column_default is not null;"},
6143
6143
  {"pg_catalog", "pg_class", "SELECT table_oid oid, table_name relname, schema_oid relnamespace, 0 reltype, 0 reloftype, 0 relowner, 0 relam, 0 relfilenode, 0 reltablespace, 0 relpages, estimated_size::real reltuples, 0 relallvisible, 0 reltoastrelid, 0 reltoastidxid, index_count > 0 relhasindex, false relisshared, case when temporary then 't' else 'p' end relpersistence, 'r' relkind, column_count relnatts, check_constraint_count relchecks, false relhasoids, has_primary_key relhaspkey, false relhasrules, false relhastriggers, false relhassubclass, false relrowsecurity, true relispopulated, NULL relreplident, false relispartition, 0 relrewrite, 0 relfrozenxid, NULL relminmxid, NULL relacl, NULL reloptions, NULL relpartbound FROM duckdb_tables() UNION ALL SELECT view_oid oid, view_name relname, schema_oid relnamespace, 0 reltype, 0 reloftype, 0 relowner, 0 relam, 0 relfilenode, 0 reltablespace, 0 relpages, 0 reltuples, 0 relallvisible, 0 reltoastrelid, 0 reltoastidxid, false relhasindex, false relisshared, case when temporary then 't' else 'p' end relpersistence, 'v' relkind, column_count relnatts, 0 relchecks, false relhasoids, false relhaspkey, false relhasrules, false relhastriggers, false relhassubclass, false relrowsecurity, true relispopulated, NULL relreplident, false relispartition, 0 relrewrite, 0 relfrozenxid, NULL relminmxid, NULL relacl, NULL reloptions, NULL relpartbound FROM duckdb_views() UNION ALL SELECT sequence_oid oid, sequence_name relname, schema_oid relnamespace, 0 reltype, 0 reloftype, 0 relowner, 0 relam, 0 relfilenode, 0 reltablespace, 0 relpages, 0 reltuples, 0 relallvisible, 0 reltoastrelid, 0 reltoastidxid, false relhasindex, false relisshared, case when temporary then 't' else 'p' end relpersistence, 'S' relkind, 0 relnatts, 0 relchecks, false relhasoids, false relhaspkey, false relhasrules, false relhastriggers, false relhassubclass, false relrowsecurity, true relispopulated, NULL relreplident, false relispartition, 0 relrewrite, 0 relfrozenxid, NULL relminmxid, NULL relacl, NULL reloptions, NULL relpartbound FROM duckdb_sequences() UNION ALL SELECT index_oid oid, index_name relname, schema_oid relnamespace, 0 reltype, 0 reloftype, 0 relowner, 0 relam, 0 relfilenode, 0 reltablespace, 0 relpages, 0 reltuples, 0 relallvisible, 0 reltoastrelid, 0 reltoastidxid, false relhasindex, false relisshared, 't' relpersistence, 'i' relkind, NULL relnatts, 0 relchecks, false relhasoids, false relhaspkey, false relhasrules, false relhastriggers, false relhassubclass, false relrowsecurity, true relispopulated, NULL relreplident, false relispartition, 0 relrewrite, 0 relfrozenxid, NULL relminmxid, NULL relacl, NULL reloptions, NULL relpartbound FROM duckdb_indexes()"},
6144
- {"pg_catalog", "pg_constraint", "SELECT table_oid*1000000+constraint_index oid, constraint_text conname, schema_oid connamespace, CASE WHEN constraint_type='CHECK' then 'c' WHEN constraint_type='UNIQUE' then 'u' WHEN constraint_type='PRIMARY KEY' THEN 'p' ELSE 'x' END contype, false condeferrable, false condeferred, true convalidated, table_oid conrelid, 0 contypid, 0 conindid, 0 conparentid, 0 confrelid, NULL confupdtype, NULL confdeltype, NULL confmatchtype, true conislocal, 0 coninhcount, false connoinherit, constraint_column_indexes conkey, NULL confkey, NULL conpfeqop, NULL conppeqop, NULL conffeqop, NULL conexclop, expression conbin FROM duckdb_constraints()"},
6144
+ {"pg_catalog", "pg_constraint", "SELECT table_oid*1000000+constraint_index oid, constraint_text conname, schema_oid connamespace, CASE constraint_type WHEN 'CHECK' then 'c' WHEN 'UNIQUE' then 'u' WHEN 'PRIMARY KEY' THEN 'p' WHEN 'FOREIGN KEY' THEN 'f' ELSE 'x' END contype, false condeferrable, false condeferred, true convalidated, table_oid conrelid, 0 contypid, 0 conindid, 0 conparentid, 0 confrelid, NULL confupdtype, NULL confdeltype, NULL confmatchtype, true conislocal, 0 coninhcount, false connoinherit, constraint_column_indexes conkey, NULL confkey, NULL conpfeqop, NULL conppeqop, NULL conffeqop, NULL conexclop, expression conbin FROM duckdb_constraints()"},
6145
6145
  {"pg_catalog", "pg_depend", "SELECT * FROM duckdb_dependencies()"},
6146
6146
  {"pg_catalog", "pg_description", "SELECT NULL objoid, NULL classoid, NULL objsubid, NULL description WHERE 1=0"},
6147
6147
  {"pg_catalog", "pg_enum", "SELECT NULL oid, NULL enumtypid, NULL enumsortorder, NULL enumlabel WHERE 1=0"},
@@ -45450,6 +45450,7 @@ string Decimal::ToString(hugeint_t value, uint8_t width, uint8_t scale) {
45450
45450
 
45451
45451
 
45452
45452
  #include <functional>
45453
+ #include <cmath>
45453
45454
 
45454
45455
  namespace duckdb {
45455
45456
 
@@ -45468,9 +45469,22 @@ hash_t Hash(hugeint_t val) {
45468
45469
  return murmurhash64(val.lower) ^ murmurhash64(val.upper);
45469
45470
  }
45470
45471
 
45472
+ template <class T>
45473
+ struct FloatingPointEqualityTransform {
45474
+ static void OP(T &val) {
45475
+ if (val == (T)0.0) {
45476
+ // Turn negative zero into positive zero
45477
+ val = (T)0.0;
45478
+ } else if (std::isnan(val)) {
45479
+ val = std::numeric_limits<T>::quiet_NaN();
45480
+ }
45481
+ }
45482
+ };
45483
+
45471
45484
  template <>
45472
45485
  hash_t Hash(float val) {
45473
45486
  static_assert(sizeof(float) == sizeof(uint32_t), "");
45487
+ FloatingPointEqualityTransform<float>::OP(val);
45474
45488
  uint32_t uval = *((uint32_t *)&val);
45475
45489
  return murmurhash64(uval);
45476
45490
  }
@@ -45478,6 +45492,7 @@ hash_t Hash(float val) {
45478
45492
  template <>
45479
45493
  hash_t Hash(double val) {
45480
45494
  static_assert(sizeof(double) == sizeof(uint64_t), "");
45495
+ FloatingPointEqualityTransform<double>::OP(val);
45481
45496
  uint64_t uval = *((uint64_t *)&val);
45482
45497
  return murmurhash64(uval);
45483
45498
  }
@@ -142055,7 +142070,7 @@ inline bool parse_header(const char *beg, const char *end, T fn) {
142055
142070
  }
142056
142071
 
142057
142072
  if (p < end) {
142058
- fn(std::string(beg, key_end), decode_url(std::string(p, end), false));
142073
+ fn(std::string(beg, key_end), std::string(p, end));
142059
142074
  return true;
142060
142075
  }
142061
142076
 
@@ -144895,7 +144910,7 @@ inline bool ClientImpl::redirect(Request &req, Response &res, Error &error) {
144895
144910
  return false;
144896
144911
  }
144897
144912
 
144898
- auto location = detail::decode_url(res.get_header_value("location"), false);
144913
+ auto location = res.get_header_value("location");
144899
144914
  if (location.empty()) { return false; }
144900
144915
 
144901
144916
  const static Regex re(
@@ -196196,7 +196211,10 @@ BindResult ColumnAliasBinder::BindAlias(ExpressionBinder &enclosing_binder, Colu
196196
196211
  // found an alias: bind the alias expression
196197
196212
  auto expression = node.original_expressions[alias_entry->second]->Copy();
196198
196213
  in_alias = true;
196199
- auto result = enclosing_binder.BindExpression(&expression, depth, root_expression);
196214
+
196215
+ // since the alias has been found, pass a depth of 0. See Issue 4978 (#16)
196216
+ // ColumnAliasBinders are only in Having, Qualify and Where Binders
196217
+ auto result = enclosing_binder.BindExpression(&expression, 0, root_expression);
196200
196218
  in_alias = false;
196201
196219
  return result;
196202
196220
  }
@@ -200683,9 +200701,17 @@ unique_ptr<LogicalOperator> FlattenDependentJoins::PushDownDependentJoinInternal
200683
200701
  setop.column_count += correlated_columns.size();
200684
200702
  return plan;
200685
200703
  }
200686
- case LogicalOperatorType::LOGICAL_DISTINCT:
200687
- plan->children[0] = PushDownDependentJoin(move(plan->children[0]));
200704
+ case LogicalOperatorType::LOGICAL_DISTINCT: {
200705
+ auto &distinct = (LogicalDistinct &)*plan;
200706
+ // push down into child
200707
+ distinct.children[0] = PushDownDependentJoin(move(distinct.children[0]));
200708
+ // add all correlated columns to the distinct targets
200709
+ for (idx_t i = 0; i < correlated_columns.size(); i++) {
200710
+ distinct.distinct_targets.push_back(make_unique<BoundColumnRefExpression>(
200711
+ correlated_columns[i].type, ColumnBinding(base_binding.table_index, base_binding.column_index + i)));
200712
+ }
200688
200713
  return plan;
200714
+ }
200689
200715
  case LogicalOperatorType::LOGICAL_EXPRESSION_GET: {
200690
200716
  // expression get
200691
200717
  // first we flatten the dependent join in the child
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 "4b89793a18"
15
- #define DUCKDB_VERSION "v0.5.2-dev2133"
14
+ #define DUCKDB_SOURCE_ID "28c054b759"
15
+ #define DUCKDB_VERSION "v0.5.2-dev2164"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //