duckdb 0.8.2-dev37.0 → 0.8.2-dev72.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.8.2-dev37.0",
5
+ "version": "0.8.2-dev72.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -65,17 +65,15 @@ struct IcuBindData : public FunctionData {
65
65
 
66
66
  static int32_t ICUGetSortKey(icu::Collator &collator, string_t input, duckdb::unique_ptr<char[]> &buffer,
67
67
  int32_t &buffer_size) {
68
- int32_t string_size =
69
- collator.getSortKey(icu::UnicodeString::fromUTF8(icu::StringPiece(input.GetData(), input.GetSize())),
70
- (uint8_t *)buffer.get(), buffer_size);
68
+ icu::UnicodeString unicode_string =
69
+ icu::UnicodeString::fromUTF8(icu::StringPiece(input.GetData(), input.GetSize()));
70
+ int32_t string_size = collator.getSortKey(unicode_string, (uint8_t *)buffer.get(), buffer_size);
71
71
  if (string_size > buffer_size) {
72
72
  // have to resize the buffer
73
73
  buffer_size = string_size;
74
74
  buffer = duckdb::unique_ptr<char[]>(new char[buffer_size]);
75
75
 
76
- string_size =
77
- collator.getSortKey(icu::UnicodeString::fromUTF8(icu::StringPiece(input.GetData(), input.GetSize())),
78
- (uint8_t *)buffer.get(), buffer_size);
76
+ string_size = collator.getSortKey(unicode_string, (uint8_t *)buffer.get(), buffer_size);
79
77
  }
80
78
  return string_size;
81
79
  }
@@ -327,10 +327,11 @@ SinkResultType PhysicalBatchInsert::Sink(ExecutionContext &context, DataChunk &c
327
327
  // no collection yet: create a new one
328
328
  lstate.CreateNewCollection(table, insert_types);
329
329
  lstate.writer = &table.GetStorage().CreateOptimisticWriter(context.client);
330
- } else if (lstate.current_index != batch_index) {
330
+ }
331
+
332
+ if (lstate.current_index != batch_index) {
331
333
  throw InternalException("Current batch differs from batch - but NextBatch was not called!?");
332
334
  }
333
- lstate.current_index = batch_index;
334
335
 
335
336
  table.GetStorage().VerifyAppendConstraints(table, context.client, lstate.insert_chunk);
336
337
 
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.8.2-dev37"
2
+ #define DUCKDB_VERSION "0.8.2-dev72"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "69b0f15606"
5
+ #define DUCKDB_SOURCE_ID "3a48ba1822"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -17,11 +17,10 @@ PipelineExecutor::PipelineExecutor(ClientContext &context_p, Pipeline &pipeline_
17
17
  requires_batch_index = pipeline.sink->RequiresBatchIndex() && pipeline.source->SupportsBatchIndex();
18
18
  if (requires_batch_index) {
19
19
  auto &partition_info = local_sink_state->partition_info;
20
- if (!partition_info.batch_index.IsValid()) {
21
- // batch index is not set yet - initialize before fetching anything
22
- partition_info.batch_index = pipeline.RegisterNewBatchIndex();
23
- partition_info.min_batch_index = partition_info.batch_index;
24
- }
20
+ D_ASSERT(!partition_info.batch_index.IsValid());
21
+ // batch index is not set yet - initialize before fetching anything
22
+ partition_info.batch_index = pipeline.RegisterNewBatchIndex();
23
+ partition_info.min_batch_index = partition_info.batch_index;
25
24
  }
26
25
  }
27
26
  local_source_state = pipeline.source->GetLocalSourceState(context, *pipeline.source_state);
@@ -477,7 +476,8 @@ SourceResultType PipelineExecutor::FetchFromSource(DataChunk &result) {
477
476
  } else {
478
477
  next_batch_index =
479
478
  pipeline.source->GetBatchIndex(context, result, *pipeline.source_state, *local_source_state);
480
- next_batch_index += pipeline.base_batch_index;
479
+ // we start with the base_batch_index as a valid starting value. Make sure that next batch is called below
480
+ next_batch_index += pipeline.base_batch_index + 1;
481
481
  }
482
482
  auto &partition_info = local_sink_state->partition_info;
483
483
  if (next_batch_index != partition_info.batch_index.GetIndex()) {