duckdb 0.7.2-dev2233.0 → 0.7.2-dev2320.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/binding.gyp +1 -0
- package/package.json +1 -1
- package/src/duckdb/src/catalog/catalog.cpp +18 -17
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +0 -4
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +0 -4
- package/src/duckdb/src/catalog/catalog_set.cpp +3 -3
- package/src/duckdb/src/common/adbc/adbc.cpp +441 -0
- package/src/duckdb/src/common/adbc/driver_manager.cpp +749 -0
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +1 -1
- package/src/duckdb/src/common/tree_renderer.cpp +3 -3
- package/src/duckdb/src/common/types/conflict_manager.cpp +2 -1
- package/src/duckdb/src/execution/column_binding_resolver.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +1 -1
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +5 -5
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +11 -10
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +9 -9
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +4 -4
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +7 -7
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +8 -9
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +20 -19
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +3 -3
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +25 -24
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +1 -1
- package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +2 -2
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +12 -6
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +10 -11
- package/src/duckdb/src/execution/operator/set/physical_union.cpp +2 -2
- package/src/duckdb/src/execution/physical_operator.cpp +13 -13
- package/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp +2 -4
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +5 -5
- package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +6 -7
- package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +2 -4
- package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_show_select.cpp +2 -4
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +3 -3
- package/src/duckdb/src/function/compression_config.cpp +9 -9
- package/src/duckdb/src/function/scalar/date/strftime.cpp +1 -1
- package/src/duckdb/src/function/table/copy_csv.cpp +5 -0
- package/src/duckdb/src/function/table/pragma_detailed_profiling_output.cpp +6 -5
- package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +7 -5
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_keywords.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_settings.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +1 -1
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +1 -1
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +1 -1
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +5 -5
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +1 -1
- package/src/duckdb/src/function/table/system/test_all_types.cpp +1 -1
- package/src/duckdb/src/function/table/table_scan.cpp +3 -4
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +1 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/adbc/adbc-init.hpp +37 -0
- package/src/duckdb/src/include/duckdb/common/adbc/adbc.h +1088 -0
- package/src/duckdb/src/include/duckdb/common/adbc/adbc.hpp +85 -0
- package/src/duckdb/src/include/duckdb/common/adbc/driver_manager.h +84 -0
- package/src/duckdb/src/include/duckdb/common/helper.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/conflict_manager.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/types.hpp +0 -1
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +7 -7
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_index_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_union.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +10 -9
- package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +4 -4
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +18 -17
- package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +14 -17
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +6 -6
- package/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp +4 -4
- package/src/duckdb/src/include/duckdb/planner/expression_binder/where_binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_function_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/table_binding.hpp +6 -5
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_basetableref.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_compress.hpp +3 -7
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_compress.hpp +3 -7
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_data_checkpointer.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +3 -3
- package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +3 -3
- package/src/duckdb/src/include/duckdb/transaction/commit_state.hpp +5 -5
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +3 -3
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +31 -30
- package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
- package/src/duckdb/src/main/client_context.cpp +1 -1
- package/src/duckdb/src/main/query_profiler.cpp +24 -22
- package/src/duckdb/src/parallel/executor.cpp +55 -49
- package/src/duckdb/src/parallel/meta_pipeline.cpp +5 -5
- package/src/duckdb/src/parallel/pipeline.cpp +43 -26
- package/src/duckdb/src/parallel/pipeline_executor.cpp +22 -22
- package/src/duckdb/src/planner/bind_context.cpp +67 -71
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +6 -7
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -8
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +3 -4
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +17 -18
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +16 -17
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +6 -5
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +9 -9
- package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +20 -18
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +1 -1
- package/src/duckdb/src/planner/binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder/index_binder.cpp +2 -1
- package/src/duckdb/src/planner/expression_binder/where_binder.cpp +3 -2
- package/src/duckdb/src/planner/operator/logical_create_table.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_delete.cpp +5 -5
- package/src/duckdb/src/planner/operator/logical_insert.cpp +6 -7
- package/src/duckdb/src/planner/operator/logical_update.cpp +6 -7
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -5
- package/src/duckdb/src/planner/table_binding.cpp +6 -5
- package/src/duckdb/src/storage/compression/bitpacking.cpp +5 -6
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +5 -6
- package/src/duckdb/src/storage/compression/fsst.cpp +3 -5
- package/src/duckdb/src/storage/compression/rle.cpp +4 -6
- package/src/duckdb/src/storage/data_table.cpp +27 -28
- package/src/duckdb/src/storage/local_storage.cpp +70 -68
- package/src/duckdb/src/storage/storage_manager.cpp +12 -13
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +2 -2
- package/src/duckdb/src/storage/table/column_data.cpp +2 -2
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +18 -6
- package/src/duckdb/src/storage/table/column_segment.cpp +23 -24
- package/src/duckdb/src/storage/table/row_group.cpp +3 -3
- package/src/duckdb/src/storage/table/row_group_collection.cpp +1 -1
- package/src/duckdb/src/storage/table/update_segment.cpp +15 -15
- package/src/duckdb/src/storage/wal_replay.cpp +1 -1
- package/src/duckdb/src/transaction/cleanup_state.cpp +10 -10
- package/src/duckdb/src/transaction/commit_state.cpp +19 -19
- package/src/duckdb/src/transaction/duck_transaction.cpp +7 -7
- package/src/duckdb/src/transaction/rollback_state.cpp +1 -1
- package/src/duckdb/src/transaction/undo_buffer.cpp +2 -1
- package/src/duckdb/ub_src_common_adbc.cpp +4 -0
- package/src/duckdb/src/include/duckdb/common/single_thread_ptr.hpp +0 -185
@@ -9,10 +9,10 @@
|
|
9
9
|
#pragma once
|
10
10
|
|
11
11
|
#include "duckdb/common/atomic.hpp"
|
12
|
-
#include "duckdb/common/unordered_set.hpp"
|
13
12
|
#include "duckdb/execution/physical_operator.hpp"
|
14
13
|
#include "duckdb/function/table_function.hpp"
|
15
14
|
#include "duckdb/parallel/task_scheduler.hpp"
|
15
|
+
#include "duckdb/common/reference_map.hpp"
|
16
16
|
|
17
17
|
namespace duckdb {
|
18
18
|
|
@@ -27,18 +27,18 @@ public:
|
|
27
27
|
|
28
28
|
public:
|
29
29
|
//! Duplicate eliminated join scan dependencies
|
30
|
-
|
30
|
+
reference_map_t<const PhysicalOperator, reference<Pipeline>> delim_join_dependencies;
|
31
31
|
|
32
32
|
public:
|
33
|
-
void SetPipelineSource(Pipeline &pipeline, PhysicalOperator
|
34
|
-
void SetPipelineSink(Pipeline &pipeline, PhysicalOperator
|
35
|
-
void SetPipelineOperators(Pipeline &pipeline, vector<PhysicalOperator
|
36
|
-
void AddPipelineOperator(Pipeline &pipeline, PhysicalOperator
|
37
|
-
shared_ptr<Pipeline> CreateChildPipeline(Executor &executor, Pipeline &pipeline, PhysicalOperator
|
38
|
-
|
39
|
-
PhysicalOperator
|
40
|
-
PhysicalOperator
|
41
|
-
vector<PhysicalOperator
|
33
|
+
void SetPipelineSource(Pipeline &pipeline, PhysicalOperator &op);
|
34
|
+
void SetPipelineSink(Pipeline &pipeline, optional_ptr<PhysicalOperator> op, idx_t sink_pipeline_count);
|
35
|
+
void SetPipelineOperators(Pipeline &pipeline, vector<reference<PhysicalOperator>> operators);
|
36
|
+
void AddPipelineOperator(Pipeline &pipeline, PhysicalOperator &op);
|
37
|
+
shared_ptr<Pipeline> CreateChildPipeline(Executor &executor, Pipeline &pipeline, PhysicalOperator &op);
|
38
|
+
|
39
|
+
optional_ptr<PhysicalOperator> GetPipelineSource(Pipeline &pipeline);
|
40
|
+
optional_ptr<PhysicalOperator> GetPipelineSink(Pipeline &pipeline);
|
41
|
+
vector<reference<PhysicalOperator>> GetPipelineOperators(Pipeline &pipeline);
|
42
42
|
};
|
43
43
|
|
44
44
|
//! The Pipeline class represents an execution pipeline starting at a
|
@@ -80,13 +80,14 @@ public:
|
|
80
80
|
bool GetProgress(double ¤t_percentage, idx_t &estimated_cardinality);
|
81
81
|
|
82
82
|
//! Returns a list of all operators (including source and sink) involved in this pipeline
|
83
|
-
vector<PhysicalOperator
|
83
|
+
vector<reference<PhysicalOperator>> GetOperators();
|
84
|
+
vector<const_reference<PhysicalOperator>> GetOperators() const;
|
84
85
|
|
85
|
-
PhysicalOperator
|
86
|
+
optional_ptr<PhysicalOperator> GetSink() {
|
86
87
|
return sink;
|
87
88
|
}
|
88
89
|
|
89
|
-
PhysicalOperator
|
90
|
+
optional_ptr<PhysicalOperator> GetSource() {
|
90
91
|
return source;
|
91
92
|
}
|
92
93
|
|
@@ -99,11 +100,11 @@ private:
|
|
99
100
|
//! Whether or not the pipeline has been initialized
|
100
101
|
atomic<bool> initialized;
|
101
102
|
//! The source of this pipeline
|
102
|
-
PhysicalOperator
|
103
|
+
optional_ptr<PhysicalOperator> source;
|
103
104
|
//! The chain of intermediate operators
|
104
|
-
vector<PhysicalOperator
|
105
|
+
vector<reference<PhysicalOperator>> operators;
|
105
106
|
//! The sink (i.e. destination) for data; this is e.g. a hash table to-be-built
|
106
|
-
PhysicalOperator
|
107
|
+
optional_ptr<PhysicalOperator> sink;
|
107
108
|
|
108
109
|
//! The global source state
|
109
110
|
unique_ptr<GlobalSourceState> source_state;
|
@@ -80,8 +80,8 @@ private:
|
|
80
80
|
bool requires_batch_index = false;
|
81
81
|
|
82
82
|
private:
|
83
|
-
void StartOperator(PhysicalOperator
|
84
|
-
void EndOperator(PhysicalOperator
|
83
|
+
void StartOperator(PhysicalOperator &op);
|
84
|
+
void EndOperator(PhysicalOperator &op, optional_ptr<DataChunk> chunk);
|
85
85
|
|
86
86
|
//! Reset the operator index to the first operator
|
87
87
|
void GoToSource(idx_t ¤t_idx, idx_t initial_idx);
|
@@ -10,8 +10,7 @@
|
|
10
10
|
|
11
11
|
#include "duckdb/catalog/catalog.hpp"
|
12
12
|
#include "duckdb/common/case_insensitive_map.hpp"
|
13
|
-
#include "duckdb/common/
|
14
|
-
#include "duckdb/common/unordered_set.hpp"
|
13
|
+
#include "duckdb/common/reference_map.hpp"
|
15
14
|
#include "duckdb/parser/expression/columnref_expression.hpp"
|
16
15
|
#include "duckdb/parser/parsed_expression.hpp"
|
17
16
|
#include "duckdb/parser/qualified_name_set.hpp"
|
@@ -52,7 +51,7 @@ public:
|
|
52
51
|
//! matching ones
|
53
52
|
vector<string> GetSimilarBindings(const string &column_name);
|
54
53
|
|
55
|
-
Binding
|
54
|
+
optional_ptr<Binding> GetCTEBinding(const string &ctename);
|
56
55
|
//! Binds a column expression to the base table. Returns the bound expression
|
57
56
|
//! or throws an exception if the column could not be bound.
|
58
57
|
BindResult BindColumn(ColumnRefExpression &colref, idx_t depth);
|
@@ -73,11 +72,11 @@ public:
|
|
73
72
|
void GenerateAllColumnExpressions(StarExpression &expr, vector<unique_ptr<ParsedExpression>> &new_select_list);
|
74
73
|
//! Check if the given (binding, column_name) is in the exclusion/replacement lists.
|
75
74
|
//! Returns true if it is in one of these lists, and should therefore be skipped.
|
76
|
-
bool CheckExclusionList(StarExpression &expr,
|
75
|
+
bool CheckExclusionList(StarExpression &expr, const string &column_name,
|
77
76
|
vector<unique_ptr<ParsedExpression>> &new_select_list,
|
78
77
|
case_insensitive_set_t &excluded_columns);
|
79
78
|
|
80
|
-
const vector<
|
79
|
+
const vector<reference<Binding>> &GetBindingsList() {
|
81
80
|
return bindings_list;
|
82
81
|
}
|
83
82
|
|
@@ -107,22 +106,20 @@ public:
|
|
107
106
|
void AddCTEBinding(idx_t index, const string &alias, const vector<string> &names, const vector<LogicalType> &types);
|
108
107
|
|
109
108
|
//! Add an implicit join condition (e.g. USING (x))
|
110
|
-
void AddUsingBinding(const string &column_name, UsingColumnSet
|
109
|
+
void AddUsingBinding(const string &column_name, UsingColumnSet &set);
|
111
110
|
|
112
111
|
void AddUsingBindingSet(unique_ptr<UsingColumnSet> set);
|
113
112
|
|
114
113
|
//! Returns any using column set for the given column name, or nullptr if there is none. On conflict (multiple using
|
115
114
|
//! column sets with the same name) throw an exception.
|
116
|
-
UsingColumnSet
|
115
|
+
optional_ptr<UsingColumnSet> GetUsingBinding(const string &column_name);
|
117
116
|
//! Returns any using column set for the given column name, or nullptr if there is none
|
118
|
-
UsingColumnSet
|
117
|
+
optional_ptr<UsingColumnSet> GetUsingBinding(const string &column_name, const string &binding_name);
|
119
118
|
//! Erase a using binding from the set of using bindings
|
120
|
-
void RemoveUsingBinding(const string &column_name, UsingColumnSet
|
121
|
-
//! Finds the using bindings for a given column. Returns true if any exists, false otherwise.
|
122
|
-
bool FindUsingBinding(const string &column_name, unordered_set<UsingColumnSet *> **using_columns);
|
119
|
+
void RemoveUsingBinding(const string &column_name, UsingColumnSet &set);
|
123
120
|
//! Transfer a using binding from one bind context to this bind context
|
124
|
-
void TransferUsingBinding(BindContext ¤t_context, UsingColumnSet
|
125
|
-
const string &binding, const string &using_column);
|
121
|
+
void TransferUsingBinding(BindContext ¤t_context, optional_ptr<UsingColumnSet> current_set,
|
122
|
+
UsingColumnSet &new_set, const string &binding, const string &using_column);
|
126
123
|
|
127
124
|
//! Fetch the actual column name from the given binding, or throws if none exists
|
128
125
|
//! This can be different from "column_name" because of case insensitivity
|
@@ -144,11 +141,11 @@ public:
|
|
144
141
|
//! Add all the bindings from a BindContext to this BindContext. The other BindContext is destroyed in the process.
|
145
142
|
void AddContext(BindContext other);
|
146
143
|
//! For semi and anti joins we remove the binding context of the right table after binding the condition.
|
147
|
-
void RemoveContext(vector<
|
144
|
+
void RemoveContext(vector<reference<Binding>> &other_bindings_list);
|
148
145
|
|
149
146
|
//! Gets a binding of the specified name. Returns a nullptr and sets the out_error if the binding could not be
|
150
147
|
//! found.
|
151
|
-
Binding
|
148
|
+
optional_ptr<Binding> GetBinding(const string &name, string &out_error);
|
152
149
|
|
153
150
|
private:
|
154
151
|
void AddBinding(const string &alias, unique_ptr<Binding> binding);
|
@@ -157,9 +154,9 @@ private:
|
|
157
154
|
//! The set of bindings
|
158
155
|
case_insensitive_map_t<unique_ptr<Binding>> bindings;
|
159
156
|
//! The list of bindings in insertion order
|
160
|
-
vector<
|
157
|
+
vector<reference<Binding>> bindings_list;
|
161
158
|
//! The set of columns used in USING join conditions
|
162
|
-
case_insensitive_map_t<
|
159
|
+
case_insensitive_map_t<reference_set_t<UsingColumnSet>> using_columns;
|
163
160
|
//! Using column sets
|
164
161
|
vector<unique_ptr<UsingColumnSet>> using_column_sets;
|
165
162
|
|
@@ -109,7 +109,7 @@ public:
|
|
109
109
|
unique_ptr<BoundCreateTableInfo> BindCreateTableInfo(unique_ptr<CreateInfo> info);
|
110
110
|
unique_ptr<BoundCreateTableInfo> BindCreateTableInfo(unique_ptr<CreateInfo> info, SchemaCatalogEntry &schema);
|
111
111
|
|
112
|
-
vector<unique_ptr<Expression>> BindCreateIndexExpressions(TableCatalogEntry
|
112
|
+
vector<unique_ptr<Expression>> BindCreateIndexExpressions(TableCatalogEntry &table, CreateIndexInfo &info);
|
113
113
|
|
114
114
|
void BindCreateViewInfo(CreateViewInfo &base);
|
115
115
|
SchemaCatalogEntry &BindSchema(CreateInfo &info);
|
@@ -164,8 +164,8 @@ public:
|
|
164
164
|
return FormatErrorRecursive(query_location, msg, values, params...);
|
165
165
|
}
|
166
166
|
|
167
|
-
unique_ptr<LogicalOperator> BindUpdateSet(LogicalOperator
|
168
|
-
UpdateSetInfo &set_info, TableCatalogEntry
|
167
|
+
unique_ptr<LogicalOperator> BindUpdateSet(LogicalOperator &op, unique_ptr<LogicalOperator> root,
|
168
|
+
UpdateSetInfo &set_info, TableCatalogEntry &table,
|
169
169
|
vector<PhysicalIndex> &columns);
|
170
170
|
void BindDoUpdateSetExpressions(const string &table_alias, LogicalInsert *insert, UpdateSetInfo &set_info,
|
171
171
|
TableCatalogEntry &table);
|
@@ -255,7 +255,7 @@ private:
|
|
255
255
|
BoundStatement Bind(AttachStatement &stmt);
|
256
256
|
BoundStatement Bind(DetachStatement &stmt);
|
257
257
|
|
258
|
-
BoundStatement BindReturning(vector<unique_ptr<ParsedExpression>> returning_list, TableCatalogEntry
|
258
|
+
BoundStatement BindReturning(vector<unique_ptr<ParsedExpression>> returning_list, TableCatalogEntry &table,
|
259
259
|
const string &alias, idx_t update_table_index,
|
260
260
|
unique_ptr<LogicalOperator> child_operator, BoundStatement result);
|
261
261
|
|
@@ -336,8 +336,8 @@ private:
|
|
336
336
|
bool TryFindBinding(const string &using_column, const string &join_side, string &result);
|
337
337
|
|
338
338
|
void AddUsingBindingSet(unique_ptr<UsingColumnSet> set);
|
339
|
-
string RetrieveUsingBinding(Binder ¤t_binder, UsingColumnSet
|
340
|
-
const string &
|
339
|
+
string RetrieveUsingBinding(Binder ¤t_binder, optional_ptr<UsingColumnSet> current_set,
|
340
|
+
const string &column_name, const string &join_side);
|
341
341
|
|
342
342
|
void AddCTEMap(CommonTableExpressionMap &cte_map);
|
343
343
|
|
@@ -19,8 +19,8 @@ class BoundColumnRefExpression;
|
|
19
19
|
//! The IndexBinder is responsible for binding an expression within an index statement
|
20
20
|
class IndexBinder : public ExpressionBinder {
|
21
21
|
public:
|
22
|
-
IndexBinder(Binder &binder, ClientContext &context, TableCatalogEntry
|
23
|
-
CreateIndexInfo
|
22
|
+
IndexBinder(Binder &binder, ClientContext &context, optional_ptr<TableCatalogEntry> table = nullptr,
|
23
|
+
optional_ptr<CreateIndexInfo> info = nullptr);
|
24
24
|
|
25
25
|
protected:
|
26
26
|
BindResult BindExpression(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth,
|
@@ -29,8 +29,8 @@ protected:
|
|
29
29
|
|
30
30
|
private:
|
31
31
|
// only for WAL replay
|
32
|
-
TableCatalogEntry
|
33
|
-
CreateIndexInfo
|
32
|
+
optional_ptr<TableCatalogEntry> table;
|
33
|
+
optional_ptr<CreateIndexInfo> info;
|
34
34
|
};
|
35
35
|
|
36
36
|
} // namespace duckdb
|
@@ -17,7 +17,7 @@ class ColumnAliasBinder;
|
|
17
17
|
//! The WHERE binder is responsible for binding an expression within the WHERE clause of a SQL statement
|
18
18
|
class WhereBinder : public ExpressionBinder {
|
19
19
|
public:
|
20
|
-
WhereBinder(Binder &binder, ClientContext &context, ColumnAliasBinder
|
20
|
+
WhereBinder(Binder &binder, ClientContext &context, optional_ptr<ColumnAliasBinder> column_alias_binder = nullptr);
|
21
21
|
|
22
22
|
protected:
|
23
23
|
BindResult BindExpression(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth,
|
@@ -28,7 +28,7 @@ protected:
|
|
28
28
|
private:
|
29
29
|
BindResult BindColumnRef(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth, bool root_expression);
|
30
30
|
|
31
|
-
ColumnAliasBinder
|
31
|
+
optional_ptr<ColumnAliasBinder> column_alias_binder;
|
32
32
|
};
|
33
33
|
|
34
34
|
} // namespace duckdb
|
@@ -19,11 +19,12 @@ public:
|
|
19
19
|
static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_INVALID;
|
20
20
|
|
21
21
|
public:
|
22
|
-
LogicalCreate(LogicalOperatorType type, unique_ptr<CreateInfo> info,
|
22
|
+
LogicalCreate(LogicalOperatorType type, unique_ptr<CreateInfo> info,
|
23
|
+
optional_ptr<SchemaCatalogEntry> schema = nullptr)
|
23
24
|
: LogicalOperator(type), schema(schema), info(std::move(info)) {
|
24
25
|
}
|
25
26
|
|
26
|
-
SchemaCatalogEntry
|
27
|
+
optional_ptr<SchemaCatalogEntry> schema;
|
27
28
|
unique_ptr<CreateInfo> info;
|
28
29
|
|
29
30
|
public:
|
@@ -18,12 +18,12 @@ public:
|
|
18
18
|
static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_CREATE_TABLE;
|
19
19
|
|
20
20
|
public:
|
21
|
-
LogicalCreateTable(SchemaCatalogEntry
|
21
|
+
LogicalCreateTable(SchemaCatalogEntry &schema, unique_ptr<BoundCreateTableInfo> info)
|
22
22
|
: LogicalOperator(LogicalOperatorType::LOGICAL_CREATE_TABLE), schema(schema), info(std::move(info)) {
|
23
23
|
}
|
24
24
|
|
25
25
|
//! Schema to insert to
|
26
|
-
SchemaCatalogEntry
|
26
|
+
SchemaCatalogEntry &schema;
|
27
27
|
//! Create Table information
|
28
28
|
unique_ptr<BoundCreateTableInfo> info;
|
29
29
|
|
@@ -18,9 +18,9 @@ public:
|
|
18
18
|
static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_DELETE;
|
19
19
|
|
20
20
|
public:
|
21
|
-
explicit LogicalDelete(TableCatalogEntry
|
21
|
+
explicit LogicalDelete(TableCatalogEntry &table, idx_t table_index);
|
22
22
|
|
23
|
-
TableCatalogEntry
|
23
|
+
TableCatalogEntry &table;
|
24
24
|
idx_t table_index;
|
25
25
|
bool return_chunk;
|
26
26
|
|
@@ -23,7 +23,7 @@ public:
|
|
23
23
|
static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_INSERT;
|
24
24
|
|
25
25
|
public:
|
26
|
-
LogicalInsert(TableCatalogEntry
|
26
|
+
LogicalInsert(TableCatalogEntry &table, idx_t table_index);
|
27
27
|
|
28
28
|
vector<vector<unique_ptr<Expression>>> insert_values;
|
29
29
|
//! The insertion map ([table_index -> index in result, or DConstants::INVALID_INDEX if not specified])
|
@@ -31,7 +31,7 @@ public:
|
|
31
31
|
//! The expected types for the INSERT statement (obtained from the column types)
|
32
32
|
vector<LogicalType> expected_types;
|
33
33
|
//! The base table to insert into
|
34
|
-
TableCatalogEntry
|
34
|
+
TableCatalogEntry &table;
|
35
35
|
idx_t table_index;
|
36
36
|
//! if returning option is used, return actual chunk to projection
|
37
37
|
bool return_chunk;
|
@@ -18,10 +18,10 @@ public:
|
|
18
18
|
static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_UPDATE;
|
19
19
|
|
20
20
|
public:
|
21
|
-
explicit LogicalUpdate(TableCatalogEntry
|
21
|
+
explicit LogicalUpdate(TableCatalogEntry &table);
|
22
22
|
|
23
23
|
//! The base table to update
|
24
|
-
TableCatalogEntry
|
24
|
+
TableCatalogEntry &table;
|
25
25
|
//! table catalog index
|
26
26
|
idx_t table_index;
|
27
27
|
//! if returning option is used, return the update chunk
|
@@ -14,11 +14,12 @@ namespace duckdb {
|
|
14
14
|
class CatalogEntry;
|
15
15
|
|
16
16
|
struct BoundCreateFunctionInfo {
|
17
|
-
explicit BoundCreateFunctionInfo(unique_ptr<CreateInfo> base)
|
17
|
+
explicit BoundCreateFunctionInfo(SchemaCatalogEntry &schema, unique_ptr<CreateInfo> base)
|
18
|
+
: schema(schema), base(std::move(base)) {
|
18
19
|
}
|
19
20
|
|
20
21
|
//! The schema to create the table in
|
21
|
-
SchemaCatalogEntry
|
22
|
+
SchemaCatalogEntry &schema;
|
22
23
|
//! The base CreateInfo object
|
23
24
|
unique_ptr<CreateInfo> base;
|
24
25
|
|
@@ -23,12 +23,13 @@ namespace duckdb {
|
|
23
23
|
class CatalogEntry;
|
24
24
|
|
25
25
|
struct BoundCreateTableInfo {
|
26
|
-
explicit BoundCreateTableInfo(unique_ptr<CreateInfo> base_p)
|
26
|
+
explicit BoundCreateTableInfo(SchemaCatalogEntry &schema, unique_ptr<CreateInfo> base_p)
|
27
|
+
: schema(schema), base(std::move(base_p)) {
|
27
28
|
D_ASSERT(base);
|
28
29
|
}
|
29
30
|
|
30
31
|
//! The schema to create the table in
|
31
|
-
SchemaCatalogEntry
|
32
|
+
SchemaCatalogEntry &schema;
|
32
33
|
//! The base CreateInfo object
|
33
34
|
unique_ptr<CreateInfo> base;
|
34
35
|
//! Column dependency manager of the table
|
@@ -54,7 +54,7 @@ public:
|
|
54
54
|
bool HasMatchingBinding(const string &column_name);
|
55
55
|
virtual string ColumnNotFoundError(const string &column_name) const;
|
56
56
|
virtual BindResult Bind(ColumnRefExpression &colref, idx_t depth);
|
57
|
-
virtual StandardEntry
|
57
|
+
virtual optional_ptr<StandardEntry> GetStandardEntry();
|
58
58
|
};
|
59
59
|
|
60
60
|
struct EntryBinding : public Binding {
|
@@ -64,24 +64,25 @@ public:
|
|
64
64
|
StandardEntry &entry;
|
65
65
|
|
66
66
|
public:
|
67
|
-
StandardEntry
|
67
|
+
optional_ptr<StandardEntry> GetStandardEntry() override;
|
68
68
|
};
|
69
69
|
|
70
70
|
//! TableBinding is exactly like the Binding, except it keeps track of which columns were bound in the linked LogicalGet
|
71
71
|
//! node for projection pushdown purposes.
|
72
72
|
struct TableBinding : public Binding {
|
73
73
|
TableBinding(const string &alias, vector<LogicalType> types, vector<string> names,
|
74
|
-
vector<column_t> &bound_column_ids, StandardEntry
|
74
|
+
vector<column_t> &bound_column_ids, optional_ptr<StandardEntry> entry, idx_t index,
|
75
|
+
bool add_row_id = false);
|
75
76
|
|
76
77
|
//! A reference to the set of bound column ids
|
77
78
|
vector<column_t> &bound_column_ids;
|
78
79
|
//! The underlying catalog entry (if any)
|
79
|
-
StandardEntry
|
80
|
+
optional_ptr<StandardEntry> entry;
|
80
81
|
|
81
82
|
public:
|
82
83
|
unique_ptr<ParsedExpression> ExpandGeneratedColumn(const string &column_name);
|
83
84
|
BindResult Bind(ColumnRefExpression &colref, idx_t depth) override;
|
84
|
-
StandardEntry
|
85
|
+
optional_ptr<StandardEntry> GetStandardEntry() override;
|
85
86
|
string ColumnNotFoundError(const string &column_name) const override;
|
86
87
|
// These are columns that are present in the name_map, appearing in the order that they're bound
|
87
88
|
const vector<column_t> &GetBoundColumnIds() const;
|
@@ -20,11 +20,11 @@ public:
|
|
20
20
|
static constexpr const TableReferenceType TYPE = TableReferenceType::BASE_TABLE;
|
21
21
|
|
22
22
|
public:
|
23
|
-
BoundBaseTableRef(TableCatalogEntry
|
23
|
+
BoundBaseTableRef(TableCatalogEntry &table, unique_ptr<LogicalOperator> get)
|
24
24
|
: BoundTableRef(TableReferenceType::BASE_TABLE), table(table), get(std::move(get)) {
|
25
25
|
}
|
26
26
|
|
27
|
-
TableCatalogEntry
|
27
|
+
TableCatalogEntry &table;
|
28
28
|
unique_ptr<LogicalOperator> get;
|
29
29
|
};
|
30
30
|
} // namespace duckdb
|
@@ -33,12 +33,8 @@ public:
|
|
33
33
|
using CHIMP_TYPE = typename ChimpType<T>::type;
|
34
34
|
|
35
35
|
explicit ChimpCompressionState(ColumnDataCheckpointer &checkpointer, ChimpAnalyzeState<T> *analyze_state)
|
36
|
-
: checkpointer(checkpointer)
|
37
|
-
|
38
|
-
auto &db = checkpointer.GetDatabase();
|
39
|
-
auto &type = checkpointer.GetType();
|
40
|
-
auto &config = DBConfig::GetConfig(db);
|
41
|
-
function = config.GetCompressionFunction(CompressionType::COMPRESSION_CHIMP, type.InternalType());
|
36
|
+
: checkpointer(checkpointer),
|
37
|
+
function(checkpointer.GetCompressionFunction(CompressionType::COMPRESSION_CHIMP)) {
|
42
38
|
CreateEmptySegment(checkpointer.GetRowGroup().start);
|
43
39
|
|
44
40
|
// These buffers are recycled for every group, so they only have to be set once
|
@@ -48,7 +44,7 @@ public:
|
|
48
44
|
}
|
49
45
|
|
50
46
|
ColumnDataCheckpointer &checkpointer;
|
51
|
-
CompressionFunction
|
47
|
+
CompressionFunction &function;
|
52
48
|
unique_ptr<ColumnSegment> current_segment;
|
53
49
|
BufferHandle handle;
|
54
50
|
idx_t group_idx = 0;
|
@@ -57,12 +57,8 @@ public:
|
|
57
57
|
};
|
58
58
|
|
59
59
|
explicit PatasCompressionState(ColumnDataCheckpointer &checkpointer, PatasAnalyzeState<T> *analyze_state)
|
60
|
-
: checkpointer(checkpointer)
|
61
|
-
|
62
|
-
auto &db = checkpointer.GetDatabase();
|
63
|
-
auto &type = checkpointer.GetType();
|
64
|
-
auto &config = DBConfig::GetConfig(db);
|
65
|
-
function = config.GetCompressionFunction(CompressionType::COMPRESSION_PATAS, type.InternalType());
|
60
|
+
: checkpointer(checkpointer),
|
61
|
+
function(checkpointer.GetCompressionFunction(CompressionType::COMPRESSION_PATAS)) {
|
66
62
|
CreateEmptySegment(checkpointer.GetRowGroup().start);
|
67
63
|
|
68
64
|
state.data_ptr = (void *)this;
|
@@ -71,7 +67,7 @@ public:
|
|
71
67
|
}
|
72
68
|
|
73
69
|
ColumnDataCheckpointer &checkpointer;
|
74
|
-
CompressionFunction
|
70
|
+
CompressionFunction &function;
|
75
71
|
unique_ptr<ColumnSegment> current_segment;
|
76
72
|
BufferHandle handle;
|
77
73
|
idx_t group_idx = 0;
|
@@ -105,7 +105,7 @@ public:
|
|
105
105
|
//! Merge a row group collection into the transaction-local storage
|
106
106
|
void LocalMerge(ClientContext &context, RowGroupCollection &collection);
|
107
107
|
//! Creates an optimistic writer for this table - used for optimistically writing parallel appends
|
108
|
-
OptimisticDataWriter
|
108
|
+
OptimisticDataWriter &CreateOptimisticWriter(ClientContext &context);
|
109
109
|
|
110
110
|
//! Delete the entries with the specified row identifier from the table
|
111
111
|
idx_t Delete(TableCatalogEntry &table, ClientContext &context, Vector &row_ids, idx_t count);
|
@@ -27,6 +27,7 @@ public:
|
|
27
27
|
ColumnCheckpointState &GetCheckpointState();
|
28
28
|
|
29
29
|
void Checkpoint(vector<SegmentNode<ColumnSegment>> nodes);
|
30
|
+
CompressionFunction &GetCompressionFunction(CompressionType type);
|
30
31
|
|
31
32
|
private:
|
32
33
|
void ScanSegments(const std::function<void(Vector &, idx_t)> &callback);
|
@@ -42,7 +43,7 @@ private:
|
|
42
43
|
bool is_validity;
|
43
44
|
Vector intermediate;
|
44
45
|
vector<SegmentNode<ColumnSegment>> nodes;
|
45
|
-
vector<CompressionFunction
|
46
|
+
vector<optional_ptr<CompressionFunction>> compression_functions;
|
46
47
|
ColumnCheckpointInfo &checkpoint_info;
|
47
48
|
};
|
48
49
|
|
@@ -48,7 +48,7 @@ public:
|
|
48
48
|
//! The column segment type (transient or persistent)
|
49
49
|
ColumnSegmentType segment_type;
|
50
50
|
//! The compression function
|
51
|
-
CompressionFunction
|
51
|
+
reference<CompressionFunction> function;
|
52
52
|
//! The statistics for the segment
|
53
53
|
SegmentStatistics stats;
|
54
54
|
//! The block that this segment relates to
|
@@ -124,7 +124,7 @@ public:
|
|
124
124
|
|
125
125
|
public:
|
126
126
|
ColumnSegment(DatabaseInstance &db, shared_ptr<BlockHandle> block, LogicalType type, ColumnSegmentType segment_type,
|
127
|
-
idx_t start, idx_t count, CompressionFunction
|
127
|
+
idx_t start, idx_t count, CompressionFunction &function, BaseStatistics statistics,
|
128
128
|
block_id_t block_id, idx_t offset, idx_t segment_size);
|
129
129
|
ColumnSegment(ColumnSegment &other, idx_t start);
|
130
130
|
|
@@ -120,7 +120,7 @@ public:
|
|
120
120
|
void RevertAppend(idx_t start);
|
121
121
|
|
122
122
|
//! Delete the given set of rows in the version manager
|
123
|
-
idx_t Delete(TransactionData transaction, DataTable
|
123
|
+
idx_t Delete(TransactionData transaction, DataTable &table, row_t *row_ids, idx_t count);
|
124
124
|
|
125
125
|
RowGroupWriteData WriteToDisk(PartialBlockManager &manager, const vector<CompressionType> &compression_types);
|
126
126
|
RowGroupPointer Checkpoint(RowGroupWriter &writer, TableStatistics &global_stats);
|
@@ -77,7 +77,7 @@ public:
|
|
77
77
|
|
78
78
|
void RemoveFromIndexes(TableIndexList &indexes, Vector &row_identifiers, idx_t count);
|
79
79
|
|
80
|
-
idx_t Delete(TransactionData transaction, DataTable
|
80
|
+
idx_t Delete(TransactionData transaction, DataTable &table, row_t *ids, idx_t count);
|
81
81
|
void Update(TransactionData transaction, row_t *ids, const vector<PhysicalIndex> &column_ids, DataChunk &updates);
|
82
82
|
void UpdateColumn(TransactionData transaction, Vector &row_ids, const vector<column_t> &column_path,
|
83
83
|
DataChunk &updates);
|
@@ -42,9 +42,9 @@ public:
|
|
42
42
|
Vector &base_data);
|
43
43
|
void FetchRow(TransactionData transaction, idx_t row_id, Vector &result, idx_t result_idx);
|
44
44
|
|
45
|
-
void RollbackUpdate(UpdateInfo
|
46
|
-
void CleanupUpdateInternal(const StorageLockKey &lock, UpdateInfo
|
47
|
-
void CleanupUpdate(UpdateInfo
|
45
|
+
void RollbackUpdate(UpdateInfo &info);
|
46
|
+
void CleanupUpdateInternal(const StorageLockKey &lock, UpdateInfo &info);
|
47
|
+
void CleanupUpdate(UpdateInfo &info);
|
48
48
|
|
49
49
|
unique_ptr<BaseStatistics> GetStatistics();
|
50
50
|
StringHeap &GetStringHeap() {
|
@@ -77,7 +77,7 @@ public:
|
|
77
77
|
Vector &result);
|
78
78
|
typedef void (*fetch_row_function_t)(transaction_t start_time, transaction_t transaction_id, UpdateInfo *info,
|
79
79
|
idx_t row_idx, Vector &result, idx_t result_idx);
|
80
|
-
typedef void (*rollback_update_function_t)(UpdateInfo
|
80
|
+
typedef void (*rollback_update_function_t)(UpdateInfo &base_info, UpdateInfo &rollback_info);
|
81
81
|
typedef idx_t (*statistics_update_function_t)(UpdateSegment *segment, SegmentStatistics &stats, Vector &update,
|
82
82
|
idx_t count, SelectionVector &sel);
|
83
83
|
|
@@ -39,15 +39,15 @@ class TransactionManager;
|
|
39
39
|
class ReplayState {
|
40
40
|
public:
|
41
41
|
ReplayState(AttachedDatabase &db, ClientContext &context, Deserializer &source)
|
42
|
-
: db(db), context(context), catalog(db.GetCatalog()), source(source),
|
43
|
-
|
42
|
+
: db(db), context(context), catalog(db.GetCatalog()), source(source), deserialize_only(false),
|
43
|
+
checkpoint_id(INVALID_BLOCK) {
|
44
44
|
}
|
45
45
|
|
46
46
|
AttachedDatabase &db;
|
47
47
|
ClientContext &context;
|
48
48
|
Catalog &catalog;
|
49
49
|
Deserializer &source;
|
50
|
-
TableCatalogEntry
|
50
|
+
optional_ptr<TableCatalogEntry> current_table;
|
51
51
|
bool deserialize_only;
|
52
52
|
block_id_t checkpoint_id;
|
53
53
|
|
@@ -27,14 +27,14 @@ public:
|
|
27
27
|
|
28
28
|
private:
|
29
29
|
// data for index cleanup
|
30
|
-
DataTable
|
30
|
+
optional_ptr<DataTable> current_table;
|
31
31
|
DataChunk chunk;
|
32
32
|
row_t row_numbers[STANDARD_VECTOR_SIZE];
|
33
33
|
idx_t count;
|
34
34
|
|
35
35
|
private:
|
36
|
-
void CleanupDelete(DeleteInfo
|
37
|
-
void CleanupUpdate(UpdateInfo
|
36
|
+
void CleanupDelete(DeleteInfo &info);
|
37
|
+
void CleanupUpdate(UpdateInfo &info);
|
38
38
|
|
39
39
|
void Flush();
|
40
40
|
};
|
@@ -23,13 +23,13 @@ struct UpdateInfo;
|
|
23
23
|
|
24
24
|
class CommitState {
|
25
25
|
public:
|
26
|
-
explicit CommitState(ClientContext &context, transaction_t commit_id, WriteAheadLog
|
26
|
+
explicit CommitState(ClientContext &context, transaction_t commit_id, optional_ptr<WriteAheadLog> log = nullptr);
|
27
27
|
|
28
|
-
WriteAheadLog
|
28
|
+
optional_ptr<WriteAheadLog> log;
|
29
29
|
transaction_t commit_id;
|
30
30
|
UndoFlags current_op;
|
31
31
|
|
32
|
-
DataTableInfo
|
32
|
+
optional_ptr<DataTableInfo> current_table_info;
|
33
33
|
idx_t row_identifiers[STANDARD_VECTOR_SIZE];
|
34
34
|
|
35
35
|
unique_ptr<DataChunk> delete_chunk;
|
@@ -47,8 +47,8 @@ private:
|
|
47
47
|
void SwitchTable(DataTableInfo *table, UndoFlags new_op);
|
48
48
|
|
49
49
|
void WriteCatalogEntry(CatalogEntry &entry, data_ptr_t extra_data);
|
50
|
-
void WriteDelete(DeleteInfo
|
51
|
-
void WriteUpdate(UpdateInfo
|
50
|
+
void WriteDelete(DeleteInfo &info);
|
51
|
+
void WriteUpdate(UpdateInfo &info);
|
52
52
|
|
53
53
|
void AppendRowId(row_t rowid);
|
54
54
|
};
|