duckdb 0.6.1-dev40.0 → 0.6.1-dev48.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.6.1-dev40.0",
5
+ "version": "0.6.1-dev48.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -6493,6 +6493,9 @@ AllocatedData::AllocatedData() : allocator(nullptr), pointer(nullptr), allocated
6493
6493
 
6494
6494
  AllocatedData::AllocatedData(Allocator &allocator, data_ptr_t pointer, idx_t allocated_size)
6495
6495
  : allocator(&allocator), pointer(pointer), allocated_size(allocated_size) {
6496
+ if (!pointer) {
6497
+ throw InternalException("AllocatedData object constructed with nullptr");
6498
+ }
6496
6499
  }
6497
6500
  AllocatedData::~AllocatedData() {
6498
6501
  Reset();
@@ -6584,11 +6587,19 @@ Allocator::~Allocator() {
6584
6587
 
6585
6588
  data_ptr_t Allocator::AllocateData(idx_t size) {
6586
6589
  D_ASSERT(size > 0);
6590
+ if (size >= MAXIMUM_ALLOC_SIZE) {
6591
+ D_ASSERT(false);
6592
+ throw InternalException("Requested allocation size of %llu is out of range - maximum allocation size is %llu",
6593
+ size, MAXIMUM_ALLOC_SIZE);
6594
+ }
6587
6595
  auto result = allocate_function(private_data.get(), size);
6588
6596
  #ifdef DEBUG
6589
6597
  D_ASSERT(private_data);
6590
6598
  private_data->debug_info->AllocateData(result, size);
6591
6599
  #endif
6600
+ if (!result) {
6601
+ throw std::bad_alloc();
6602
+ }
6592
6603
  return result;
6593
6604
  }
6594
6605
 
@@ -6608,11 +6619,20 @@ data_ptr_t Allocator::ReallocateData(data_ptr_t pointer, idx_t old_size, idx_t s
6608
6619
  if (!pointer) {
6609
6620
  return nullptr;
6610
6621
  }
6622
+ if (size >= MAXIMUM_ALLOC_SIZE) {
6623
+ D_ASSERT(false);
6624
+ throw InternalException(
6625
+ "Requested re-allocation size of %llu is out of range - maximum allocation size is %llu", size,
6626
+ MAXIMUM_ALLOC_SIZE);
6627
+ }
6611
6628
  auto new_pointer = reallocate_function(private_data.get(), pointer, old_size, size);
6612
6629
  #ifdef DEBUG
6613
6630
  D_ASSERT(private_data);
6614
6631
  private_data->debug_info->ReallocateData(pointer, new_pointer, old_size, size);
6615
6632
  #endif
6633
+ if (!new_pointer) {
6634
+ throw std::bad_alloc();
6635
+ }
6616
6636
  return new_pointer;
6617
6637
  }
6618
6638
 
@@ -182891,6 +182911,7 @@ bool Transformer::TransformGroupBy(duckdb_libpgquery::PGList *group, SelectNode
182891
182911
 
182892
182912
 
182893
182913
 
182914
+
182894
182915
  namespace duckdb {
182895
182916
 
182896
182917
  bool Transformer::TransformOrderBy(duckdb_libpgquery::PGList *order, vector<OrderByNode> &result) {
@@ -182924,6 +182945,13 @@ bool Transformer::TransformOrderBy(duckdb_libpgquery::PGList *order, vector<Orde
182924
182945
  throw NotImplementedException("Unimplemented order by type");
182925
182946
  }
182926
182947
  auto order_expression = TransformExpression(target);
182948
+ if (order_expression->GetExpressionClass() == ExpressionClass::STAR) {
182949
+ auto &star_expr = (StarExpression &)*order_expression;
182950
+ D_ASSERT(star_expr.relation_name.empty());
182951
+ if (star_expr.columns) {
182952
+ throw ParserException("COLUMNS expr is not supported in ORDER BY");
182953
+ }
182954
+ }
182927
182955
  result.emplace_back(type, null_order, move(order_expression));
182928
182956
  } else {
182929
182957
  throw NotImplementedException("ORDER BY list member type %d\n", temp->type);
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 "5f2be8bb26"
15
- #define DUCKDB_VERSION "v0.6.1-dev40"
14
+ #define DUCKDB_SOURCE_ID "b38b04433f"
15
+ #define DUCKDB_VERSION "v0.6.1-dev48"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -4276,6 +4276,9 @@ private:
4276
4276
  };
4277
4277
 
4278
4278
  class Allocator {
4279
+ // 281TB ought to be enough for anybody
4280
+ static constexpr const idx_t MAXIMUM_ALLOC_SIZE = 281474976710656ULL;
4281
+
4279
4282
  public:
4280
4283
  DUCKDB_API Allocator();
4281
4284
  DUCKDB_API Allocator(allocate_function_ptr_t allocate_function_p, free_function_ptr_t free_function_p,