duckdb 0.5.2-dev754.0 → 0.5.2-dev759.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.2-dev754.0",
4
+ "version": "0.5.2-dev759.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -101088,9 +101088,16 @@ void DatePartFun::RegisterFunction(BuiltinFunctions &set) {
101088
101088
 
101089
101089
 
101090
101090
 
101091
+
101091
101092
  namespace duckdb {
101092
101093
 
101093
101094
  struct DateSub {
101095
+ static int64_t SubtractMicros(timestamp_t startdate, timestamp_t enddate) {
101096
+ const auto start = Timestamp::GetEpochMicroSeconds(startdate);
101097
+ const auto end = Timestamp::GetEpochMicroSeconds(enddate);
101098
+ return SubtractOperatorOverflowCheck::Operation<int64_t, int64_t, int64_t>(end, start);
101099
+ }
101100
+
101094
101101
  template <class TA, class TB, class TR, class OP>
101095
101102
  static inline void BinaryExecute(Vector &left, Vector &right, Vector &result, idx_t count) {
101096
101103
  BinaryExecutor::ExecuteWithNulls<TA, TB, TR>(
@@ -101177,55 +101184,49 @@ struct DateSub {
101177
101184
  struct DayOperator {
101178
101185
  template <class TA, class TB, class TR>
101179
101186
  static inline TR Operation(TA startdate, TB enddate) {
101180
- return (Timestamp::GetEpochMicroSeconds(enddate) - Timestamp::GetEpochMicroSeconds(startdate)) /
101181
- Interval::MICROS_PER_DAY;
101187
+ return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_DAY;
101182
101188
  }
101183
101189
  };
101184
101190
 
101185
101191
  struct WeekOperator {
101186
101192
  template <class TA, class TB, class TR>
101187
101193
  static inline TR Operation(TA startdate, TB enddate) {
101188
- return (Timestamp::GetEpochMicroSeconds(enddate) - Timestamp::GetEpochMicroSeconds(startdate)) /
101189
- Interval::MICROS_PER_WEEK;
101194
+ return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_WEEK;
101190
101195
  }
101191
101196
  };
101192
101197
 
101193
101198
  struct MicrosecondsOperator {
101194
101199
  template <class TA, class TB, class TR>
101195
101200
  static inline TR Operation(TA startdate, TB enddate) {
101196
- return (Timestamp::GetEpochMicroSeconds(enddate) - Timestamp::GetEpochMicroSeconds(startdate));
101201
+ return SubtractMicros(startdate, enddate);
101197
101202
  }
101198
101203
  };
101199
101204
 
101200
101205
  struct MillisecondsOperator {
101201
101206
  template <class TA, class TB, class TR>
101202
101207
  static inline TR Operation(TA startdate, TB enddate) {
101203
- return (Timestamp::GetEpochMicroSeconds(enddate) - Timestamp::GetEpochMicroSeconds(startdate)) /
101204
- Interval::MICROS_PER_MSEC;
101208
+ return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_MSEC;
101205
101209
  }
101206
101210
  };
101207
101211
 
101208
101212
  struct SecondsOperator {
101209
101213
  template <class TA, class TB, class TR>
101210
101214
  static inline TR Operation(TA startdate, TB enddate) {
101211
- return (Timestamp::GetEpochMicroSeconds(enddate) - Timestamp::GetEpochMicroSeconds(startdate)) /
101212
- Interval::MICROS_PER_SEC;
101215
+ return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_SEC;
101213
101216
  }
101214
101217
  };
101215
101218
 
101216
101219
  struct MinutesOperator {
101217
101220
  template <class TA, class TB, class TR>
101218
101221
  static inline TR Operation(TA startdate, TB enddate) {
101219
- return (Timestamp::GetEpochMicroSeconds(enddate) - Timestamp::GetEpochMicroSeconds(startdate)) /
101220
- Interval::MICROS_PER_MINUTE;
101222
+ return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_MINUTE;
101221
101223
  }
101222
101224
  };
101223
101225
 
101224
101226
  struct HoursOperator {
101225
101227
  template <class TA, class TB, class TR>
101226
101228
  static inline TR Operation(TA startdate, TB enddate) {
101227
- return (Timestamp::GetEpochMicroSeconds(enddate) - Timestamp::GetEpochMicroSeconds(startdate)) /
101228
- Interval::MICROS_PER_HOUR;
101229
+ return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_HOUR;
101229
101230
  }
101230
101231
  };
101231
101232
  };
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 "e322d56ff"
15
- #define DUCKDB_VERSION "v0.5.2-dev754"
14
+ #define DUCKDB_SOURCE_ID "38c7ba098"
15
+ #define DUCKDB_VERSION "v0.5.2-dev759"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //