duckdb 0.3.3-dev821.0 → 0.3.3-dev839.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.3-dev821.0",
4
+ "version": "0.3.3-dev839.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -15930,7 +15930,7 @@ bool LocalFileSystem::FileExists(const string &filename) {
15930
15930
  const wchar_t *wpath = unicode_path.c_str();
15931
15931
  if (_waccess(wpath, 0) == 0) {
15932
15932
  struct _stat64i32 status;
15933
- _wstat(wpath, &status);
15933
+ _wstat64i32(wpath, &status);
15934
15934
  if (status.st_size > 0) {
15935
15935
  return true;
15936
15936
  }
@@ -15942,7 +15942,7 @@ bool LocalFileSystem::IsPipe(const string &filename) {
15942
15942
  const wchar_t *wpath = unicode_path.c_str();
15943
15943
  if (_waccess(wpath, 0) == 0) {
15944
15944
  struct _stat64i32 status;
15945
- _wstat(wpath, &status);
15945
+ _wstat64i32(wpath, &status);
15946
15946
  if (status.st_size == 0) {
15947
15947
  return true;
15948
15948
  }
@@ -90184,17 +90184,75 @@ struct MD5Operator {
90184
90184
  }
90185
90185
  };
90186
90186
 
90187
+ struct MD5Number128Operator {
90188
+ template <class INPUT_TYPE, class RESULT_TYPE>
90189
+ static RESULT_TYPE Operation(INPUT_TYPE input) {
90190
+ data_t digest[MD5Context::MD5_HASH_LENGTH_BINARY];
90191
+
90192
+ MD5Context context;
90193
+ context.Add(input);
90194
+ context.Finish(digest);
90195
+ return *reinterpret_cast<hugeint_t *>(digest);
90196
+ }
90197
+ };
90198
+
90199
+ template <bool lower>
90200
+ struct MD5Number64Operator {
90201
+ template <class INPUT_TYPE, class RESULT_TYPE>
90202
+ static RESULT_TYPE Operation(INPUT_TYPE input) {
90203
+ data_t digest[MD5Context::MD5_HASH_LENGTH_BINARY];
90204
+
90205
+ MD5Context context;
90206
+ context.Add(input);
90207
+ context.Finish(digest);
90208
+ return *reinterpret_cast<uint64_t *>(&digest[lower ? 8 : 0]);
90209
+ }
90210
+ };
90211
+
90187
90212
  static void MD5Function(DataChunk &args, ExpressionState &state, Vector &result) {
90188
90213
  auto &input = args.data[0];
90189
90214
 
90190
90215
  UnaryExecutor::ExecuteString<string_t, string_t, MD5Operator>(input, result, args.size());
90191
90216
  }
90192
90217
 
90218
+ static void MD5NumberFunction(DataChunk &args, ExpressionState &state, Vector &result) {
90219
+ auto &input = args.data[0];
90220
+
90221
+ UnaryExecutor::Execute<string_t, hugeint_t, MD5Number128Operator>(input, result, args.size());
90222
+ }
90223
+
90224
+ static void MD5NumberUpperFunction(DataChunk &args, ExpressionState &state, Vector &result) {
90225
+ auto &input = args.data[0];
90226
+
90227
+ UnaryExecutor::Execute<string_t, uint64_t, MD5Number64Operator<false>>(input, result, args.size());
90228
+ }
90229
+
90230
+ static void MD5NumberLowerFunction(DataChunk &args, ExpressionState &state, Vector &result) {
90231
+ auto &input = args.data[0];
90232
+
90233
+ UnaryExecutor::Execute<string_t, uint64_t, MD5Number64Operator<true>>(input, result, args.size());
90234
+ }
90235
+
90193
90236
  void MD5Fun::RegisterFunction(BuiltinFunctions &set) {
90194
90237
  set.AddFunction(ScalarFunction("md5", // name of the function
90195
90238
  {LogicalType::VARCHAR}, // argument list
90196
90239
  LogicalType::VARCHAR, // return type
90197
90240
  MD5Function)); // pointer to function implementation
90241
+
90242
+ set.AddFunction(ScalarFunction("md5_number", // name of the function
90243
+ {LogicalType::VARCHAR}, // argument list
90244
+ LogicalType::HUGEINT, // return type
90245
+ MD5NumberFunction)); // pointer to function implementation
90246
+
90247
+ set.AddFunction(ScalarFunction("md5_number_upper", // name of the function
90248
+ {LogicalType::VARCHAR}, // argument list
90249
+ LogicalType::UBIGINT, // return type
90250
+ MD5NumberUpperFunction)); // pointer to function implementation
90251
+
90252
+ set.AddFunction(ScalarFunction("md5_number_lower", // name of the function
90253
+ {LogicalType::VARCHAR}, // argument list
90254
+ LogicalType::UBIGINT, // return type
90255
+ MD5NumberLowerFunction)); // pointer to function implementation
90198
90256
  }
90199
90257
 
90200
90258
  } // namespace duckdb
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 "f36fbb32c"
15
- #define DUCKDB_VERSION "v0.3.3-dev821"
14
+ #define DUCKDB_SOURCE_ID "4d7d868d1"
15
+ #define DUCKDB_VERSION "v0.3.3-dev839"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //