duckdb 0.7.2-dev2507.0 → 0.7.2-dev2675.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 +7 -7
- package/package.json +2 -2
- package/src/connection.cpp +1 -1
- package/src/duckdb/extension/icu/icu-dateadd.cpp +3 -3
- package/src/duckdb/extension/icu/icu-datepart.cpp +3 -3
- package/src/duckdb/extension/icu/icu-datesub.cpp +2 -2
- package/src/duckdb/extension/icu/icu-datetrunc.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +3 -3
- package/src/duckdb/extension/icu/icu-list-range.cpp +2 -2
- package/src/duckdb/extension/icu/icu-makedate.cpp +1 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +4 -4
- package/src/duckdb/extension/icu/icu-table-range.cpp +2 -2
- package/src/duckdb/extension/icu/icu-timebucket.cpp +1 -1
- package/src/duckdb/extension/icu/icu-timezone.cpp +4 -4
- package/src/duckdb/extension/json/json-extension.cpp +6 -6
- package/src/duckdb/extension/parquet/parquet-extension.cpp +9 -8
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +3 -0
- package/src/duckdb/src/catalog/catalog.cpp +166 -127
- package/src/duckdb/src/catalog/catalog_entry/copy_function_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +90 -82
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +65 -67
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +4 -4
- package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +8 -8
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +10 -10
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +6 -6
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +6 -6
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +4 -4
- package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +9 -9
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +5 -5
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +23 -23
- package/src/duckdb/src/catalog/catalog_entry.cpp +27 -6
- package/src/duckdb/src/catalog/catalog_search_path.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_set.cpp +84 -87
- package/src/duckdb/src/catalog/catalog_transaction.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_functions.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_schemas.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_types.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_views.cpp +1 -1
- package/src/duckdb/src/catalog/dependency_list.cpp +2 -2
- package/src/duckdb/src/catalog/dependency_manager.cpp +9 -10
- package/src/duckdb/src/catalog/duck_catalog.cpp +30 -26
- package/src/duckdb/src/catalog/similar_catalog_entry.cpp +1 -1
- package/src/duckdb/src/common/radix_partitioning.cpp +1 -1
- package/src/duckdb/src/common/types.cpp +15 -27
- package/src/duckdb/src/execution/index/art/art.cpp +286 -269
- package/src/duckdb/src/execution/index/art/art_key.cpp +22 -32
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +224 -0
- package/src/duckdb/src/execution/index/art/iterator.cpp +142 -123
- package/src/duckdb/src/execution/index/art/leaf.cpp +319 -170
- package/src/duckdb/src/execution/index/art/leaf_segment.cpp +42 -0
- package/src/duckdb/src/execution/index/art/node.cpp +444 -379
- package/src/duckdb/src/execution/index/art/node16.cpp +178 -114
- package/src/duckdb/src/execution/index/art/node256.cpp +117 -79
- package/src/duckdb/src/execution/index/art/node4.cpp +169 -114
- package/src/duckdb/src/execution/index/art/node48.cpp +175 -105
- package/src/duckdb/src/execution/index/art/prefix.cpp +405 -127
- package/src/duckdb/src/execution/index/art/prefix_segment.cpp +42 -0
- package/src/duckdb/src/execution/index/art/swizzleable_pointer.cpp +10 -85
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +4 -3
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +2 -0
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +4 -3
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +19 -18
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +5 -5
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +17 -17
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +4 -3
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +4 -3
- package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +1 -1
- package/src/duckdb/src/function/built_in_functions.cpp +10 -10
- package/src/duckdb/src/function/function_binder.cpp +3 -3
- package/src/duckdb/src/function/scalar/list/list_aggregates.cpp +5 -6
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +2 -2
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +9 -8
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +6 -6
- package/src/duckdb/src/function/table/arrow.cpp +5 -5
- package/src/duckdb/src/function/table/read_csv.cpp +5 -1
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +8 -7
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +14 -14
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +26 -25
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +13 -12
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +7 -7
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +8 -9
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +10 -9
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +13 -13
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +11 -10
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +2 -2
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +5 -5
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +3 -3
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +2 -2
- package/src/duckdb/src/function/table/table_scan.cpp +39 -37
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/function/udf_function.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +122 -81
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +2 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/collate_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +24 -20
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +22 -17
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +28 -7
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +20 -19
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +9 -9
- package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +2 -1
- package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +10 -4
- package/src/duckdb/src/include/duckdb/common/enums/on_entry_not_found.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/queue.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +53 -45
- package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +29 -24
- package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +114 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +26 -20
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +63 -39
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +36 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +98 -116
- package/src/duckdb/src/include/duckdb/execution/index/art/node16.hpp +48 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +52 -35
- package/src/duckdb/src/include/duckdb/execution/index/art/node4.hpp +46 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +57 -35
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +57 -50
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix_segment.hpp +40 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/swizzleable_pointer.hpp +38 -31
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_file_handle.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +2 -0
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +3 -2
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +5 -4
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +28 -15
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/keyword_helper.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +7 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +5 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +13 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +5 -2
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +1 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +4 -7
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +0 -5
- package/src/duckdb/src/include/duckdb/storage/index.hpp +13 -28
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +0 -2
- package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +5 -0
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +12 -0
- package/src/duckdb/src/include/duckdb.h +26 -0
- package/src/duckdb/src/main/attached_database.cpp +12 -6
- package/src/duckdb/src/main/capi/helper-c.cpp +7 -0
- package/src/duckdb/src/main/capi/table_function-c.cpp +17 -16
- package/src/duckdb/src/main/client_context.cpp +12 -11
- package/src/duckdb/src/main/database_manager.cpp +13 -12
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +1 -2
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +9 -9
- package/src/duckdb/src/parser/parsed_data/create_scalar_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_table_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +2 -2
- package/src/duckdb/src/parser/statement/insert_statement.cpp +15 -6
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +18 -5
- package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +3 -2
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +5 -1
- package/src/duckdb/src/parser/transform/statement/transform_detach.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +5 -7
- package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +26 -27
- package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +17 -17
- package/src/duckdb/src/planner/binder/expression/bind_case_expression.cpp +9 -9
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +6 -6
- package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +6 -6
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +21 -21
- package/src/duckdb/src/planner/binder/expression/bind_conjunction_expression.cpp +2 -3
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +33 -36
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +5 -5
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +23 -23
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +4 -4
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +7 -7
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +23 -23
- package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +14 -13
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +56 -42
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +3 -3
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +10 -10
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +16 -11
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +5 -4
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +3 -3
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +10 -12
- package/src/duckdb/src/planner/binder.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_expression.cpp +11 -2
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +2 -5
- package/src/duckdb/src/planner/operator/logical_create.cpp +2 -1
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_delete.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_get.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_insert.cpp +2 -7
- package/src/duckdb/src/planner/operator/logical_update.cpp +2 -6
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +2 -2
- package/src/duckdb/src/planner/pragma_handler.cpp +3 -4
- package/src/duckdb/src/storage/checkpoint_manager.cpp +57 -55
- package/src/duckdb/src/storage/data_table.cpp +9 -9
- package/src/duckdb/src/storage/index.cpp +18 -6
- package/src/duckdb/src/storage/local_storage.cpp +8 -2
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +0 -9
- package/src/duckdb/src/storage/table/update_segment.cpp +1 -1
- package/src/duckdb/src/storage/wal_replay.cpp +29 -31
- package/src/duckdb/src/storage/write_ahead_log.cpp +8 -8
- package/src/duckdb/src/transaction/cleanup_state.cpp +7 -1
- package/src/duckdb/src/transaction/commit_state.cpp +3 -4
- package/src/duckdb/src/transaction/transaction_context.cpp +1 -1
- package/src/duckdb/src/transaction/undo_buffer.cpp +8 -0
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +4 -4
- package/src/duckdb/ub_src_execution_index_art.cpp +7 -1
@@ -7,45 +7,52 @@
|
|
7
7
|
//===----------------------------------------------------------------------===//
|
8
8
|
#pragma once
|
9
9
|
|
10
|
-
#include "duckdb/
|
10
|
+
#include "duckdb/common/constants.hpp"
|
11
11
|
|
12
12
|
namespace duckdb {
|
13
13
|
|
14
|
-
|
15
|
-
class
|
14
|
+
// classes
|
15
|
+
class MetaBlockReader;
|
16
16
|
|
17
|
-
//
|
18
|
-
|
17
|
+
// structs
|
18
|
+
struct BlockPointer;
|
19
|
+
|
20
|
+
//! SwizzleablePointer provides functions on a (possibly) swizzled pointer. If the swizzle flag is set, then the
|
21
|
+
//! pointer points to a storage address (and has no type), otherwise the pointer has a type and stores
|
22
|
+
//! other information (e.g., a buffer location)
|
19
23
|
class SwizzleablePointer {
|
20
24
|
public:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
//! Constructs an empty SwizzleablePointer
|
26
|
+
SwizzleablePointer() : swizzle_flag(0), type(0), offset(0), buffer_id(0) {};
|
27
|
+
//! Constructs a swizzled pointer from a buffer ID and an offset
|
28
|
+
explicit SwizzleablePointer(MetaBlockReader &reader);
|
29
|
+
//! Constructs a non-swizzled pointer from a buffer ID and an offset
|
30
|
+
SwizzleablePointer(uint32_t offset, uint32_t buffer_id)
|
31
|
+
: swizzle_flag(0), type(0), offset(offset), buffer_id(buffer_id) {};
|
32
|
+
|
33
|
+
//! The swizzle flag, set if swizzled, not set otherwise
|
34
|
+
uint8_t swizzle_flag : 1;
|
35
|
+
//! The type of the pointer, zero if not set
|
36
|
+
uint8_t type : 7;
|
37
|
+
//! The offset of a memory location
|
38
|
+
uint32_t offset : 24;
|
39
|
+
//! The buffer ID of a memory location
|
40
|
+
uint32_t buffer_id : 32;
|
29
41
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
42
|
+
public:
|
43
|
+
//! Checks if the pointer is swizzled
|
44
|
+
inline bool IsSwizzled() const {
|
45
|
+
return swizzle_flag;
|
46
|
+
}
|
47
|
+
//! Returns true, if neither the swizzle flag nor the type is set, and false otherwise
|
48
|
+
inline bool IsSet() const {
|
49
|
+
return swizzle_flag || type;
|
50
|
+
}
|
51
|
+
//! Reset the pointer
|
52
|
+
inline void Reset() {
|
53
|
+
swizzle_flag = 0;
|
54
|
+
type = 0;
|
37
55
|
}
|
38
|
-
|
39
|
-
//! Deletes the underlying object (if necessary) and set the pointer to nullptr
|
40
|
-
void Reset();
|
41
|
-
|
42
|
-
private:
|
43
|
-
uint64_t pointer;
|
44
|
-
|
45
|
-
friend bool operator!=(const SwizzleablePointer &s_ptr, const uint64_t &ptr);
|
46
|
-
|
47
|
-
//! Extracts the block info from swizzled pointer
|
48
|
-
BlockPointer GetSwizzledBlockInfo();
|
49
56
|
};
|
50
57
|
|
51
58
|
} // namespace duckdb
|
@@ -16,7 +16,8 @@ namespace duckdb {
|
|
16
16
|
|
17
17
|
struct CSVFileHandle {
|
18
18
|
public:
|
19
|
-
explicit CSVFileHandle(unique_ptr<FileHandle> file_handle_p
|
19
|
+
explicit CSVFileHandle(unique_ptr<FileHandle> file_handle_p, bool enable_reset = true)
|
20
|
+
: file_handle(std::move(file_handle_p)), reset_enabled(enable_reset) {
|
20
21
|
can_seek = file_handle->CanSeek();
|
21
22
|
plain_file_source = file_handle->OnDiskFile() && can_seek;
|
22
23
|
file_size = file_handle->GetFileSize();
|
@@ -62,6 +62,8 @@ struct BufferedCSVReaderOptions {
|
|
62
62
|
//! Whether file is compressed or not, and if so which compression type
|
63
63
|
//! AUTO_DETECT (default; infer from file extension)
|
64
64
|
FileCompressionType compression = FileCompressionType::AUTO_DETECT;
|
65
|
+
//! Option to convert quoted values to NULL values
|
66
|
+
bool allow_quoted_nulls = true;
|
65
67
|
|
66
68
|
//===--------------------------------------------------------------------===//
|
67
69
|
// CSVAutoOptions
|
@@ -47,13 +47,13 @@ public:
|
|
47
47
|
// note: original_arguments are optional (can be list of size 0)
|
48
48
|
auto original_arguments = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
49
49
|
|
50
|
-
auto func_catalog = Catalog::GetEntry(context, type, SYSTEM_CATALOG, DEFAULT_SCHEMA, name);
|
51
|
-
if (
|
50
|
+
auto &func_catalog = Catalog::GetEntry(context, type, SYSTEM_CATALOG, DEFAULT_SCHEMA, name);
|
51
|
+
if (func_catalog.type != type) {
|
52
52
|
throw InternalException("Cant find catalog entry for function %s", name);
|
53
53
|
}
|
54
54
|
|
55
|
-
auto functions = (
|
56
|
-
auto function = functions
|
55
|
+
auto &functions = func_catalog.Cast<CATALOG_ENTRY>();
|
56
|
+
auto function = functions.functions.GetFunctionByArguments(
|
57
57
|
state.context, original_arguments.empty() ? arguments : original_arguments);
|
58
58
|
function.arguments = std::move(arguments);
|
59
59
|
function.original_arguments = std::move(original_arguments);
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#include "duckdb/execution/expression_executor_state.hpp"
|
16
16
|
#include "duckdb/function/function.hpp"
|
17
17
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
18
|
+
#include "duckdb/common/optional_ptr.hpp"
|
18
19
|
|
19
20
|
namespace duckdb {
|
20
21
|
|
@@ -39,13 +40,13 @@ class DependencyList;
|
|
39
40
|
class ScalarFunctionCatalogEntry;
|
40
41
|
|
41
42
|
struct FunctionStatisticsInput {
|
42
|
-
FunctionStatisticsInput(BoundFunctionExpression &expr_p, FunctionData
|
43
|
+
FunctionStatisticsInput(BoundFunctionExpression &expr_p, optional_ptr<FunctionData> bind_data_p,
|
43
44
|
vector<BaseStatistics> &child_stats_p, unique_ptr<Expression> *expr_ptr_p)
|
44
45
|
: expr(expr_p), bind_data(bind_data_p), child_stats(child_stats_p), expr_ptr(expr_ptr_p) {
|
45
46
|
}
|
46
47
|
|
47
48
|
BoundFunctionExpression &expr;
|
48
|
-
FunctionData
|
49
|
+
optional_ptr<FunctionData> bind_data;
|
49
50
|
vector<BaseStatistics> &child_stats;
|
50
51
|
unique_ptr<Expression> *expr_ptr;
|
51
52
|
};
|
@@ -17,11 +17,11 @@ class DuckTableEntry;
|
|
17
17
|
class TableCatalogEntry;
|
18
18
|
|
19
19
|
struct TableScanBindData : public TableFunctionData {
|
20
|
-
explicit TableScanBindData(DuckTableEntry
|
20
|
+
explicit TableScanBindData(DuckTableEntry &table) : table(table), is_index_scan(false), is_create_index(false) {
|
21
21
|
}
|
22
22
|
|
23
23
|
//! The table to scan
|
24
|
-
DuckTableEntry
|
24
|
+
DuckTableEntry &table;
|
25
25
|
|
26
26
|
//! Whether or not the table scan is an index scan
|
27
27
|
bool is_index_scan;
|
@@ -33,7 +33,7 @@ struct TableScanBindData : public TableFunctionData {
|
|
33
33
|
public:
|
34
34
|
bool Equals(const FunctionData &other_p) const override {
|
35
35
|
auto &other = (const TableScanBindData &)other_p;
|
36
|
-
return other.table == table && result_ids == other.result_ids;
|
36
|
+
return &other.table == &table && result_ids == other.result_ids;
|
37
37
|
}
|
38
38
|
};
|
39
39
|
|
@@ -42,7 +42,8 @@ struct TableScanFunction {
|
|
42
42
|
static void RegisterFunction(BuiltinFunctions &set);
|
43
43
|
static TableFunction GetFunction();
|
44
44
|
static TableFunction GetIndexScanFunction();
|
45
|
-
static TableCatalogEntry
|
45
|
+
static optional_ptr<TableCatalogEntry> GetTableEntry(const TableFunction &function,
|
46
|
+
const optional_ptr<FunctionData> bind_data);
|
46
47
|
};
|
47
48
|
|
48
49
|
} // namespace duckdb
|
@@ -14,6 +14,7 @@
|
|
14
14
|
#include "duckdb/planner/bind_context.hpp"
|
15
15
|
#include "duckdb/planner/logical_operator.hpp"
|
16
16
|
#include "duckdb/storage/statistics/node_statistics.hpp"
|
17
|
+
#include "duckdb/common/optional_ptr.hpp"
|
17
18
|
|
18
19
|
#include <functional>
|
19
20
|
|
@@ -26,6 +27,17 @@ class TableFilterSet;
|
|
26
27
|
|
27
28
|
struct TableFunctionInfo {
|
28
29
|
DUCKDB_API virtual ~TableFunctionInfo();
|
30
|
+
|
31
|
+
template <class TARGET>
|
32
|
+
TARGET &Cast() {
|
33
|
+
D_ASSERT(dynamic_cast<TARGET *>(this));
|
34
|
+
return (TARGET &)*this;
|
35
|
+
}
|
36
|
+
template <class TARGET>
|
37
|
+
const TARGET &Cast() const {
|
38
|
+
D_ASSERT(dynamic_cast<const TARGET *>(this));
|
39
|
+
return (const TARGET &)*this;
|
40
|
+
}
|
29
41
|
};
|
30
42
|
|
31
43
|
struct GlobalTableFunctionState {
|
@@ -70,7 +82,7 @@ struct LocalTableFunctionState {
|
|
70
82
|
struct TableFunctionBindInput {
|
71
83
|
TableFunctionBindInput(vector<Value> &inputs, named_parameter_map_t &named_parameters,
|
72
84
|
vector<LogicalType> &input_table_types, vector<string> &input_table_names,
|
73
|
-
TableFunctionInfo
|
85
|
+
optional_ptr<TableFunctionInfo> info)
|
74
86
|
: inputs(inputs), named_parameters(named_parameters), input_table_types(input_table_types),
|
75
87
|
input_table_names(input_table_names), info(info) {
|
76
88
|
}
|
@@ -79,19 +91,19 @@ struct TableFunctionBindInput {
|
|
79
91
|
named_parameter_map_t &named_parameters;
|
80
92
|
vector<LogicalType> &input_table_types;
|
81
93
|
vector<string> &input_table_names;
|
82
|
-
TableFunctionInfo
|
94
|
+
optional_ptr<TableFunctionInfo> info;
|
83
95
|
};
|
84
96
|
|
85
97
|
struct TableFunctionInitInput {
|
86
|
-
TableFunctionInitInput(const FunctionData
|
87
|
-
const vector<idx_t> &projection_ids_p, TableFilterSet
|
98
|
+
TableFunctionInitInput(optional_ptr<const FunctionData> bind_data_p, const vector<column_t> &column_ids_p,
|
99
|
+
const vector<idx_t> &projection_ids_p, optional_ptr<TableFilterSet> filters_p)
|
88
100
|
: bind_data(bind_data_p), column_ids(column_ids_p), projection_ids(projection_ids_p), filters(filters_p) {
|
89
101
|
}
|
90
102
|
|
91
|
-
const FunctionData
|
103
|
+
optional_ptr<const FunctionData> bind_data;
|
92
104
|
const vector<column_t> &column_ids;
|
93
105
|
const vector<idx_t> projection_ids;
|
94
|
-
TableFilterSet
|
106
|
+
optional_ptr<TableFilterSet> filters;
|
95
107
|
|
96
108
|
bool CanRemoveFilterColumns() const {
|
97
109
|
if (projection_ids.empty()) {
|
@@ -109,15 +121,16 @@ struct TableFunctionInitInput {
|
|
109
121
|
|
110
122
|
struct TableFunctionInput {
|
111
123
|
public:
|
112
|
-
TableFunctionInput(const FunctionData
|
113
|
-
|
124
|
+
TableFunctionInput(optional_ptr<const FunctionData> bind_data_p,
|
125
|
+
optional_ptr<LocalTableFunctionState> local_state_p,
|
126
|
+
optional_ptr<GlobalTableFunctionState> global_state_p)
|
114
127
|
: bind_data(bind_data_p), local_state(local_state_p), global_state(global_state_p) {
|
115
128
|
}
|
116
129
|
|
117
130
|
public:
|
118
|
-
const FunctionData
|
119
|
-
LocalTableFunctionState
|
120
|
-
GlobalTableFunctionState
|
131
|
+
optional_ptr<const FunctionData> bind_data;
|
132
|
+
optional_ptr<LocalTableFunctionState> local_state;
|
133
|
+
optional_ptr<GlobalTableFunctionState> global_state;
|
121
134
|
};
|
122
135
|
|
123
136
|
enum ScanType { TABLE, PARQUET };
|
@@ -127,21 +140,21 @@ public:
|
|
127
140
|
explicit BindInfo(ScanType type_p) : type(type_p) {};
|
128
141
|
unordered_map<string, Value> options;
|
129
142
|
ScanType type;
|
130
|
-
void InsertOption(string name, Value value) {
|
143
|
+
void InsertOption(const string &name, Value value) {
|
131
144
|
if (options.find(name) != options.end()) {
|
132
145
|
throw InternalException("This option already exists");
|
133
146
|
}
|
134
|
-
options[name] = value;
|
147
|
+
options[name] = std::move(value);
|
135
148
|
}
|
136
149
|
template <class T>
|
137
|
-
T GetOption(string name) {
|
150
|
+
T GetOption(const string &name) {
|
138
151
|
if (options.find(name) == options.end()) {
|
139
152
|
throw InternalException("This option does not exist");
|
140
153
|
}
|
141
154
|
return options[name].GetValue<T>();
|
142
155
|
}
|
143
156
|
template <class T>
|
144
|
-
vector<T> GetOptionList(string name) {
|
157
|
+
vector<T> GetOptionList(const string &name) {
|
145
158
|
if (options.find(name) == options.end()) {
|
146
159
|
throw InternalException("This option does not exist");
|
147
160
|
}
|
@@ -44,6 +44,7 @@ public:
|
|
44
44
|
|
45
45
|
void Initialize();
|
46
46
|
|
47
|
+
Catalog &ParentCatalog() override;
|
47
48
|
StorageManager &GetStorageManager();
|
48
49
|
Catalog &GetCatalog();
|
49
50
|
TransactionManager &GetTransactionManager();
|
@@ -65,6 +66,7 @@ private:
|
|
65
66
|
unique_ptr<Catalog> catalog;
|
66
67
|
unique_ptr<TransactionManager> transaction_manager;
|
67
68
|
AttachedDatabaseType type;
|
69
|
+
optional_ptr<Catalog> parent_catalog;
|
68
70
|
};
|
69
71
|
|
70
72
|
} // namespace duckdb
|
@@ -149,7 +149,7 @@ public:
|
|
149
149
|
DUCKDB_API double GetProgress();
|
150
150
|
|
151
151
|
//! Register function in the temporary schema
|
152
|
-
DUCKDB_API void RegisterFunction(CreateFunctionInfo
|
152
|
+
DUCKDB_API void RegisterFunction(CreateFunctionInfo &info);
|
153
153
|
|
154
154
|
//! Parse statements from a query
|
155
155
|
DUCKDB_API vector<unique_ptr<SQLStatement>> ParseStatements(const string &query);
|
@@ -13,6 +13,7 @@
|
|
13
13
|
#include "duckdb/common/mutex.hpp"
|
14
14
|
#include "duckdb/common/atomic.hpp"
|
15
15
|
#include "duckdb/common/optional_ptr.hpp"
|
16
|
+
#include "duckdb/common/enums/on_entry_not_found.hpp"
|
16
17
|
|
17
18
|
namespace duckdb {
|
18
19
|
class AttachedDatabase;
|
@@ -39,13 +40,13 @@ public:
|
|
39
40
|
optional_ptr<AttachedDatabase> GetDatabase(ClientContext &context, const string &name);
|
40
41
|
//! Add a new attached database to the database manager
|
41
42
|
void AddDatabase(ClientContext &context, unique_ptr<AttachedDatabase> db);
|
42
|
-
void DetachDatabase(ClientContext &context, const string &name,
|
43
|
+
void DetachDatabase(ClientContext &context, const string &name, OnEntryNotFound if_not_found);
|
43
44
|
//! Returns a reference to the system catalog
|
44
45
|
Catalog &GetSystemCatalog();
|
45
46
|
static const string &GetDefaultDatabase(ClientContext &context);
|
46
47
|
|
47
48
|
optional_ptr<AttachedDatabase> GetDatabaseFromPath(ClientContext &context, const string &path);
|
48
|
-
vector<
|
49
|
+
vector<reference<AttachedDatabase>> GetDatabases(ClientContext &context);
|
49
50
|
|
50
51
|
transaction_t GetNewQueryNumber() {
|
51
52
|
return current_query_number++;
|
@@ -18,10 +18,10 @@ public:
|
|
18
18
|
static bool IsKeyword(const string &text);
|
19
19
|
|
20
20
|
//! Returns true if the given string needs to be quoted when written as an identifier
|
21
|
-
static bool RequiresQuotes(const string &text, bool allow_caps =
|
21
|
+
static bool RequiresQuotes(const string &text, bool allow_caps = true);
|
22
22
|
|
23
23
|
//! Writes a string that is optionally quoted + escaped so it can be used as an identifier
|
24
|
-
static string WriteOptionallyQuoted(const string &text, char quote = '"', bool allow_caps =
|
24
|
+
static string WriteOptionallyQuoted(const string &text, char quote = '"', bool allow_caps = true);
|
25
25
|
};
|
26
26
|
|
27
27
|
} // namespace duckdb
|
@@ -11,6 +11,7 @@
|
|
11
11
|
#include "duckdb/common/enums/catalog_type.hpp"
|
12
12
|
#include "duckdb/parser/column_definition.hpp"
|
13
13
|
#include "duckdb/parser/parsed_data/parse_info.hpp"
|
14
|
+
#include "duckdb/common/enums/on_entry_not_found.hpp"
|
14
15
|
|
15
16
|
namespace duckdb {
|
16
17
|
|
@@ -27,23 +28,24 @@ enum class AlterType : uint8_t {
|
|
27
28
|
struct AlterEntryData {
|
28
29
|
AlterEntryData() {
|
29
30
|
}
|
30
|
-
AlterEntryData(string catalog_p, string schema_p, string name_p,
|
31
|
-
: catalog(std::move(catalog_p)), schema(std::move(schema_p)), name(std::move(name_p)),
|
31
|
+
AlterEntryData(string catalog_p, string schema_p, string name_p, OnEntryNotFound if_not_found)
|
32
|
+
: catalog(std::move(catalog_p)), schema(std::move(schema_p)), name(std::move(name_p)),
|
33
|
+
if_not_found(if_not_found) {
|
32
34
|
}
|
33
35
|
|
34
36
|
string catalog;
|
35
37
|
string schema;
|
36
38
|
string name;
|
37
|
-
|
39
|
+
OnEntryNotFound if_not_found;
|
38
40
|
};
|
39
41
|
|
40
42
|
struct AlterInfo : public ParseInfo {
|
41
|
-
AlterInfo(AlterType type, string catalog, string schema, string name,
|
43
|
+
AlterInfo(AlterType type, string catalog, string schema, string name, OnEntryNotFound if_not_found);
|
42
44
|
virtual ~AlterInfo() override;
|
43
45
|
|
44
46
|
AlterType type;
|
45
47
|
//! if exists
|
46
|
-
|
48
|
+
OnEntryNotFound if_not_found;
|
47
49
|
//! Catalog name to alter
|
48
50
|
string catalog;
|
49
51
|
//! Schema name to alter
|
@@ -22,7 +22,7 @@ enum AlterForeignKeyType : uint8_t { AFT_ADD = 0, AFT_DELETE = 1 };
|
|
22
22
|
//===--------------------------------------------------------------------===//
|
23
23
|
struct ChangeOwnershipInfo : public AlterInfo {
|
24
24
|
ChangeOwnershipInfo(CatalogType entry_catalog_type, string entry_catalog, string entry_schema, string entry_name,
|
25
|
-
string owner_schema, string owner_name,
|
25
|
+
string owner_schema, string owner_name, OnEntryNotFound if_not_found);
|
26
26
|
|
27
27
|
// Catalog type refers to the entry type, since this struct is usually built from an
|
28
28
|
// ALTER <TYPE> <schema>.<name> OWNED BY <owner_schema>.<owner_name> statement
|
@@ -22,7 +22,7 @@ class SchemaCatalogEntry;
|
|
22
22
|
struct CreateTableInfo : public CreateInfo {
|
23
23
|
DUCKDB_API CreateTableInfo();
|
24
24
|
DUCKDB_API CreateTableInfo(string catalog, string schema, string name);
|
25
|
-
DUCKDB_API CreateTableInfo(SchemaCatalogEntry
|
25
|
+
DUCKDB_API CreateTableInfo(SchemaCatalogEntry &schema, string name);
|
26
26
|
|
27
27
|
//! Table name to insert to
|
28
28
|
string table;
|
@@ -16,7 +16,7 @@ class SchemaCatalogEntry;
|
|
16
16
|
|
17
17
|
struct CreateViewInfo : public CreateInfo {
|
18
18
|
CreateViewInfo();
|
19
|
-
CreateViewInfo(SchemaCatalogEntry
|
19
|
+
CreateViewInfo(SchemaCatalogEntry &schema, string view_name);
|
20
20
|
CreateViewInfo(string catalog_p, string schema_p, string view_name);
|
21
21
|
|
22
22
|
//! Table name to insert to
|
@@ -9,6 +9,7 @@
|
|
9
9
|
#pragma once
|
10
10
|
|
11
11
|
#include "duckdb/parser/parsed_data/parse_info.hpp"
|
12
|
+
#include "duckdb/common/enums/on_entry_not_found.hpp"
|
12
13
|
|
13
14
|
namespace duckdb {
|
14
15
|
|
@@ -19,13 +20,13 @@ struct DetachInfo : public ParseInfo {
|
|
19
20
|
//! The alias of the attached database
|
20
21
|
string name;
|
21
22
|
//! Whether to throw an exception if alias is not found
|
22
|
-
|
23
|
+
OnEntryNotFound if_not_found;
|
23
24
|
|
24
25
|
public:
|
25
26
|
unique_ptr<DetachInfo> Copy() const {
|
26
27
|
auto result = make_uniq<DetachInfo>();
|
27
28
|
result->name = name;
|
28
|
-
result->
|
29
|
+
result->if_not_found = if_not_found;
|
29
30
|
return result;
|
30
31
|
}
|
31
32
|
};
|
@@ -15,7 +15,7 @@
|
|
15
15
|
namespace duckdb {
|
16
16
|
|
17
17
|
struct DropInfo : public ParseInfo {
|
18
|
-
DropInfo() : catalog(INVALID_CATALOG), schema(INVALID_SCHEMA),
|
18
|
+
DropInfo() : catalog(INVALID_CATALOG), schema(INVALID_SCHEMA), cascade(false) {
|
19
19
|
}
|
20
20
|
|
21
21
|
//! The catalog type to drop
|
@@ -27,7 +27,7 @@ struct DropInfo : public ParseInfo {
|
|
27
27
|
//! Element name to drop
|
28
28
|
string name;
|
29
29
|
//! Ignore if the entry does not exist instead of failing
|
30
|
-
|
30
|
+
OnEntryNotFound if_not_found = OnEntryNotFound::THROW_EXCEPTION;
|
31
31
|
//! Cascade drop (drop all dependents instead of throwing an error if there
|
32
32
|
//! are any)
|
33
33
|
bool cascade = false;
|
@@ -41,7 +41,7 @@ public:
|
|
41
41
|
result->catalog = catalog;
|
42
42
|
result->schema = schema;
|
43
43
|
result->name = name;
|
44
|
-
result->
|
44
|
+
result->if_not_found = if_not_found;
|
45
45
|
result->cascade = cascade;
|
46
46
|
result->allow_drop_internal = allow_drop_internal;
|
47
47
|
return result;
|
@@ -53,7 +53,7 @@ public:
|
|
53
53
|
writer.WriteString(catalog);
|
54
54
|
writer.WriteString(schema);
|
55
55
|
writer.WriteString(name);
|
56
|
-
writer.WriteField(
|
56
|
+
writer.WriteField(if_not_found);
|
57
57
|
writer.WriteField(cascade);
|
58
58
|
writer.WriteField(allow_drop_internal);
|
59
59
|
writer.Finalize();
|
@@ -66,7 +66,7 @@ public:
|
|
66
66
|
drop_info->catalog = reader.ReadRequired<string>();
|
67
67
|
drop_info->schema = reader.ReadRequired<string>();
|
68
68
|
drop_info->name = reader.ReadRequired<string>();
|
69
|
-
drop_info->
|
69
|
+
drop_info->if_not_found = reader.ReadRequired<OnEntryNotFound>();
|
70
70
|
drop_info->cascade = reader.ReadRequired<bool>();
|
71
71
|
drop_info->allow_drop_internal = reader.ReadRequired<bool>();
|
72
72
|
reader.Finalize();
|
@@ -15,6 +15,19 @@ namespace duckdb {
|
|
15
15
|
struct ParseInfo {
|
16
16
|
virtual ~ParseInfo() {
|
17
17
|
}
|
18
|
+
|
19
|
+
public:
|
20
|
+
template <class TARGET>
|
21
|
+
TARGET &Cast() {
|
22
|
+
D_ASSERT(dynamic_cast<TARGET *>(this));
|
23
|
+
return (TARGET &)*this;
|
24
|
+
}
|
25
|
+
|
26
|
+
template <class TARGET>
|
27
|
+
const TARGET &Cast() const {
|
28
|
+
D_ASSERT(dynamic_cast<const TARGET *>(this));
|
29
|
+
return (const TARGET &)*this;
|
30
|
+
}
|
18
31
|
};
|
19
32
|
|
20
33
|
} // namespace duckdb
|
@@ -72,6 +72,9 @@ public:
|
|
72
72
|
//! CTEs
|
73
73
|
CommonTableExpressionMap cte_map;
|
74
74
|
|
75
|
+
//! Whether or not this a DEFAULT VALUES
|
76
|
+
bool default_values = false;
|
77
|
+
|
75
78
|
protected:
|
76
79
|
InsertStatement(const InsertStatement &other);
|
77
80
|
|
@@ -82,7 +85,7 @@ public:
|
|
82
85
|
|
83
86
|
//! If the INSERT statement is inserted DIRECTLY from a values list (i.e. INSERT INTO tbl VALUES (...)) this returns
|
84
87
|
//! the expression list Otherwise, this returns NULL
|
85
|
-
ExpressionListRef
|
88
|
+
optional_ptr<ExpressionListRef> GetValuesList() const;
|
86
89
|
};
|
87
90
|
|
88
91
|
} // namespace duckdb
|
@@ -18,6 +18,9 @@ class Serializer;
|
|
18
18
|
|
19
19
|
//! Represents a generic expression that returns a table.
|
20
20
|
class TableRef {
|
21
|
+
public:
|
22
|
+
static constexpr const TableReferenceType TYPE = TableReferenceType::INVALID;
|
23
|
+
|
21
24
|
public:
|
22
25
|
explicit TableRef(TableReferenceType type) : type(type) {
|
23
26
|
}
|
@@ -57,7 +60,7 @@ public:
|
|
57
60
|
public:
|
58
61
|
template <class TARGET>
|
59
62
|
TARGET &Cast() {
|
60
|
-
if (type != TARGET::TYPE) {
|
63
|
+
if (type != TARGET::TYPE && TARGET::TYPE != TableReferenceType::INVALID) {
|
61
64
|
throw InternalException("Failed to cast constraint to type - constraint type mismatch");
|
62
65
|
}
|
63
66
|
return (TARGET &)*this;
|
@@ -65,7 +68,7 @@ public:
|
|
65
68
|
|
66
69
|
template <class TARGET>
|
67
70
|
const TARGET &Cast() const {
|
68
|
-
if (type != TARGET::TYPE) {
|
71
|
+
if (type != TARGET::TYPE && TARGET::TYPE != TableReferenceType::INVALID) {
|
69
72
|
throw InternalException("Failed to cast constraint to type - constraint type mismatch");
|
70
73
|
}
|
71
74
|
return (const TARGET &)*this;
|
@@ -312,7 +312,8 @@ private:
|
|
312
312
|
void TransformExpressionList(duckdb_libpgquery::PGList &list, vector<unique_ptr<ParsedExpression>> &result);
|
313
313
|
|
314
314
|
//! Transform a Postgres PARTITION BY/ORDER BY specification into lists of expressions
|
315
|
-
void TransformWindowDef(duckdb_libpgquery::PGWindowDef *window_spec, WindowExpression *expr
|
315
|
+
void TransformWindowDef(duckdb_libpgquery::PGWindowDef *window_spec, WindowExpression *expr,
|
316
|
+
const char *window_name = nullptr);
|
316
317
|
//! Transform a Postgres window frame specification into frame expressions
|
317
318
|
void TransformWindowFrame(duckdb_libpgquery::PGWindowDef *window_spec, WindowExpression *expr);
|
318
319
|
|
@@ -320,6 +321,8 @@ private:
|
|
320
321
|
//! Returns true if an expression is only a star (i.e. "*", without any other decorators)
|
321
322
|
bool ExpressionIsEmptyStar(ParsedExpression &expr);
|
322
323
|
|
324
|
+
OnEntryNotFound TransformOnEntryNotFound(bool missing_ok);
|
325
|
+
|
323
326
|
private:
|
324
327
|
//! Current stack depth
|
325
328
|
idx_t stack_depth;
|
@@ -172,7 +172,7 @@ public:
|
|
172
172
|
void BindOnConflictClause(LogicalInsert &insert, TableCatalogEntry &table, InsertStatement &stmt);
|
173
173
|
|
174
174
|
static void BindSchemaOrCatalog(ClientContext &context, string &catalog, string &schema);
|
175
|
-
static void BindLogicalType(ClientContext &context, LogicalType &type, Catalog
|
175
|
+
static void BindLogicalType(ClientContext &context, LogicalType &type, optional_ptr<Catalog> catalog = nullptr,
|
176
176
|
const string &schema = INVALID_SCHEMA);
|
177
177
|
|
178
178
|
bool HasMatchingBinding(const string &table_name, const string &column_name, string &error_message);
|
@@ -259,7 +259,7 @@ private:
|
|
259
259
|
const string &alias, idx_t update_table_index,
|
260
260
|
unique_ptr<LogicalOperator> child_operator, BoundStatement result);
|
261
261
|
|
262
|
-
unique_ptr<QueryNode> BindTableMacro(FunctionExpression &function, TableMacroCatalogEntry
|
262
|
+
unique_ptr<QueryNode> BindTableMacro(FunctionExpression &function, TableMacroCatalogEntry ¯o_func, idx_t depth);
|
263
263
|
|
264
264
|
unique_ptr<BoundQueryNode> BindNode(SelectNode &node);
|
265
265
|
unique_ptr<BoundQueryNode> BindNode(SetOperationNode &node);
|
@@ -43,8 +43,7 @@ protected:
|
|
43
43
|
BindResult BindExpression(unique_ptr<ParsedExpression> &expr_ptr, idx_t depth,
|
44
44
|
bool root_expression = false) override;
|
45
45
|
|
46
|
-
BindResult BindAggregate(FunctionExpression &expr,
|
47
|
-
idx_t depth) override;
|
46
|
+
BindResult BindAggregate(FunctionExpression &expr, AggregateFunctionCatalogEntry &function, idx_t depth) override;
|
48
47
|
|
49
48
|
bool inside_window;
|
50
49
|
bool bound_aggregate = false;
|
@@ -134,14 +134,11 @@ protected:
|
|
134
134
|
|
135
135
|
protected:
|
136
136
|
virtual BindResult BindGroupingFunction(OperatorExpression &op, idx_t depth);
|
137
|
-
virtual BindResult BindFunction(FunctionExpression &expr,
|
138
|
-
|
139
|
-
virtual BindResult
|
140
|
-
idx_t depth);
|
141
|
-
virtual BindResult BindAggregate(FunctionExpression &expr, optional_ptr<AggregateFunctionCatalogEntry> function,
|
142
|
-
idx_t depth);
|
137
|
+
virtual BindResult BindFunction(FunctionExpression &expr, ScalarFunctionCatalogEntry &function, idx_t depth);
|
138
|
+
virtual BindResult BindLambdaFunction(FunctionExpression &expr, ScalarFunctionCatalogEntry &function, idx_t depth);
|
139
|
+
virtual BindResult BindAggregate(FunctionExpression &expr, AggregateFunctionCatalogEntry &function, idx_t depth);
|
143
140
|
virtual BindResult BindUnnest(FunctionExpression &expr, idx_t depth, bool root_expression);
|
144
|
-
virtual BindResult BindMacro(FunctionExpression &expr,
|
141
|
+
virtual BindResult BindMacro(FunctionExpression &expr, ScalarMacroCatalogEntry ¯o, idx_t depth,
|
145
142
|
unique_ptr<ParsedExpression> &expr_ptr);
|
146
143
|
|
147
144
|
virtual string UnsupportedAggregateMessage();
|
@@ -53,7 +53,7 @@ public:
|
|
53
53
|
string GetName() const override;
|
54
54
|
string ParamsToString() const override;
|
55
55
|
//! Returns the underlying table that is being scanned, or nullptr if there is none
|
56
|
-
TableCatalogEntry
|
56
|
+
optional_ptr<TableCatalogEntry> GetTable() const;
|
57
57
|
|
58
58
|
public:
|
59
59
|
vector<ColumnBinding> GetColumnBindings() override;
|