duckdb 0.6.2-dev1017.0 → 0.6.2-dev1025.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.2-dev1017.0",
5
+ "version": "0.6.2-dev1025.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -1050,22 +1050,23 @@ static bool TryIntegerCast(const char *buf, idx_t len, T &result, bool strict) {
1050
1050
  }
1051
1051
  return IntegerCastLoop<T, true, ALLOW_EXPONENT, OP>(buf, len, result, strict);
1052
1052
  }
1053
- // If it starts with 0x or 0X, we parse it as a hex value
1054
- else if (len > 1 && *buf == '0' && (buf[1] == 'x' || buf[1] == 'X')) {
1055
- // Skip the 0x
1056
- buf++;
1057
- len--;
1058
- return IntegerHexCastLoop<T, false, false, OP>(buf, len, result, strict);
1059
- }
1060
- // If it starts with 0b or 0B, we parse it as a binary value
1061
- else if (len > 1 && *buf == '0' && (buf[1] == 'b' || buf[1] == 'B')) {
1062
- // Skip the 0b
1063
- buf++;
1064
- len--;
1065
- return IntegerBinaryCastLoop<T, false, false, OP>(buf, len, result, strict);
1066
- } else {
1067
- return IntegerCastLoop<T, false, ALLOW_EXPONENT, OP>(buf, len, result, strict);
1053
+ if (len > 1 && *buf == '0') {
1054
+ if (buf[1] == 'x' || buf[1] == 'X') {
1055
+ // If it starts with 0x or 0X, we parse it as a hex value
1056
+ buf++;
1057
+ len--;
1058
+ return IntegerHexCastLoop<T, false, false, OP>(buf, len, result, strict);
1059
+ } else if (buf[1] == 'b' || buf[1] == 'B') {
1060
+ // If it starts with 0b or 0B, we parse it as a binary value
1061
+ buf++;
1062
+ len--;
1063
+ return IntegerBinaryCastLoop<T, false, false, OP>(buf, len, result, strict);
1064
+ } else if (strict && StringUtil::CharacterIsDigit(buf[1])) {
1065
+ // leading zeros are not allowed in strict mode
1066
+ return false;
1067
+ }
1068
1068
  }
1069
+ return IntegerCastLoop<T, false, ALLOW_EXPONENT, OP>(buf, len, result, strict);
1069
1070
  }
1070
1071
 
1071
1072
  template <typename T, bool IS_SIGNED = true>
@@ -1170,6 +1171,12 @@ static bool TryDoubleCast(const char *buf, idx_t len, T &result, bool strict) {
1170
1171
  buf++;
1171
1172
  len--;
1172
1173
  }
1174
+ if (strict && len >= 2) {
1175
+ if (buf[0] == '0' && StringUtil::CharacterIsDigit(buf[1])) {
1176
+ // leading zeros are not allowed in strict mode
1177
+ return false;
1178
+ }
1179
+ }
1173
1180
  auto endptr = buf + len;
1174
1181
  auto parse_result = duckdb_fast_float::from_chars(buf, buf + len, result);
1175
1182
  if (parse_result.ec != std::errc()) {
@@ -144,7 +144,6 @@ struct UniqueFunctor {
144
144
 
145
145
  template <class FUNCTION_FUNCTOR, bool IS_AGGR = false>
146
146
  static void ListAggregatesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
147
-
148
147
  auto count = args.size();
149
148
  Vector &lists = args.data[0];
150
149
 
@@ -167,6 +166,7 @@ static void ListAggregatesFunction(DataChunk &args, ExpressionState &state, Vect
167
166
 
168
167
  auto lists_size = ListVector::GetListSize(lists);
169
168
  auto &child_vector = ListVector::GetEntry(lists);
169
+ child_vector.Flatten(lists_size);
170
170
 
171
171
  UnifiedVectorFormat child_data;
172
172
  child_vector.ToUnifiedFormat(lists_size, child_data);
@@ -216,7 +216,7 @@ static void ListAggregatesFunction(DataChunk &args, ExpressionState &state, Vect
216
216
  // states vector is full, update
217
217
  if (states_idx == STANDARD_VECTOR_SIZE) {
218
218
  // update the aggregate state(s)
219
- Vector slice = Vector(child_vector, sel_vector, states_idx);
219
+ Vector slice(child_vector, sel_vector, states_idx);
220
220
  aggr.function.update(&slice, aggr_input_data, 1, state_vector_update, states_idx);
221
221
 
222
222
  // reset values
@@ -232,7 +232,7 @@ static void ListAggregatesFunction(DataChunk &args, ExpressionState &state, Vect
232
232
 
233
233
  // update the remaining elements of the last list(s)
234
234
  if (states_idx != 0) {
235
- Vector slice = Vector(child_vector, sel_vector, states_idx);
235
+ Vector slice(child_vector, sel_vector, states_idx);
236
236
  aggr.function.update(&slice, aggr_input_data, 1, state_vector_update, states_idx);
237
237
  }
238
238
 
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.6.2-dev1017"
2
+ #define DUCKDB_VERSION "0.6.2-dev1025"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "b056090a0c"
5
+ #define DUCKDB_SOURCE_ID "6e671f398d"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"