duckdb 0.3.2-dev292.0 → 0.3.2-dev303.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.2-dev292.0",
4
+ "version": "0.3.2-dev303.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -81826,7 +81826,7 @@ int64_t DatePart::EpochOperator::Operation(interval_t input) {
81826
81826
 
81827
81827
  template <>
81828
81828
  int64_t DatePart::EpochOperator::Operation(dtime_t input) {
81829
- return SecondsOperator::Operation<dtime_t, int64_t>(input);
81829
+ return input.micros / Interval::MICROS_PER_SEC;
81830
81830
  }
81831
81831
 
81832
81832
  template <>
@@ -88783,6 +88783,7 @@ struct CurrvalFun {
88783
88783
 
88784
88784
 
88785
88785
 
88786
+
88786
88787
  namespace duckdb {
88787
88788
 
88788
88789
  struct NextvalBindData : public FunctionData {
@@ -88815,9 +88816,12 @@ struct NextSequenceValueOperator {
88815
88816
  static int64_t Operation(Transaction &transaction, SequenceCatalogEntry *seq) {
88816
88817
  lock_guard<mutex> seqlock(seq->lock);
88817
88818
  int64_t result;
88819
+ result = seq->counter;
88820
+ bool overflow = !TryAddOperator::Operation(seq->counter, seq->increment, seq->counter);
88818
88821
  if (seq->cycle) {
88819
- result = seq->counter;
88820
- seq->counter += seq->increment;
88822
+ if (overflow) {
88823
+ throw SequenceException("overflow in sequence");
88824
+ }
88821
88825
  if (result < seq->min_value) {
88822
88826
  result = seq->max_value;
88823
88827
  seq->counter = seq->max_value + seq->increment;
@@ -88826,13 +88830,11 @@ struct NextSequenceValueOperator {
88826
88830
  seq->counter = seq->min_value + seq->increment;
88827
88831
  }
88828
88832
  } else {
88829
- result = seq->counter;
88830
- seq->counter += seq->increment;
88831
- if (result < seq->min_value) {
88833
+ if (result < seq->min_value || (overflow && seq->increment < 0)) {
88832
88834
  throw SequenceException("nextval: reached minimum value of sequence \"%s\" (%lld)", seq->name,
88833
88835
  seq->min_value);
88834
88836
  }
88835
- if (result > seq->max_value) {
88837
+ if (result > seq->max_value || overflow) {
88836
88838
  throw SequenceException("nextval: reached maximum value of sequence \"%s\" (%lld)", seq->name,
88837
88839
  seq->max_value);
88838
88840
  }
package/src/duckdb.hpp CHANGED
@@ -10,8 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
10
10
 
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
- #define DUCKDB_SOURCE_ID "43a2bb05d"
14
- #define DUCKDB_VERSION "0.3.2-dev292"
13
+ #define DUCKDB_SOURCE_ID "b6c9a6f4e"
14
+ #define DUCKDB_VERSION "0.3.2-dev303"
15
15
  //===----------------------------------------------------------------------===//
16
16
  // DuckDB
17
17
  //