duckdb 0.6.2-dev772.0 → 0.6.2-dev889.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 -1
- package/package.json +1 -1
- package/src/connection.cpp +2 -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 +1 -1
- package/src/duckdb/extension/icu/icu-makedate.cpp +1 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +2 -2
- package/src/duckdb/extension/icu/icu-timezone.cpp +6 -5
- package/src/duckdb/extension/json/json-extension.cpp +1 -1
- package/src/duckdb/extension/parquet/parquet-extension.cpp +1 -1
- package/src/duckdb/src/catalog/catalog.cpp +516 -177
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +1 -0
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +66 -49
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +15 -16
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry.cpp +6 -2
- package/src/duckdb/src/catalog/catalog_search_path.cpp +177 -22
- package/src/duckdb/src/catalog/catalog_set.cpp +134 -72
- package/src/duckdb/src/catalog/catalog_transaction.cpp +28 -0
- package/src/duckdb/src/catalog/default/default_views.cpp +4 -4
- package/src/duckdb/src/catalog/dependency_list.cpp +13 -0
- package/src/duckdb/src/catalog/dependency_manager.cpp +19 -13
- package/src/duckdb/src/common/constants.cpp +8 -0
- package/src/duckdb/src/common/enums/catalog_type.cpp +2 -0
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/statement_type.cpp +2 -0
- package/src/duckdb/src/common/file_system.cpp +1 -1
- package/src/duckdb/src/common/string_util.cpp +5 -1
- package/src/duckdb/src/execution/index/art/art.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +1 -0
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +3 -2
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +4 -3
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +72 -0
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +2 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +3 -3
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +5 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +2 -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 +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +2 -1
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +10 -2
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +2 -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_simple.cpp +4 -0
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan_generator.cpp +3 -2
- package/src/duckdb/src/function/built_in_functions.cpp +88 -0
- package/src/duckdb/src/function/function.cpp +0 -79
- package/src/duckdb/src/function/function_binder.cpp +2 -1
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +10 -1
- package/src/duckdb/src/function/scalar/date/current.cpp +2 -2
- package/src/duckdb/src/function/scalar/list/list_aggregates.cpp +3 -2
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +14 -17
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +2 -2
- package/src/duckdb/src/function/scalar/system/system_functions.cpp +7 -4
- package/src/duckdb/src/function/table/checkpoint.cpp +37 -4
- package/src/duckdb/src/function/table/read_csv.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +32 -25
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +26 -22
- 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_functions.cpp +22 -15
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +25 -18
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +16 -8
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +26 -19
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +24 -17
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +22 -16
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +20 -13
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +3 -4
- package/src/duckdb/src/function/table/system/pragma_database_list.cpp +20 -12
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +39 -24
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +1 -7
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +3 -2
- package/src/duckdb/src/function/table/system_functions.cpp +0 -1
- package/src/duckdb/src/function/table/table_scan.cpp +13 -10
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +102 -81
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/collate_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +21 -14
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +2 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +30 -11
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +35 -20
- package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +32 -0
- package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +27 -0
- package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +6 -4
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/constants.hpp +8 -3
- package/src/duckdb/src/include/duckdb/common/enums/catalog_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +10 -4
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +33 -0
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +78 -0
- package/src/duckdb/src/include/duckdb/function/function.hpp +0 -61
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +1 -2
- package/src/duckdb/src/include/duckdb/function/pragma/pragma_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/sequence_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar/uuid_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/range.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/summary.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +1 -4
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +64 -0
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +3 -3
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/database.hpp +6 -6
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +69 -0
- package/src/duckdb/src/include/duckdb/main/settings.hpp +10 -0
- package/src/duckdb/src/include/duckdb/main/valid_checker.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_function_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +18 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +53 -56
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +39 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_aggregate_function_info.hpp +3 -18
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_collation_info.hpp +4 -13
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_copy_function_info.hpp +3 -12
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +5 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_pragma_function_info.hpp +3 -14
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_function_info.hpp +3 -19
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +7 -34
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/qualified_name.hpp +10 -2
- package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp +29 -0
- package/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +11 -1
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +13 -6
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +10 -2
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +9 -12
- package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -7
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +5 -6
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +9 -7
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +3 -1
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +64 -0
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +14 -23
- package/src/duckdb/src/include/duckdb/transaction/transaction_context.hpp +12 -8
- package/src/duckdb/src/include/duckdb/transaction/transaction_manager.hpp +5 -10
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
- package/src/duckdb/src/main/attached_database.cpp +97 -0
- package/src/duckdb/src/main/capi/table_function-c.cpp +1 -1
- package/src/duckdb/src/main/client_context.cpp +28 -22
- package/src/duckdb/src/main/client_data.cpp +5 -2
- package/src/duckdb/src/main/config.cpp +1 -0
- package/src/duckdb/src/main/connection.cpp +1 -1
- package/src/duckdb/src/main/database.cpp +54 -40
- package/src/duckdb/src/main/database_manager.cpp +95 -0
- package/src/duckdb/src/main/materialized_query_result.cpp +1 -1
- package/src/duckdb/src/main/prepared_statement_data.cpp +1 -2
- package/src/duckdb/src/main/query_result.cpp +4 -4
- package/src/duckdb/src/main/settings/settings.cpp +22 -6
- package/src/duckdb/src/main/stream_query_result.cpp +1 -1
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +9 -3
- package/src/duckdb/src/parser/expression/function_expression.cpp +15 -13
- package/src/duckdb/src/parser/expression/window_expression.cpp +6 -4
- package/src/duckdb/src/parser/parsed_data/alter_function_info.cpp +7 -7
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +12 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +96 -98
- package/src/duckdb/src/parser/parsed_data/create_aggregate_function_info.cpp +27 -0
- package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +23 -0
- package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +21 -0
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +3 -0
- package/src/duckdb/src/parser/parsed_data/create_pragma_function_info.cpp +23 -0
- package/src/duckdb/src/parser/parsed_data/create_scalar_function_info.cpp +3 -1
- package/src/duckdb/src/parser/parsed_data/create_table_function_info.cpp +28 -0
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +9 -3
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +49 -0
- package/src/duckdb/src/parser/statement/attach_statement.cpp +15 -0
- package/src/duckdb/src/parser/statement/insert_statement.cpp +6 -2
- package/src/duckdb/src/parser/tableref/basetableref.cpp +9 -4
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +15 -13
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +17 -7
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +4 -9
- package/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +4 -0
- package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +5 -4
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +8 -10
- package/src/duckdb/src/parser/transform/statement/transform_attach.cpp +32 -0
- package/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +7 -2
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_schema.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_sequence.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +5 -5
- package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +6 -13
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +6 -6
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +11 -2
- package/src/duckdb/src/parser/transform/statement/transform_export.cpp +5 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +12 -36
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +3 -1
- package/src/duckdb/src/parser/transform/statement/transform_use.cpp +21 -0
- package/src/duckdb/src/parser/transform/tableref/transform_base_tableref.cpp +11 -3
- package/src/duckdb/src/parser/transformer.cpp +4 -0
- package/src/duckdb/src/planner/bind_context.cpp +11 -2
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +43 -13
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +2 -3
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +2 -3
- package/src/duckdb/src/planner/binder/statement/bind_attach.cpp +20 -0
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +7 -4
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +79 -27
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +11 -7
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +13 -5
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +6 -3
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_prepare.cpp +0 -2
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +11 -6
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +10 -6
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +2 -4
- package/src/duckdb/src/planner/binder.cpp +17 -2
- package/src/duckdb/src/planner/logical_operator.cpp +5 -12
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +3 -4
- package/src/duckdb/src/planner/operator/logical_create.cpp +1 -4
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_delete.cpp +2 -3
- package/src/duckdb/src/planner/operator/logical_insert.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_update.cpp +1 -1
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +1 -1
- package/src/duckdb/src/planner/planner.cpp +3 -2
- package/src/duckdb/src/planner/pragma_handler.cpp +1 -1
- package/src/duckdb/src/storage/buffer_manager.cpp +5 -0
- package/src/duckdb/src/storage/checkpoint_manager.cpp +10 -17
- package/src/duckdb/src/storage/data_table.cpp +34 -24
- package/src/duckdb/src/storage/local_storage.cpp +7 -3
- package/src/duckdb/src/storage/single_file_block_manager.cpp +3 -3
- package/src/duckdb/src/storage/storage_manager.cpp +25 -42
- package/src/duckdb/src/storage/table/column_data.cpp +2 -1
- package/src/duckdb/src/storage/table/row_group.cpp +7 -2
- package/src/duckdb/src/storage/wal_replay.cpp +6 -22
- package/src/duckdb/src/storage/write_ahead_log.cpp +3 -3
- package/src/duckdb/src/transaction/meta_transaction.cpp +106 -0
- package/src/duckdb/src/transaction/transaction.cpp +21 -21
- package/src/duckdb/src/transaction/transaction_context.cpp +44 -8
- package/src/duckdb/src/transaction/transaction_manager.cpp +20 -20
- package/src/duckdb/src/transaction/undo_buffer.cpp +1 -3
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +2 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +27 -1
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +99 -97
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +15206 -14793
- package/src/duckdb/ub_src_catalog.cpp +4 -0
- package/src/duckdb/ub_src_execution_operator_schema.cpp +2 -0
- package/src/duckdb/ub_src_function.cpp +2 -0
- package/src/duckdb/ub_src_function_table_system.cpp +0 -2
- package/src/duckdb/ub_src_main.cpp +4 -0
- package/src/duckdb/ub_src_parser_parsed_data.cpp +12 -0
- package/src/duckdb/ub_src_parser_statement.cpp +2 -0
- package/src/duckdb/ub_src_parser_transform_statement.cpp +4 -0
- package/src/duckdb/ub_src_planner_binder_statement.cpp +2 -0
- package/src/duckdb/ub_src_transaction.cpp +2 -0
- package/src/duckdb/src/function/table/system/pragma_functions.cpp +0 -120
|
@@ -19,6 +19,12 @@ struct DuckDBViewsData : public GlobalTableFunctionState {
|
|
|
19
19
|
|
|
20
20
|
static unique_ptr<FunctionData> DuckDBViewsBind(ClientContext &context, TableFunctionBindInput &input,
|
|
21
21
|
vector<LogicalType> &return_types, vector<string> &names) {
|
|
22
|
+
names.emplace_back("database_name");
|
|
23
|
+
return_types.emplace_back(LogicalType::VARCHAR);
|
|
24
|
+
|
|
25
|
+
names.emplace_back("database_oid");
|
|
26
|
+
return_types.emplace_back(LogicalType::BIGINT);
|
|
27
|
+
|
|
22
28
|
names.emplace_back("schema_name");
|
|
23
29
|
return_types.emplace_back(LogicalType::VARCHAR);
|
|
24
30
|
|
|
@@ -50,14 +56,10 @@ unique_ptr<GlobalTableFunctionState> DuckDBViewsInit(ClientContext &context, Tab
|
|
|
50
56
|
auto result = make_unique<DuckDBViewsData>();
|
|
51
57
|
|
|
52
58
|
// scan all the schemas for tables and collect themand collect them
|
|
53
|
-
auto schemas = Catalog::
|
|
59
|
+
auto schemas = Catalog::GetAllSchemas(context);
|
|
54
60
|
for (auto &schema : schemas) {
|
|
55
61
|
schema->Scan(context, CatalogType::VIEW_ENTRY, [&](CatalogEntry *entry) { result->entries.push_back(entry); });
|
|
56
62
|
};
|
|
57
|
-
|
|
58
|
-
// check the temp schema as well
|
|
59
|
-
SchemaCatalogEntry::GetTemporaryObjects(context)->Scan(
|
|
60
|
-
context, CatalogType::VIEW_ENTRY, [&](CatalogEntry *entry) { result->entries.push_back(entry); });
|
|
61
63
|
return move(result);
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -79,22 +81,27 @@ void DuckDBViewsFunction(ClientContext &context, TableFunctionInput &data_p, Dat
|
|
|
79
81
|
auto &view = (ViewCatalogEntry &)*entry;
|
|
80
82
|
|
|
81
83
|
// return values:
|
|
84
|
+
idx_t col = 0;
|
|
85
|
+
// database_name, VARCHAR
|
|
86
|
+
output.SetValue(col++, count, entry->catalog->GetName());
|
|
87
|
+
// database_oid, BIGINT
|
|
88
|
+
output.SetValue(col++, count, Value::BIGINT(entry->catalog->GetOid()));
|
|
82
89
|
// schema_name, LogicalType::VARCHAR
|
|
83
|
-
output.SetValue(
|
|
90
|
+
output.SetValue(col++, count, Value(view.schema->name));
|
|
84
91
|
// schema_oid, LogicalType::BIGINT
|
|
85
|
-
output.SetValue(
|
|
92
|
+
output.SetValue(col++, count, Value::BIGINT(view.schema->oid));
|
|
86
93
|
// view_name, LogicalType::VARCHAR
|
|
87
|
-
output.SetValue(
|
|
94
|
+
output.SetValue(col++, count, Value(view.name));
|
|
88
95
|
// view_oid, LogicalType::BIGINT
|
|
89
|
-
output.SetValue(
|
|
96
|
+
output.SetValue(col++, count, Value::BIGINT(view.oid));
|
|
90
97
|
// internal, LogicalType::BOOLEAN
|
|
91
|
-
output.SetValue(
|
|
98
|
+
output.SetValue(col++, count, Value::BOOLEAN(view.internal));
|
|
92
99
|
// temporary, LogicalType::BOOLEAN
|
|
93
|
-
output.SetValue(
|
|
100
|
+
output.SetValue(col++, count, Value::BOOLEAN(view.temporary));
|
|
94
101
|
// column_count, LogicalType::BIGINT
|
|
95
|
-
output.SetValue(
|
|
102
|
+
output.SetValue(col++, count, Value::BIGINT(view.types.size()));
|
|
96
103
|
// sql, LogicalType::VARCHAR
|
|
97
|
-
output.SetValue(
|
|
104
|
+
output.SetValue(col++, count, Value(view.ToSQL()));
|
|
98
105
|
|
|
99
106
|
count++;
|
|
100
107
|
}
|
|
@@ -26,12 +26,11 @@ static unique_ptr<FunctionData> PragmaCollateBind(ClientContext &context, TableF
|
|
|
26
26
|
unique_ptr<GlobalTableFunctionState> PragmaCollateInit(ClientContext &context, TableFunctionInitInput &input) {
|
|
27
27
|
auto result = make_unique<PragmaCollateData>();
|
|
28
28
|
|
|
29
|
-
Catalog::
|
|
30
|
-
|
|
29
|
+
auto schemas = Catalog::GetAllSchemas(context);
|
|
30
|
+
for (auto schema : schemas) {
|
|
31
31
|
schema->Scan(context, CatalogType::COLLATION_ENTRY,
|
|
32
32
|
[&](CatalogEntry *entry) { result->entries.push_back(entry->name); });
|
|
33
|
-
}
|
|
34
|
-
|
|
33
|
+
}
|
|
35
34
|
return move(result);
|
|
36
35
|
}
|
|
37
36
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
#include "duckdb/function/table/system_functions.hpp"
|
|
2
2
|
|
|
3
3
|
#include "duckdb/storage/storage_manager.hpp"
|
|
4
|
+
#include "duckdb/main/database_manager.hpp"
|
|
5
|
+
#include "duckdb/main/attached_database.hpp"
|
|
4
6
|
|
|
5
7
|
namespace duckdb {
|
|
6
8
|
|
|
7
9
|
struct PragmaDatabaseListData : public GlobalTableFunctionState {
|
|
8
|
-
PragmaDatabaseListData() :
|
|
10
|
+
PragmaDatabaseListData() : index(0) {
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
vector<AttachedDatabase *> databases;
|
|
14
|
+
idx_t index;
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
static unique_ptr<FunctionData> PragmaDatabaseListBind(ClientContext &context, TableFunctionBindInput &input,
|
|
@@ -26,21 +29,26 @@ static unique_ptr<FunctionData> PragmaDatabaseListBind(ClientContext &context, T
|
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
unique_ptr<GlobalTableFunctionState> PragmaDatabaseListInit(ClientContext &context, TableFunctionInitInput &input) {
|
|
29
|
-
|
|
32
|
+
auto result = make_unique<PragmaDatabaseListData>();
|
|
33
|
+
auto &db_manager = DatabaseManager::Get(context);
|
|
34
|
+
result->databases = db_manager.GetDatabases(context);
|
|
35
|
+
return move(result);
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
void PragmaDatabaseListFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) {
|
|
33
39
|
auto &data = (PragmaDatabaseListData &)*data_p.global_state;
|
|
34
|
-
if (data.finished) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
output.SetCardinality(1);
|
|
39
|
-
output.data[0].SetValue(0, Value::INTEGER(0));
|
|
40
|
-
output.data[1].SetValue(0, Value("main"));
|
|
41
|
-
output.data[2].SetValue(0, Value(StorageManager::GetStorageManager(context).GetDBPath()));
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
idx_t count = 0;
|
|
42
|
+
for (; count < STANDARD_VECTOR_SIZE && data.index < data.databases.size(); data.index++, count++) {
|
|
43
|
+
output.data[0].SetValue(count, Value::INTEGER(data.index));
|
|
44
|
+
output.data[1].SetValue(count, Value(data.databases[data.index]->GetName()));
|
|
45
|
+
Value file_name;
|
|
46
|
+
if (!data.databases[data.index]->IsSystem()) {
|
|
47
|
+
file_name = Value(data.databases[data.index]->GetStorageManager().GetDBPath());
|
|
48
|
+
}
|
|
49
|
+
output.data[2].SetValue(count, file_name);
|
|
50
|
+
}
|
|
51
|
+
output.SetCardinality(count);
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
void PragmaDatabaseList::RegisterFunction(BuiltinFunctions &set) {
|
|
@@ -5,18 +5,26 @@
|
|
|
5
5
|
#include "duckdb/storage/storage_info.hpp"
|
|
6
6
|
#include "duckdb/common/to_string.hpp"
|
|
7
7
|
#include "duckdb/common/string_util.hpp"
|
|
8
|
+
#include "duckdb/main/attached_database.hpp"
|
|
9
|
+
#include "duckdb/main/database_manager.hpp"
|
|
8
10
|
|
|
9
11
|
namespace duckdb {
|
|
10
12
|
|
|
11
13
|
struct PragmaDatabaseSizeData : public GlobalTableFunctionState {
|
|
12
|
-
PragmaDatabaseSizeData() :
|
|
14
|
+
PragmaDatabaseSizeData() : index(0) {
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
idx_t index;
|
|
18
|
+
vector<AttachedDatabase *> databases;
|
|
19
|
+
Value memory_usage;
|
|
20
|
+
Value memory_limit;
|
|
16
21
|
};
|
|
17
22
|
|
|
18
23
|
static unique_ptr<FunctionData> PragmaDatabaseSizeBind(ClientContext &context, TableFunctionBindInput &input,
|
|
19
24
|
vector<LogicalType> &return_types, vector<string> &names) {
|
|
25
|
+
names.emplace_back("database_name");
|
|
26
|
+
return_types.emplace_back(LogicalType::VARCHAR);
|
|
27
|
+
|
|
20
28
|
names.emplace_back("database_size");
|
|
21
29
|
return_types.emplace_back(LogicalType::VARCHAR);
|
|
22
30
|
|
|
@@ -45,33 +53,40 @@ static unique_ptr<FunctionData> PragmaDatabaseSizeBind(ClientContext &context, T
|
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
unique_ptr<GlobalTableFunctionState> PragmaDatabaseSizeInit(ClientContext &context, TableFunctionInitInput &input) {
|
|
48
|
-
|
|
56
|
+
auto result = make_unique<PragmaDatabaseSizeData>();
|
|
57
|
+
result->databases = DatabaseManager::Get(context).GetDatabases(context);
|
|
58
|
+
auto &buffer_manager = BufferManager::GetBufferManager(context);
|
|
59
|
+
result->memory_usage = Value(StringUtil::BytesToHumanReadableString(buffer_manager.GetUsedMemory()));
|
|
60
|
+
auto max_memory = buffer_manager.GetMaxMemory();
|
|
61
|
+
result->memory_limit =
|
|
62
|
+
max_memory == (idx_t)-1 ? Value("Unlimited") : Value(StringUtil::BytesToHumanReadableString(max_memory));
|
|
63
|
+
|
|
64
|
+
return move(result);
|
|
49
65
|
}
|
|
50
66
|
|
|
51
67
|
void PragmaDatabaseSizeFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) {
|
|
52
68
|
auto &data = (PragmaDatabaseSizeData &)*data_p.global_state;
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
idx_t row = 0;
|
|
70
|
+
for (; data.index < data.databases.size() && row < STANDARD_VECTOR_SIZE; data.index++) {
|
|
71
|
+
auto db = data.databases[data.index];
|
|
72
|
+
if (db->IsSystem() || db->IsTemporary()) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
auto &storage = db->GetStorageManager();
|
|
76
|
+
auto ds = storage.GetDatabaseSize();
|
|
77
|
+
idx_t col = 0;
|
|
78
|
+
output.data[col++].SetValue(row, Value(db->GetName()));
|
|
79
|
+
output.data[col++].SetValue(row, Value(StringUtil::BytesToHumanReadableString(ds.bytes)));
|
|
80
|
+
output.data[col++].SetValue(row, Value::BIGINT(ds.block_size));
|
|
81
|
+
output.data[col++].SetValue(row, Value::BIGINT(ds.total_blocks));
|
|
82
|
+
output.data[col++].SetValue(row, Value::BIGINT(ds.used_blocks));
|
|
83
|
+
output.data[col++].SetValue(row, Value::BIGINT(ds.free_blocks));
|
|
84
|
+
output.data[col++].SetValue(row, Value(StringUtil::BytesToHumanReadableString(ds.wal_size)));
|
|
85
|
+
output.data[col++].SetValue(row, data.memory_usage);
|
|
86
|
+
output.data[col++].SetValue(row, data.memory_limit);
|
|
87
|
+
row++;
|
|
55
88
|
}
|
|
56
|
-
|
|
57
|
-
auto &buffer_manager = BufferManager::GetBufferManager(context);
|
|
58
|
-
|
|
59
|
-
auto ds = storage.GetDatabaseSize();
|
|
60
|
-
|
|
61
|
-
output.SetCardinality(1);
|
|
62
|
-
output.data[0].SetValue(0, Value(StringUtil::BytesToHumanReadableString(ds.bytes)));
|
|
63
|
-
output.data[1].SetValue(0, Value::BIGINT(ds.block_size));
|
|
64
|
-
output.data[2].SetValue(0, Value::BIGINT(ds.total_blocks));
|
|
65
|
-
output.data[3].SetValue(0, Value::BIGINT(ds.used_blocks));
|
|
66
|
-
output.data[4].SetValue(0, Value::BIGINT(ds.free_blocks));
|
|
67
|
-
output.data[5].SetValue(0, Value(StringUtil::BytesToHumanReadableString(ds.wal_size)));
|
|
68
|
-
|
|
69
|
-
output.data[6].SetValue(0, Value(StringUtil::BytesToHumanReadableString(buffer_manager.GetUsedMemory())));
|
|
70
|
-
auto max_memory = buffer_manager.GetMaxMemory();
|
|
71
|
-
output.data[7].SetValue(0, max_memory == (idx_t)-1 ? Value("Unlimited")
|
|
72
|
-
: Value(StringUtil::BytesToHumanReadableString(max_memory)));
|
|
73
|
-
|
|
74
|
-
data.finished = true;
|
|
89
|
+
output.SetCardinality(row);
|
|
75
90
|
}
|
|
76
91
|
|
|
77
92
|
void PragmaDatabaseSize::RegisterFunction(BuiltinFunctions &set) {
|
|
@@ -77,13 +77,7 @@ static unique_ptr<FunctionData> PragmaStorageInfoBind(ClientContext &context, Ta
|
|
|
77
77
|
auto qname = QualifiedName::Parse(input.inputs[0].GetValue<string>());
|
|
78
78
|
|
|
79
79
|
// look up the table name in the catalog
|
|
80
|
-
auto
|
|
81
|
-
auto entry = catalog.GetEntry(context, CatalogType::TABLE_ENTRY, qname.schema, qname.name);
|
|
82
|
-
if (entry->type != CatalogType::TABLE_ENTRY) {
|
|
83
|
-
throw Exception("storage_info requires a table as parameter");
|
|
84
|
-
}
|
|
85
|
-
auto table_entry = (TableCatalogEntry *)entry;
|
|
86
|
-
|
|
80
|
+
auto table_entry = Catalog::GetEntry<TableCatalogEntry>(context, qname.catalog, qname.schema, qname.name);
|
|
87
81
|
auto result = make_unique<PragmaStorageFunctionData>(table_entry);
|
|
88
82
|
result->storage_info = table_entry->storage->GetStorageInfo();
|
|
89
83
|
return move(result);
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#include "duckdb/planner/constraints/bound_not_null_constraint.hpp"
|
|
8
8
|
#include "duckdb/planner/constraints/bound_unique_constraint.hpp"
|
|
9
9
|
#include "duckdb/planner/expression/bound_parameter_expression.hpp"
|
|
10
|
+
#include "duckdb/planner/binder.hpp"
|
|
10
11
|
|
|
11
12
|
#include "duckdb/common/exception.hpp"
|
|
12
13
|
#include "duckdb/common/limits.hpp"
|
|
@@ -52,8 +53,8 @@ static unique_ptr<FunctionData> PragmaTableInfoBind(ClientContext &context, Tabl
|
|
|
52
53
|
auto qname = QualifiedName::Parse(input.inputs[0].GetValue<string>());
|
|
53
54
|
|
|
54
55
|
// look up the table name in the catalog
|
|
55
|
-
|
|
56
|
-
auto entry =
|
|
56
|
+
Binder::BindSchemaOrCatalog(context, qname.catalog, qname.schema);
|
|
57
|
+
auto entry = Catalog::GetEntry(context, CatalogType::TABLE_ENTRY, qname.catalog, qname.schema, qname.name);
|
|
57
58
|
return make_unique<PragmaTableFunctionData>(entry);
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -10,7 +10,6 @@ namespace duckdb {
|
|
|
10
10
|
|
|
11
11
|
void BuiltinFunctions::RegisterSQLiteFunctions() {
|
|
12
12
|
PragmaVersion::RegisterFunction(*this);
|
|
13
|
-
PragmaFunctionPragma::RegisterFunction(*this);
|
|
14
13
|
PragmaCollations::RegisterFunction(*this);
|
|
15
14
|
PragmaTableInfo::RegisterFunction(*this);
|
|
16
15
|
PragmaStorageInfo::RegisterFunction(*this);
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
#include "duckdb/storage/data_table.hpp"
|
|
13
13
|
#include "duckdb/transaction/local_storage.hpp"
|
|
14
14
|
#include "duckdb/transaction/transaction.hpp"
|
|
15
|
+
#include "duckdb/main/attached_database.hpp"
|
|
16
|
+
#include "duckdb/catalog/dependency_list.hpp"
|
|
15
17
|
|
|
16
18
|
namespace duckdb {
|
|
17
19
|
|
|
@@ -102,7 +104,7 @@ unique_ptr<GlobalTableFunctionState> TableScanInitGlobal(ClientContext &context,
|
|
|
102
104
|
static unique_ptr<BaseStatistics> TableScanStatistics(ClientContext &context, const FunctionData *bind_data_p,
|
|
103
105
|
column_t column_id) {
|
|
104
106
|
auto &bind_data = (const TableScanBindData &)*bind_data_p;
|
|
105
|
-
auto &local_storage = LocalStorage::Get(context);
|
|
107
|
+
auto &local_storage = LocalStorage::Get(context, *bind_data.table->catalog);
|
|
106
108
|
if (local_storage.Find(bind_data.table->storage.get())) {
|
|
107
109
|
// we don't emit any statistics for tables that have outstanding transaction-local data
|
|
108
110
|
return nullptr;
|
|
@@ -114,7 +116,7 @@ static void TableScanFunc(ClientContext &context, TableFunctionInput &data_p, Da
|
|
|
114
116
|
auto &bind_data = (TableScanBindData &)*data_p.bind_data;
|
|
115
117
|
auto &gstate = (TableScanGlobalState &)*data_p.global_state;
|
|
116
118
|
auto &state = (TableScanLocalState &)*data_p.local_state;
|
|
117
|
-
auto &transaction = Transaction::
|
|
119
|
+
auto &transaction = Transaction::Get(context, *bind_data.table->catalog);
|
|
118
120
|
do {
|
|
119
121
|
if (bind_data.is_create_index) {
|
|
120
122
|
bind_data.table->storage->CreateIndexScan(
|
|
@@ -180,14 +182,14 @@ BindInfo TableScanGetBindInfo(const FunctionData *bind_data) {
|
|
|
180
182
|
return BindInfo(ScanType::TABLE);
|
|
181
183
|
}
|
|
182
184
|
|
|
183
|
-
void TableScanDependency(
|
|
185
|
+
void TableScanDependency(DependencyList &entries, const FunctionData *bind_data_p) {
|
|
184
186
|
auto &bind_data = (const TableScanBindData &)*bind_data_p;
|
|
185
|
-
entries.
|
|
187
|
+
entries.AddDependency(bind_data.table);
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
unique_ptr<NodeStatistics> TableScanCardinality(ClientContext &context, const FunctionData *bind_data_p) {
|
|
189
191
|
auto &bind_data = (const TableScanBindData &)*bind_data_p;
|
|
190
|
-
auto &local_storage = LocalStorage::Get(context);
|
|
192
|
+
auto &local_storage = LocalStorage::Get(context, *bind_data.table->catalog);
|
|
191
193
|
idx_t estimated_cardinality =
|
|
192
194
|
bind_data.table->storage->info->cardinality + local_storage.AddedRows(bind_data.table->storage.get());
|
|
193
195
|
return make_unique<NodeStatistics>(bind_data.table->storage->info->cardinality, estimated_cardinality);
|
|
@@ -214,7 +216,7 @@ static unique_ptr<GlobalTableFunctionState> IndexScanInitGlobal(ClientContext &c
|
|
|
214
216
|
row_id_data = (data_ptr_t)&bind_data.result_ids[0];
|
|
215
217
|
}
|
|
216
218
|
auto result = make_unique<IndexScanGlobalState>(row_id_data);
|
|
217
|
-
auto &local_storage = LocalStorage::Get(context);
|
|
219
|
+
auto &local_storage = LocalStorage::Get(context, *bind_data.table->catalog);
|
|
218
220
|
result->column_ids = input.column_ids;
|
|
219
221
|
result->local_storage_state.Initialize(input.column_ids, input.filters);
|
|
220
222
|
local_storage.InitializeScan(bind_data.table->storage.get(), result->local_storage_state.local_state,
|
|
@@ -227,7 +229,7 @@ static unique_ptr<GlobalTableFunctionState> IndexScanInitGlobal(ClientContext &c
|
|
|
227
229
|
static void IndexScanFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) {
|
|
228
230
|
auto &bind_data = (const TableScanBindData &)*data_p.bind_data;
|
|
229
231
|
auto &state = (IndexScanGlobalState &)*data_p.global_state;
|
|
230
|
-
auto &transaction = Transaction::
|
|
232
|
+
auto &transaction = Transaction::Get(context, *bind_data.table->catalog);
|
|
231
233
|
auto &local_storage = LocalStorage::Get(transaction);
|
|
232
234
|
|
|
233
235
|
if (!state.finished) {
|
|
@@ -363,7 +365,7 @@ void TableScanPushdownComplexFilter(ClientContext &context, LogicalGet &get, Fun
|
|
|
363
365
|
}
|
|
364
366
|
if (!equal_value.IsNull() || !low_value.IsNull() || !high_value.IsNull()) {
|
|
365
367
|
// we can scan this index using this predicate: try a scan
|
|
366
|
-
auto &transaction = Transaction::
|
|
368
|
+
auto &transaction = Transaction::Get(context, *bind_data.table->catalog);
|
|
367
369
|
unique_ptr<IndexScanState> index_state;
|
|
368
370
|
if (!equal_value.IsNull()) {
|
|
369
371
|
// equality predicate
|
|
@@ -407,6 +409,7 @@ static void TableScanSerialize(FieldWriter &writer, const FunctionData *bind_dat
|
|
|
407
409
|
writer.WriteField<bool>(bind_data.is_index_scan);
|
|
408
410
|
writer.WriteField<bool>(bind_data.is_create_index);
|
|
409
411
|
writer.WriteList<row_t>(bind_data.result_ids);
|
|
412
|
+
writer.WriteString(bind_data.table->schema->catalog->GetName());
|
|
410
413
|
}
|
|
411
414
|
|
|
412
415
|
static unique_ptr<FunctionData> TableScanDeserialize(ClientContext &context, FieldReader &reader,
|
|
@@ -416,9 +419,9 @@ static unique_ptr<FunctionData> TableScanDeserialize(ClientContext &context, Fie
|
|
|
416
419
|
auto is_index_scan = reader.ReadRequired<bool>();
|
|
417
420
|
auto is_create_index = reader.ReadRequired<bool>();
|
|
418
421
|
auto result_ids = reader.ReadRequiredList<row_t>();
|
|
422
|
+
auto catalog_name = reader.ReadField<string>(INVALID_CATALOG);
|
|
419
423
|
|
|
420
|
-
auto
|
|
421
|
-
auto catalog_entry = catalog.GetEntry(context, CatalogType::TABLE_ENTRY, schema_name, table_name);
|
|
424
|
+
auto catalog_entry = Catalog::GetEntry<TableCatalogEntry>(context, catalog_name, schema_name, table_name);
|
|
422
425
|
if (!catalog_entry || catalog_entry->type != CatalogType::TABLE_ENTRY) {
|
|
423
426
|
throw SerializationException("Cant find table for %s.%s", schema_name, table_name);
|
|
424
427
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#ifndef DUCKDB_VERSION
|
|
2
|
-
#define DUCKDB_VERSION "0.6.2-
|
|
2
|
+
#define DUCKDB_VERSION "0.6.2-dev889"
|
|
3
3
|
#endif
|
|
4
4
|
#ifndef DUCKDB_SOURCE_ID
|
|
5
|
-
#define DUCKDB_SOURCE_ID "
|
|
5
|
+
#define DUCKDB_SOURCE_ID "062fc98c51"
|
|
6
6
|
#endif
|
|
7
7
|
#include "duckdb/function/table/system_functions.hpp"
|
|
8
8
|
#include "duckdb/main/database.hpp"
|