duckdb 0.4.1-dev333.0 → 0.4.1-dev347.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.4.1-dev333.0",
4
+ "version": "0.4.1-dev347.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -1537,7 +1537,7 @@ public:
1537
1537
  }
1538
1538
 
1539
1539
  template <class T, class RETURN_TYPE = unique_ptr<T>, typename... ARGS>
1540
- RETURN_TYPE ReadSerializable(RETURN_TYPE default_value, ARGS &&... args) {
1540
+ RETURN_TYPE ReadSerializable(RETURN_TYPE default_value, ARGS &&...args) {
1541
1541
  if (field_count >= max_field_count) {
1542
1542
  // field is not there, read the default value
1543
1543
  return default_value;
@@ -1559,7 +1559,7 @@ public:
1559
1559
  }
1560
1560
 
1561
1561
  template <class T, class RETURN_TYPE = unique_ptr<T>, typename... ARGS>
1562
- RETURN_TYPE ReadRequiredSerializable(ARGS &&... args) {
1562
+ RETURN_TYPE ReadRequiredSerializable(ARGS &&...args) {
1563
1563
  if (field_count >= max_field_count) {
1564
1564
  // field is not there, read the default value
1565
1565
  throw SerializationException("Attempting to read mandatory field, but field is missing");
@@ -60105,14 +60105,21 @@ public:
60105
60105
  StreamingWindowState() : initialized(false) {
60106
60106
  }
60107
60107
 
60108
- void Initialize(DataChunk &input, const vector<unique_ptr<Expression>> &expressions) {
60108
+ void Initialize(Allocator &allocator, DataChunk &input, const vector<unique_ptr<Expression>> &expressions) {
60109
60109
  for (idx_t expr_idx = 0; expr_idx < expressions.size(); expr_idx++) {
60110
60110
  auto &expr = *expressions[expr_idx];
60111
60111
  switch (expr.GetExpressionType()) {
60112
60112
  case ExpressionType::WINDOW_FIRST_VALUE: {
60113
60113
  auto &wexpr = (BoundWindowExpression &)expr;
60114
- auto &ref = (BoundReferenceExpression &)*wexpr.children[0];
60115
- const_vectors.push_back(make_unique<Vector>(input.data[ref.index].GetValue(0)));
60114
+
60115
+ // Just execute the expression once
60116
+ ExpressionExecutor executor(allocator);
60117
+ executor.AddExpression(*wexpr.children[0]);
60118
+ DataChunk result;
60119
+ result.Initialize(allocator, {wexpr.children[0]->return_type});
60120
+ executor.Execute(input, result);
60121
+
60122
+ const_vectors.push_back(make_unique<Vector>(result.GetValue(0, 0)));
60116
60123
  break;
60117
60124
  }
60118
60125
  case ExpressionType::WINDOW_PERCENT_RANK: {
@@ -60149,7 +60156,8 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D
60149
60156
  auto &gstate = (StreamingWindowGlobalState &)gstate_p;
60150
60157
  auto &state = (StreamingWindowState &)state_p;
60151
60158
  if (!state.initialized) {
60152
- state.Initialize(input, select_list);
60159
+ auto &allocator = Allocator::Get(context.client);
60160
+ state.Initialize(allocator, input, select_list);
60153
60161
  }
60154
60162
  // Put payload columns in place
60155
60163
  for (idx_t col_idx = 0; col_idx < input.data.size(); col_idx++) {
@@ -121066,7 +121074,7 @@ inline std::string encode_url(const std::string &s) {
121066
121074
  for (size_t i = 0; s[i]; i++) {
121067
121075
  switch (s[i]) {
121068
121076
  case ' ': result += "%20"; break;
121069
- case '+': result += "%2B"; break;
121077
+ // case '+': result += "%2B"; break;
121070
121078
  case '\r': result += "%0D"; break;
121071
121079
  case '\n': result += "%0A"; break;
121072
121080
  case '\'': result += "%27"; break;
@@ -121112,7 +121120,12 @@ inline std::string decode_url(const std::string &s,
121112
121120
  int val = 0;
121113
121121
  if (from_hex_to_i(s, i + 1, 2, val)) {
121114
121122
  // 2 digits hex codes
121115
- result += static_cast<char>(val);
121123
+ if (static_cast<char>(val) == '+'){
121124
+ // We don't decode +
121125
+ result += "%2B";
121126
+ } else {
121127
+ result += static_cast<char>(val);
121128
+ }
121116
121129
  i += 2; // '00'
121117
121130
  } else {
121118
121131
  result += s[i];
@@ -122711,7 +122724,7 @@ inline void parse_query_text(const std::string &s, Params &params) {
122711
122724
  });
122712
122725
 
122713
122726
  if (!key.empty()) {
122714
- params.emplace(decode_url(key, true), decode_url(val, true));
122727
+ params.emplace(decode_url(key, true), decode_url(val, false));
122715
122728
  }
122716
122729
  });
122717
122730
  }
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 "cdbc688c1"
15
- #define DUCKDB_VERSION "v0.4.1-dev333"
14
+ #define DUCKDB_SOURCE_ID "81c2ea292"
15
+ #define DUCKDB_VERSION "v0.4.1-dev347"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //