duckdb 0.10.2-dev0.0 → 0.10.2-dev3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/binding.gyp +22 -18
- package/binding.gyp.in +3 -0
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-timezone.cpp +3 -1
- package/src/duckdb/extension/icu/icu_extension.cpp +6 -2
- package/src/duckdb/extension/json/buffered_json_reader.cpp +10 -3
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +2 -0
- package/src/duckdb/extension/json/include/json_scan.hpp +13 -7
- package/src/duckdb/extension/json/include/json_serializer.hpp +5 -4
- package/src/duckdb/extension/json/include/json_structure.hpp +3 -3
- package/src/duckdb/extension/json/json_functions/json_serialize_plan.cpp +15 -5
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +15 -6
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +21 -20
- package/src/duckdb/extension/json/json_functions/read_json.cpp +37 -3
- package/src/duckdb/extension/json/json_functions.cpp +7 -2
- package/src/duckdb/extension/json/json_scan.cpp +57 -33
- package/src/duckdb/extension/parquet/column_reader.cpp +12 -3
- package/src/duckdb/extension/parquet/column_writer.cpp +44 -7
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +5 -1
- package/src/duckdb/extension/parquet/parquet_extension.cpp +30 -3
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +1 -1
- package/src/duckdb/extension/parquet/parquet_writer.cpp +4 -2
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +1 -1
- package/src/duckdb/src/catalog/catalog.cpp +5 -1
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +21 -5
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +8 -9
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +3 -7
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +6 -7
- package/src/duckdb/src/catalog/catalog_entry.cpp +8 -0
- package/src/duckdb/src/catalog/catalog_search_path.cpp +5 -0
- package/src/duckdb/src/catalog/catalog_set.cpp +2 -2
- package/src/duckdb/src/catalog/default/default_functions.cpp +6 -6
- package/src/duckdb/src/catalog/default/default_schemas.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_views.cpp +7 -7
- package/src/duckdb/src/catalog/dependency_catalog_set.cpp +2 -1
- package/src/duckdb/src/catalog/dependency_list.cpp +92 -8
- package/src/duckdb/src/catalog/dependency_manager.cpp +53 -68
- package/src/duckdb/src/catalog/duck_catalog.cpp +1 -1
- package/src/duckdb/src/common/adbc/adbc.cpp +287 -45
- package/src/duckdb/src/common/arrow/appender/union_data.cpp +2 -2
- package/src/duckdb/src/common/box_renderer.cpp +12 -12
- package/src/duckdb/src/common/crypto/md5.cpp +2 -1
- package/src/duckdb/src/common/enum_util.cpp +307 -1
- package/src/duckdb/src/common/enums/expression_type.cpp +4 -0
- package/src/duckdb/src/common/enums/optimizer_type.cpp +1 -1
- package/src/duckdb/src/common/file_system.cpp +60 -13
- package/src/duckdb/src/common/filename_pattern.cpp +13 -13
- package/src/duckdb/src/common/gzip_file_system.cpp +1 -1
- package/src/duckdb/src/common/http_state.cpp +1 -1
- package/src/duckdb/src/common/local_file_system.cpp +72 -71
- package/src/duckdb/src/common/multi_file_reader.cpp +48 -28
- package/src/duckdb/src/common/row_operations/row_matcher.cpp +2 -2
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +13 -1
- package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +32 -13
- package/src/duckdb/src/common/string_util.cpp +2 -3
- package/src/duckdb/src/common/tree_renderer.cpp +32 -67
- package/src/duckdb/src/common/types/bit.cpp +6 -6
- package/src/duckdb/src/common/types/data_chunk.cpp +2 -2
- package/src/duckdb/src/common/types/hash.cpp +6 -6
- package/src/duckdb/src/common/types/hyperloglog.cpp +2 -0
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +13 -0
- package/src/duckdb/src/common/types/row/tuple_data_layout.cpp +5 -7
- package/src/duckdb/src/common/types/uuid.cpp +1 -1
- package/src/duckdb/src/common/types/vector.cpp +22 -14
- package/src/duckdb/src/common/types.cpp +8 -1
- package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +20 -18
- package/src/duckdb/src/common/vector_operations/generators.cpp +1 -1
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +267 -110
- package/src/duckdb/src/common/vector_operations/vector_hash.cpp +52 -23
- package/src/duckdb/src/common/virtual_file_system.cpp +33 -20
- package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +3 -3
- package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +31 -16
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +3 -0
- package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +2 -0
- package/src/duckdb/src/core_functions/core_functions.cpp +1 -1
- package/src/duckdb/src/core_functions/function_list.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/date/time_bucket.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +46 -17
- package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/list/flatten.cpp +82 -45
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +3 -0
- package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +3 -2
- package/src/duckdb/src/core_functions/scalar/string/hex.cpp +2 -4
- package/src/duckdb/src/core_functions/scalar/string/repeat.cpp +12 -21
- package/src/duckdb/src/execution/column_binding_resolver.cpp +2 -10
- package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +133 -66
- package/src/duckdb/src/execution/expression_executor/execute_function.cpp +0 -2
- package/src/duckdb/src/execution/expression_executor.cpp +0 -4
- package/src/duckdb/src/execution/expression_executor_state.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +2 -2
- package/src/duckdb/src/execution/index/unknown_index.cpp +13 -13
- package/src/duckdb/src/execution/join_hashtable.cpp +1 -1
- package/src/duckdb/src/execution/nested_loop_join/nested_loop_join_mark.cpp +0 -1
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +10 -7
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +32 -1
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +16 -2
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp +7 -7
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +354 -159
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +11 -2
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +22 -7
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +10 -10
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +9 -18
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +180 -47
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +100 -58
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +88 -21
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +12 -13
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +2 -0
- package/src/duckdb/src/execution/operator/persistent/csv_rejects_table.cpp +118 -23
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +14 -5
- package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +5 -5
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +0 -9
- package/src/duckdb/src/execution/physical_plan/plan_vacuum.cpp +18 -0
- package/src/duckdb/src/execution/physical_plan_generator.cpp +5 -3
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +81 -106
- package/src/duckdb/src/execution/reservoir_sample.cpp +1 -1
- package/src/duckdb/src/execution/window_executor.cpp +48 -28
- package/src/duckdb/src/execution/window_segment_tree.cpp +20 -23
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +1 -1
- package/src/duckdb/src/function/cast/enum_casts.cpp +20 -55
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +10 -9
- package/src/duckdb/src/function/cast_rules.cpp +9 -1
- package/src/duckdb/src/function/compression_config.cpp +1 -1
- package/src/duckdb/src/function/function_binder.cpp +45 -44
- package/src/duckdb/src/function/function_set.cpp +9 -9
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -2
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +21 -5
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +2 -2
- package/src/duckdb/src/function/scalar/list/list_select.cpp +5 -2
- package/src/duckdb/src/function/scalar/list/list_zip.cpp +5 -4
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +60 -32
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +1 -1
- package/src/duckdb/src/function/scalar/strftime_format.cpp +31 -25
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +6 -6
- package/src/duckdb/src/function/scalar/string/length.cpp +23 -2
- package/src/duckdb/src/function/scalar/string/like.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +1 -1
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +3 -3
- package/src/duckdb/src/function/table/arrow/arrow_array_scan_state.cpp +1 -1
- package/src/duckdb/src/function/table/arrow.cpp +7 -1
- package/src/duckdb/src/function/table/copy_csv.cpp +17 -13
- package/src/duckdb/src/function/table/read_csv.cpp +52 -39
- package/src/duckdb/src/function/table/sniff_csv.cpp +7 -13
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +7 -1
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +12 -2
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +1 -2
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +2 -2
- package/src/duckdb/src/function/table/system/pragma_metadata_info.cpp +9 -2
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +10 -6
- package/src/duckdb/src/function/table/table_scan.cpp +1 -4
- package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +6 -2
- 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 +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +6 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/default/default_functions.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/dependency.hpp +26 -4
- package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +39 -6
- package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +19 -14
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_wrapper.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +16 -16
- package/src/duckdb/src/include/duckdb/common/crypto/md5.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +32 -0
- package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +4 -2
- package/src/duckdb/src/include/duckdb/common/exception/binder_exception.hpp +14 -10
- package/src/duckdb/src/include/duckdb/common/exception/catalog_exception.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/exception/conversion_exception.hpp +6 -6
- package/src/duckdb/src/include/duckdb/common/exception/http_exception.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/exception/parser_exception.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/exception/transaction_exception.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/exception.hpp +57 -58
- package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/file_open_flags.hpp +134 -0
- package/src/duckdb/src/include/duckdb/common/file_opener.hpp +9 -6
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +35 -36
- package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +4 -6
- package/src/duckdb/src/include/duckdb/common/fixed_size_map.hpp +13 -13
- package/src/duckdb/src/include/duckdb/common/helper.hpp +42 -47
- package/src/duckdb/src/include/duckdb/common/http_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/hugeint.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/index_vector.hpp +10 -10
- package/src/duckdb/src/include/duckdb/common/local_file_system.hpp +13 -10
- package/src/duckdb/src/include/duckdb/common/memory_safety.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/opener_file_system.hpp +50 -24
- package/src/duckdb/src/include/duckdb/common/operator/abs.hpp +12 -4
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/pipe_file_system.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/platform.h +1 -1
- package/src/duckdb/src/include/duckdb/common/printer.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/profiler.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/progress_bar/display/terminal_progress_bar_display.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/random_engine.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +7 -7
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +17 -6
- package/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +14 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp +16 -0
- package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/tree_renderer.hpp +24 -25
- package/src/duckdb/src/include/duckdb/common/typedefs.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +10 -10
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_iterators.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/types/column/partitioned_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/constraint_conflict_info.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/date.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/hash.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/interval.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_layout.hpp +10 -3
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +12 -12
- package/src/duckdb/src/include/duckdb/common/types/string_heap.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +21 -20
- package/src/duckdb/src/include/duckdb/common/types/time.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/types/uuid.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +15 -7
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +14 -10
- package/src/duckdb/src/include/duckdb/common/uhugeint.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +15 -14
- package/src/duckdb/src/include/duckdb/common/vector.hpp +21 -21
- package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/vector_operations/general_cast.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/vector_operations/generic_executor.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/vector_operations/vector_operations.hpp +50 -32
- package/src/duckdb/src/include/duckdb/common/virtual_file_system.hpp +10 -11
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +13 -1
- package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/lambda_functions.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/column_binding_resolver.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +2 -5
- package/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/aggregate_object.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/distinct_aggregate_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +0 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer.hpp +9 -6
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +40 -22
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_handle.hpp +5 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_option.hpp +6 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +24 -10
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine.hpp +4 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/global_csv_state.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/skip_scanner.hpp +0 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +58 -17
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_rejects_table.hpp +16 -5
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +6 -6
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/window_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +5 -5
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/compression_function.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +10 -13
- package/src/duckdb/src/include/duckdb/function/function.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +24 -23
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/function_set.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/pragma_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +7 -7
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_duck_schema.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -3
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +12 -11
- package/src/duckdb/src/include/duckdb/function/udf_function.hpp +66 -60
- package/src/duckdb/src/include/duckdb/main/appender.hpp +6 -6
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/buffered_data/simple_buffered_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/chunk_scan_state/query_result.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/client_context_file_opener.hpp +3 -2
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/client_properties.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +14 -5
- package/src/duckdb/src/include/duckdb/main/connection.hpp +27 -26
- package/src/duckdb/src/include/duckdb/main/database.hpp +19 -3
- package/src/duckdb/src/include/duckdb/main/database_file_opener.hpp +58 -0
- package/src/duckdb/src/include/duckdb/main/database_path_and_type.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/error_manager.hpp +6 -6
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +8 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/external_dependencies.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +8 -8
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +2 -59
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +3 -3
- package/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +11 -7
- package/src/duckdb/src/include/duckdb/main/secret/secret_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/secret/secret_storage.hpp +4 -4
- package/src/duckdb/src/include/duckdb/main/settings.hpp +78 -70
- package/src/duckdb/src/include/duckdb/optimizer/column_lifetime_analyzer.hpp +45 -0
- package/src/duckdb/src/include/duckdb/optimizer/compressed_materialization.hpp +11 -13
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +2 -2
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/relation_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/matcher/expression_matcher.hpp +7 -7
- package/src/duckdb/src/include/duckdb/optimizer/matcher/function_matcher.hpp +7 -7
- package/src/duckdb/src/include/duckdb/optimizer/matcher/type_matcher.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/optimizer.hpp +3 -0
- package/src/duckdb/src/include/duckdb/optimizer/statistics_propagator.hpp +32 -30
- package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/event.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/executor_task.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parallel/pipeline_event.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -4
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +49 -8
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_database_info.hpp +40 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_pragma_function_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_secret_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/extra_drop_info.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +2 -5
- package/src/duckdb/src/include/duckdb/parser/parser.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +3 -5
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +16 -9
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_expanded_expression.hpp +34 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +5 -8
- package/src/duckdb/src/include/duckdb/planner/expression_binder/column_alias_binder.hpp +3 -4
- package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +3 -5
- package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +6 -14
- package/src/duckdb/src/include/duckdb/planner/expression_binder/qualify_binder.hpp +3 -6
- package/src/duckdb/src/include/duckdb/planner/expression_binder/select_bind_state.hpp +52 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/select_binder.hpp +4 -10
- package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression_iterator.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +3 -6
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_database.hpp +4 -12
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_secret.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +3 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_vacuum.hpp +52 -0
- package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_select_node.hpp +5 -4
- package/src/duckdb/src/include/duckdb/planner/subquery/flatten_dependent_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +4 -1
- package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +2 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint/string_checkpoint_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +5 -5
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/flag_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/leading_zero_buffer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_analyze.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_analyze.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/index.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/magic_bytes.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/object_cache.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +4 -1
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +24 -24
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/statistics/segment_statistics.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +9 -6
- package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +10 -1
- package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group_segment_tree.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_version_manager.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/table/segment_lock.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -0
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table_storage_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/delete_info.hpp +20 -1
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/update_info.hpp +1 -1
- package/src/duckdb/src/main/appender.cpp +1 -1
- package/src/duckdb/src/main/attached_database.cpp +11 -3
- package/src/duckdb/src/main/capi/arrow-c.cpp +6 -2
- package/src/duckdb/src/main/capi/cast/utils-c.cpp +1 -1
- package/src/duckdb/src/main/capi/duckdb-c.cpp +1 -1
- package/src/duckdb/src/main/capi/pending-c.cpp +1 -1
- package/src/duckdb/src/main/capi/prepared-c.cpp +2 -2
- package/src/duckdb/src/main/capi/result-c.cpp +4 -4
- package/src/duckdb/src/main/client_context.cpp +4 -12
- package/src/duckdb/src/main/client_context_file_opener.cpp +15 -3
- package/src/duckdb/src/main/client_data.cpp +5 -0
- package/src/duckdb/src/main/config.cpp +82 -82
- package/src/duckdb/src/main/database.cpp +31 -7
- package/src/duckdb/src/main/database_manager.cpp +3 -2
- package/src/duckdb/src/main/database_path_and_type.cpp +4 -4
- package/src/duckdb/src/main/error_manager.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_alias.cpp +9 -9
- package/src/duckdb/src/main/extension/extension_helper.cpp +10 -5
- package/src/duckdb/src/main/extension/extension_install.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +111 -37
- package/src/duckdb/src/main/query_profiler.cpp +1 -118
- package/src/duckdb/src/main/secret/secret_manager.cpp +1 -2
- package/src/duckdb/src/main/secret/secret_storage.cpp +1 -1
- package/src/duckdb/src/main/settings/settings.cpp +81 -65
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +8 -1
- package/src/duckdb/src/optimizer/compressed_materialization/compress_aggregate.cpp +3 -0
- package/src/duckdb/src/optimizer/compressed_materialization.cpp +26 -28
- package/src/duckdb/src/optimizer/cse_optimizer.cpp +5 -5
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +10 -6
- package/src/duckdb/src/optimizer/optimizer.cpp +14 -17
- package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +16 -5
- package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +7 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +2 -2
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +3 -3
- package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_aggregate.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_between.cpp +8 -8
- package/src/duckdb/src/optimizer/statistics/expression/propagate_case.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_cast.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_columnref.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_comparison.cpp +7 -7
- package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +6 -6
- package/src/duckdb/src/optimizer/statistics/expression/propagate_constant.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_function.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +10 -10
- package/src/duckdb/src/optimizer/statistics/operator/propagate_aggregate.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_cross_product.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +14 -7
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +9 -9
- package/src/duckdb/src/optimizer/statistics/operator/propagate_limit.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_order.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_projection.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_window.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics_propagator.cpp +39 -18
- package/src/duckdb/src/parallel/pipeline_finish_event.cpp +1 -1
- package/src/duckdb/src/parallel/task_scheduler.cpp +8 -1
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +4 -2
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +64 -0
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -0
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +13 -5
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +24 -0
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +1 -8
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +2 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +3 -0
- package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +2 -6
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +2 -6
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -6
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_select.cpp +5 -2
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +2 -8
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +1 -6
- package/src/duckdb/src/parser/transform/statement/transform_use.cpp +3 -2
- package/src/duckdb/src/parser/transformer.cpp +14 -2
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +40 -17
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +8 -3
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +32 -30
- package/src/duckdb/src/planner/binder/query_node/bind_cte_node.cpp +28 -17
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +146 -101
- package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +28 -26
- package/src/duckdb/src/planner/binder/query_node/plan_cte_node.cpp +29 -0
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +10 -10
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +23 -28
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +11 -12
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +9 -11
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +10 -13
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +3 -3
- package/src/duckdb/src/planner/binder/statement/bind_set.cpp +3 -0
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +66 -65
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +54 -46
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +3 -0
- package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +5 -5
- package/src/duckdb/src/planner/binder.cpp +78 -6
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +11 -3
- package/src/duckdb/src/planner/expression/bound_expanded_expression.cpp +22 -0
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +11 -58
- package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +5 -8
- package/src/duckdb/src/planner/expression_binder/group_binder.cpp +5 -4
- package/src/duckdb/src/planner/expression_binder/having_binder.cpp +5 -19
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +8 -8
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +42 -26
- package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +3 -22
- package/src/duckdb/src/planner/expression_binder/select_bind_state.cpp +52 -0
- package/src/duckdb/src/planner/expression_binder/select_binder.cpp +43 -5
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +19 -7
- package/src/duckdb/src/planner/logical_operator.cpp +20 -3
- package/src/duckdb/src/planner/operator/logical_copy_database.cpp +4 -14
- package/src/duckdb/src/planner/operator/logical_delete.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_get.cpp +1 -1
- 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/operator/logical_vacuum.cpp +65 -0
- package/src/duckdb/src/planner/planner.cpp +4 -4
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +26 -27
- package/src/duckdb/src/storage/arena_allocator.cpp +9 -0
- package/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp +1 -1
- package/src/duckdb/src/storage/buffer_manager.cpp +2 -10
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +2 -3
- package/src/duckdb/src/storage/checkpoint_manager.cpp +15 -8
- package/src/duckdb/src/storage/compression/bitpacking.cpp +6 -1
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +1 -1
- package/src/duckdb/src/storage/data_pointer.cpp +1 -1
- package/src/duckdb/src/storage/data_table.cpp +18 -7
- package/src/duckdb/src/storage/local_storage.cpp +8 -5
- package/src/duckdb/src/storage/magic_bytes.cpp +6 -5
- package/src/duckdb/src/storage/partial_block_manager.cpp +1 -1
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +20 -9
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +12 -10
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +23 -0
- package/src/duckdb/src/storage/single_file_block_manager.cpp +46 -19
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +21 -5
- package/src/duckdb/src/storage/statistics/array_stats.cpp +1 -1
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +2 -3
- package/src/duckdb/src/storage/statistics/list_stats.cpp +1 -1
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +1 -1
- package/src/duckdb/src/storage/storage_info.cpp +19 -19
- package/src/duckdb/src/storage/storage_manager.cpp +18 -13
- package/src/duckdb/src/storage/table/chunk_info.cpp +11 -3
- package/src/duckdb/src/storage/table/column_data.cpp +88 -66
- package/src/duckdb/src/storage/table/row_group.cpp +7 -7
- package/src/duckdb/src/storage/table/row_version_manager.cpp +2 -2
- package/src/duckdb/src/storage/table/standard_column_data.cpp +4 -0
- package/src/duckdb/src/storage/table/update_segment.cpp +3 -1
- package/src/duckdb/src/storage/table_index_list.cpp +6 -1
- package/src/duckdb/src/storage/temporary_file_manager.cpp +1 -1
- package/src/duckdb/src/storage/wal_replay.cpp +8 -7
- package/src/duckdb/src/storage/write_ahead_log.cpp +3 -4
- package/src/duckdb/src/transaction/cleanup_state.cpp +10 -3
- package/src/duckdb/src/transaction/commit_state.cpp +11 -4
- package/src/duckdb/src/transaction/duck_transaction.cpp +23 -3
- package/src/duckdb/src/transaction/rollback_state.cpp +1 -1
- package/src/duckdb/src/transaction/transaction_context.cpp +1 -1
- package/src/duckdb/src/transaction/undo_buffer.cpp +3 -1
- package/src/duckdb/third_party/fmt/include/fmt/core.h +0 -5
- package/src/duckdb/third_party/fsst/fsst.h +1 -1
- package/src/duckdb/third_party/fsst/libfsst.cpp +1 -140
- package/src/duckdb/third_party/fsst/libfsst.hpp +0 -13
- package/src/duckdb/third_party/hyperloglog/hyperloglog.hpp +4 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +8 -1
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +2 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +15401 -15354
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +299 -538
- package/src/duckdb/third_party/lz4/lz4.cpp +2605 -0
- package/src/duckdb/third_party/lz4/lz4.hpp +843 -0
- package/src/duckdb/third_party/parquet/parquet_types.cpp +3 -0
- package/src/duckdb/third_party/parquet/parquet_types.h +2 -1
- package/src/duckdb/third_party/re2/re2/bitmap256.cc +44 -0
- package/src/duckdb/third_party/re2/re2/bitmap256.h +3 -35
- package/src/duckdb/third_party/re2/re2/bitstate.cc +31 -24
- package/src/duckdb/third_party/re2/re2/compile.cc +146 -164
- package/src/duckdb/third_party/re2/re2/dfa.cc +174 -181
- package/src/duckdb/third_party/re2/re2/filtered_re2.cc +19 -3
- package/src/duckdb/third_party/re2/re2/filtered_re2.h +27 -23
- package/src/duckdb/third_party/re2/re2/mimics_pcre.cc +21 -11
- package/src/duckdb/third_party/re2/re2/nfa.cc +91 -131
- package/src/duckdb/third_party/re2/re2/onepass.cc +11 -10
- package/src/duckdb/third_party/re2/re2/parse.cc +171 -154
- package/src/duckdb/third_party/re2/re2/perl_groups.cc +35 -35
- package/src/duckdb/third_party/re2/re2/pod_array.h +55 -0
- package/src/duckdb/third_party/re2/re2/prefilter.cc +40 -40
- package/src/duckdb/third_party/re2/re2/prefilter.h +24 -2
- package/src/duckdb/third_party/re2/re2/prefilter_tree.cc +70 -84
- package/src/duckdb/third_party/re2/re2/prefilter_tree.h +5 -4
- package/src/duckdb/third_party/re2/re2/prog.cc +315 -58
- package/src/duckdb/third_party/re2/re2/prog.h +77 -44
- package/src/duckdb/third_party/re2/re2/re2.cc +333 -221
- package/src/duckdb/third_party/re2/re2/re2.h +277 -201
- package/src/duckdb/third_party/re2/re2/regexp.cc +137 -105
- package/src/duckdb/third_party/re2/re2/regexp.h +45 -40
- package/src/duckdb/third_party/re2/re2/set.cc +40 -17
- package/src/duckdb/third_party/re2/re2/set.h +11 -6
- package/src/duckdb/third_party/re2/re2/simplify.cc +50 -41
- package/src/duckdb/third_party/re2/re2/sparse_array.h +392 -0
- package/src/duckdb/third_party/re2/re2/sparse_set.h +264 -0
- package/src/duckdb/third_party/re2/re2/stringpiece.cc +1 -1
- package/src/duckdb/third_party/re2/re2/stringpiece.h +11 -8
- package/src/duckdb/third_party/re2/re2/tostring.cc +8 -6
- package/src/duckdb/third_party/re2/re2/unicode_casefold.cc +39 -10
- package/src/duckdb/third_party/re2/re2/unicode_casefold.h +1 -1
- package/src/duckdb/third_party/re2/re2/unicode_groups.cc +5019 -4566
- package/src/duckdb/third_party/re2/re2/unicode_groups.h +1 -1
- package/src/duckdb/third_party/re2/re2/walker-inl.h +21 -20
- package/src/duckdb/third_party/re2/util/logging.h +14 -18
- package/src/duckdb/third_party/re2/util/mix.h +4 -4
- package/src/duckdb/third_party/re2/util/mutex.h +48 -15
- package/src/duckdb/third_party/re2/util/rune.cc +5 -5
- package/src/duckdb/third_party/re2/util/strutil.cc +1 -16
- package/src/duckdb/third_party/re2/util/strutil.h +1 -3
- package/src/duckdb/third_party/re2/util/utf.h +1 -1
- package/src/duckdb/third_party/re2/util/util.h +9 -1
- package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +2 -0
- package/src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp +36 -1
- package/src/duckdb/ub_src_common.cpp +0 -2
- package/src/duckdb/ub_src_execution_physical_plan.cpp +2 -0
- package/src/duckdb/ub_src_planner_expression.cpp +2 -0
- package/src/duckdb/ub_src_planner_expression_binder.cpp +2 -0
- package/src/duckdb/ub_src_planner_operator.cpp +2 -0
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
#include <stddef.h>
|
8
8
|
#include <string>
|
9
|
+
#include <utility>
|
9
10
|
|
10
11
|
#include "util/util.h"
|
11
12
|
#include "util/logging.h"
|
@@ -27,7 +28,22 @@ FilteredRE2::FilteredRE2(int min_atom_len)
|
|
27
28
|
FilteredRE2::~FilteredRE2() {
|
28
29
|
for (size_t i = 0; i < re2_vec_.size(); i++)
|
29
30
|
delete re2_vec_[i];
|
30
|
-
|
31
|
+
}
|
32
|
+
|
33
|
+
FilteredRE2::FilteredRE2(FilteredRE2&& other)
|
34
|
+
: re2_vec_(std::move(other.re2_vec_)),
|
35
|
+
compiled_(other.compiled_),
|
36
|
+
prefilter_tree_(std::move(other.prefilter_tree_)) {
|
37
|
+
other.re2_vec_.clear();
|
38
|
+
other.re2_vec_.shrink_to_fit();
|
39
|
+
other.compiled_ = false;
|
40
|
+
other.prefilter_tree_.reset(new PrefilterTree());
|
41
|
+
}
|
42
|
+
|
43
|
+
FilteredRE2& FilteredRE2::operator=(FilteredRE2&& other) {
|
44
|
+
this->~FilteredRE2();
|
45
|
+
(void) new (this) FilteredRE2(std::move(other));
|
46
|
+
return *this;
|
31
47
|
}
|
32
48
|
|
33
49
|
RE2::ErrorCode FilteredRE2::Add(const StringPiece& pattern,
|
@@ -38,7 +54,7 @@ RE2::ErrorCode FilteredRE2::Add(const StringPiece& pattern,
|
|
38
54
|
if (!re->ok()) {
|
39
55
|
if (options.log_errors()) {
|
40
56
|
LOG(ERROR) << "Couldn't compile regular expression, skipping: "
|
41
|
-
<<
|
57
|
+
<< pattern << " due to error " << re->error();
|
42
58
|
}
|
43
59
|
delete re;
|
44
60
|
} else {
|
@@ -118,4 +134,4 @@ void FilteredRE2::PrintPrefilter(int regexpid) {
|
|
118
134
|
prefilter_tree_->PrintPrefilter(regexpid);
|
119
135
|
}
|
120
136
|
|
121
|
-
} // namespace
|
137
|
+
} // namespace re2
|
@@ -10,17 +10,18 @@
|
|
10
10
|
// number of regexps that need to be actually searched.
|
11
11
|
//
|
12
12
|
// By design, it does not include a string matching engine. This is to
|
13
|
-
// allow the user of the class to use their favorite string
|
13
|
+
// allow the user of the class to use their favorite string matching
|
14
14
|
// engine. The overall flow is: Add all the regexps using Add, then
|
15
|
-
// Compile the FilteredRE2.
|
16
|
-
//
|
17
|
-
// applying regexps to a search text, the caller does the string
|
18
|
-
// matching using the strings
|
19
|
-
// note that the caller has to do that
|
20
|
-
// search text. Then call FirstMatch
|
21
|
-
// indices of strings that were found
|
22
|
-
// regexp matches.
|
23
|
-
|
15
|
+
// Compile the FilteredRE2. Compile returns strings that need to be
|
16
|
+
// matched. Note that the returned strings are lowercased and distinct.
|
17
|
+
// For applying regexps to a search text, the caller does the string
|
18
|
+
// matching using the returned strings. When doing the string match,
|
19
|
+
// note that the caller has to do that in a case-insensitive way or
|
20
|
+
// on a lowercased version of the search text. Then call FirstMatch
|
21
|
+
// or AllMatches with a vector of indices of strings that were found
|
22
|
+
// in the text to get the actual regexp matches.
|
23
|
+
|
24
|
+
#include <memory>
|
24
25
|
#include <string>
|
25
26
|
#include <vector>
|
26
27
|
|
@@ -36,18 +37,25 @@ class FilteredRE2 {
|
|
36
37
|
explicit FilteredRE2(int min_atom_len);
|
37
38
|
~FilteredRE2();
|
38
39
|
|
40
|
+
// Not copyable.
|
41
|
+
FilteredRE2(const FilteredRE2&) = delete;
|
42
|
+
FilteredRE2& operator=(const FilteredRE2&) = delete;
|
43
|
+
// Movable.
|
44
|
+
FilteredRE2(FilteredRE2&& other);
|
45
|
+
FilteredRE2& operator=(FilteredRE2&& other);
|
46
|
+
|
39
47
|
// Uses RE2 constructor to create a RE2 object (re). Returns
|
40
48
|
// re->error_code(). If error_code is other than NoError, then re is
|
41
49
|
// deleted and not added to re2_vec_.
|
42
50
|
RE2::ErrorCode Add(const StringPiece& pattern,
|
43
51
|
const RE2::Options& options,
|
44
|
-
int
|
52
|
+
int* id);
|
45
53
|
|
46
54
|
// Prepares the regexps added by Add for filtering. Returns a set
|
47
55
|
// of strings that the caller should check for in candidate texts.
|
48
|
-
// The returned strings are lowercased. When doing
|
49
|
-
//
|
50
|
-
//
|
56
|
+
// The returned strings are lowercased and distinct. When doing
|
57
|
+
// string matching, it should be performed in a case-insensitive
|
58
|
+
// way or the search text should be lowercased first. Call after
|
51
59
|
// all Add calls are done.
|
52
60
|
void Compile(std::vector<std::string>* strings_to_match);
|
53
61
|
|
@@ -80,11 +88,10 @@ class FilteredRE2 {
|
|
80
88
|
// The number of regexps added.
|
81
89
|
int NumRegexps() const { return static_cast<int>(re2_vec_.size()); }
|
82
90
|
|
83
|
-
|
84
|
-
|
85
|
-
// Get the individual RE2 objects. Useful for testing.
|
86
|
-
RE2* GetRE2(int regexpid) const { return re2_vec_[regexpid]; }
|
91
|
+
// Get the individual RE2 objects.
|
92
|
+
const RE2& GetRE2(int regexpid) const { return *re2_vec_[regexpid]; }
|
87
93
|
|
94
|
+
private:
|
88
95
|
// Print prefilter.
|
89
96
|
void PrintPrefilter(int regexpid);
|
90
97
|
|
@@ -99,12 +106,9 @@ class FilteredRE2 {
|
|
99
106
|
bool compiled_;
|
100
107
|
|
101
108
|
// An AND-OR tree of string atoms used for filtering regexps.
|
102
|
-
PrefilterTree
|
103
|
-
|
104
|
-
FilteredRE2(const FilteredRE2&) = delete;
|
105
|
-
FilteredRE2& operator=(const FilteredRE2&) = delete;
|
109
|
+
std::unique_ptr<PrefilterTree> prefilter_tree_;
|
106
110
|
};
|
107
111
|
|
108
|
-
} // namespace
|
112
|
+
} // namespace re2
|
109
113
|
|
110
114
|
#endif // RE2_FILTERED_RE2_H_
|
@@ -38,14 +38,21 @@ static bool CanBeEmptyString(Regexp *re);
|
|
38
38
|
class PCREWalker : public Regexp::Walker<bool> {
|
39
39
|
public:
|
40
40
|
PCREWalker() {}
|
41
|
-
bool PostVisit(Regexp* re, bool parent_arg, bool pre_arg, bool* child_args,
|
42
|
-
int nchild_args);
|
43
41
|
|
44
|
-
bool
|
45
|
-
|
46
|
-
|
42
|
+
virtual bool PostVisit(Regexp* re, bool parent_arg, bool pre_arg,
|
43
|
+
bool* child_args, int nchild_args);
|
44
|
+
|
45
|
+
virtual bool ShortVisit(Regexp* re, bool a) {
|
46
|
+
// Should never be called: we use Walk(), not WalkExponential().
|
47
|
+
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
48
|
+
LOG(DFATAL) << "PCREWalker::ShortVisit called";
|
49
|
+
#endif
|
47
50
|
return a;
|
48
51
|
}
|
52
|
+
|
53
|
+
private:
|
54
|
+
PCREWalker(const PCREWalker&) = delete;
|
55
|
+
PCREWalker& operator=(const PCREWalker&) = delete;
|
49
56
|
};
|
50
57
|
|
51
58
|
// Called after visiting each of re's children and accumulating
|
@@ -114,13 +121,16 @@ bool Regexp::MimicsPCRE() {
|
|
114
121
|
|
115
122
|
class EmptyStringWalker : public Regexp::Walker<bool> {
|
116
123
|
public:
|
117
|
-
EmptyStringWalker() {
|
118
|
-
|
119
|
-
|
124
|
+
EmptyStringWalker() {}
|
125
|
+
|
126
|
+
virtual bool PostVisit(Regexp* re, bool parent_arg, bool pre_arg,
|
127
|
+
bool* child_args, int nchild_args);
|
120
128
|
|
121
|
-
bool ShortVisit(Regexp* re, bool a) {
|
122
|
-
// Should never be called: we use Walk not WalkExponential.
|
129
|
+
virtual bool ShortVisit(Regexp* re, bool a) {
|
130
|
+
// Should never be called: we use Walk(), not WalkExponential().
|
131
|
+
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
123
132
|
LOG(DFATAL) << "EmptyStringWalker::ShortVisit called";
|
133
|
+
#endif
|
124
134
|
return a;
|
125
135
|
}
|
126
136
|
|
@@ -184,4 +194,4 @@ static bool CanBeEmptyString(Regexp* re) {
|
|
184
194
|
return w.Walk(re, true);
|
185
195
|
}
|
186
196
|
|
187
|
-
} // namespace
|
197
|
+
} // namespace re2
|
@@ -27,17 +27,18 @@
|
|
27
27
|
#include <stdio.h>
|
28
28
|
#include <string.h>
|
29
29
|
#include <algorithm>
|
30
|
+
#include <deque>
|
30
31
|
#include <string>
|
31
32
|
#include <utility>
|
32
33
|
#include <vector>
|
33
34
|
|
34
|
-
#include "re2/prog.h"
|
35
|
-
#include "re2/regexp.h"
|
36
35
|
#include "util/logging.h"
|
37
|
-
#include "util/pod_array.h"
|
38
|
-
#include "util/sparse_array.h"
|
39
|
-
#include "util/sparse_set.h"
|
40
36
|
#include "util/strutil.h"
|
37
|
+
#include "re2/pod_array.h"
|
38
|
+
#include "re2/prog.h"
|
39
|
+
#include "re2/regexp.h"
|
40
|
+
#include "re2/sparse_array.h"
|
41
|
+
#include "re2/sparse_set.h"
|
41
42
|
|
42
43
|
namespace duckdb_re2 {
|
43
44
|
|
@@ -105,18 +106,21 @@ class NFA {
|
|
105
106
|
// Returns text version of capture information, for debugging.
|
106
107
|
std::string FormatCapture(const char** capture);
|
107
108
|
|
108
|
-
|
109
|
+
void CopyCapture(const char** dst, const char** src) {
|
110
|
+
memmove(dst, src, ncapture_*sizeof src[0]);
|
111
|
+
}
|
109
112
|
|
110
113
|
Prog* prog_; // underlying program
|
111
114
|
int start_; // start instruction in program
|
112
115
|
int ncapture_; // number of submatches to track
|
113
116
|
bool longest_; // whether searching for longest match
|
114
117
|
bool endmatch_; // whether match must end at text.end()
|
115
|
-
const char* btext_; // beginning of text
|
116
|
-
const char* etext_; // end of text
|
118
|
+
const char* btext_; // beginning of text (for FormatSubmatch)
|
119
|
+
const char* etext_; // end of text (for endmatch_)
|
117
120
|
Threadq q0_, q1_; // pre-allocated for Search.
|
118
121
|
PODArray<AddState> stack_; // pre-allocated for AddToThreadq
|
119
|
-
Thread
|
122
|
+
std::deque<Thread> arena_; // thread arena
|
123
|
+
Thread* freelist_; // thread freelist
|
120
124
|
const char** match_; // best match so far
|
121
125
|
bool matched_; // any match so far?
|
122
126
|
|
@@ -139,31 +143,30 @@ NFA::NFA(Prog* prog) {
|
|
139
143
|
prog_->inst_count(kInstEmptyWidth) +
|
140
144
|
prog_->inst_count(kInstNop) + 1; // + 1 for start inst
|
141
145
|
stack_ = PODArray<AddState>(nstack);
|
142
|
-
|
146
|
+
freelist_ = NULL;
|
143
147
|
match_ = NULL;
|
144
148
|
matched_ = false;
|
145
149
|
}
|
146
150
|
|
147
151
|
NFA::~NFA() {
|
148
152
|
delete[] match_;
|
149
|
-
Thread
|
150
|
-
|
151
|
-
next = t->next;
|
152
|
-
delete[] t->capture;
|
153
|
-
delete t;
|
154
|
-
}
|
153
|
+
for (const Thread& t : arena_)
|
154
|
+
delete[] t.capture;
|
155
155
|
}
|
156
156
|
|
157
157
|
NFA::Thread* NFA::AllocThread() {
|
158
|
-
Thread* t =
|
159
|
-
if (t
|
160
|
-
|
158
|
+
Thread* t = freelist_;
|
159
|
+
if (t != NULL) {
|
160
|
+
freelist_ = t->next;
|
161
161
|
t->ref = 1;
|
162
|
-
t
|
162
|
+
// We don't need to touch t->capture because
|
163
|
+
// the caller will immediately overwrite it.
|
163
164
|
return t;
|
164
165
|
}
|
165
|
-
|
166
|
+
arena_.emplace_back();
|
167
|
+
t = &arena_.back();
|
166
168
|
t->ref = 1;
|
169
|
+
t->capture = new const char*[ncapture_];
|
167
170
|
return t;
|
168
171
|
}
|
169
172
|
|
@@ -174,21 +177,13 @@ NFA::Thread* NFA::Incref(Thread* t) {
|
|
174
177
|
}
|
175
178
|
|
176
179
|
void NFA::Decref(Thread* t) {
|
177
|
-
|
178
|
-
return;
|
180
|
+
DCHECK(t != NULL);
|
179
181
|
t->ref--;
|
180
182
|
if (t->ref > 0)
|
181
183
|
return;
|
182
184
|
DCHECK_EQ(t->ref, 0);
|
183
|
-
t->next =
|
184
|
-
|
185
|
-
}
|
186
|
-
|
187
|
-
void NFA::CopyCapture(const char** dst, const char** src) {
|
188
|
-
for (int i = 0; i < ncapture_; i+=2) {
|
189
|
-
dst[i] = src[i];
|
190
|
-
dst[i+1] = src[i+1];
|
191
|
-
}
|
185
|
+
t->next = freelist_;
|
186
|
+
freelist_ = t;
|
192
187
|
}
|
193
188
|
|
194
189
|
// Follows all empty arrows from id0 and enqueues all the states reached.
|
@@ -288,6 +283,7 @@ void NFA::AddToThreadq(Threadq* q, int id0, int c, const StringPiece& context,
|
|
288
283
|
// Save state; will pick up at next byte.
|
289
284
|
t = Incref(t0);
|
290
285
|
*tp = t;
|
286
|
+
|
291
287
|
if (ip->hint() == 0)
|
292
288
|
break;
|
293
289
|
a = {id+ip->hint(), NULL};
|
@@ -297,6 +293,7 @@ void NFA::AddToThreadq(Threadq* q, int id0, int c, const StringPiece& context,
|
|
297
293
|
// Save state; will pick up at next byte.
|
298
294
|
t = Incref(t0);
|
299
295
|
*tp = t;
|
296
|
+
|
300
297
|
Next:
|
301
298
|
if (ip->last())
|
302
299
|
break;
|
@@ -362,8 +359,10 @@ int NFA::Step(Threadq* runq, Threadq* nextq, int c, const StringPiece& context,
|
|
362
359
|
matched_ = true;
|
363
360
|
|
364
361
|
Decref(t);
|
365
|
-
for (++i; i != runq->end(); ++i)
|
366
|
-
|
362
|
+
for (++i; i != runq->end(); ++i) {
|
363
|
+
if (i->value() != NULL)
|
364
|
+
Decref(i->value());
|
365
|
+
}
|
367
366
|
runq->clear();
|
368
367
|
if (ip->greedy(prog_))
|
369
368
|
return ip->out1();
|
@@ -372,10 +371,15 @@ int NFA::Step(Threadq* runq, Threadq* nextq, int c, const StringPiece& context,
|
|
372
371
|
break;
|
373
372
|
|
374
373
|
case kInstMatch: {
|
375
|
-
// Avoid invoking undefined behavior
|
376
|
-
//
|
377
|
-
|
374
|
+
// Avoid invoking undefined behavior (arithmetic on a null pointer)
|
375
|
+
// by storing p instead of p-1. (What would the latter even mean?!)
|
376
|
+
// This complements the special case in NFA::Search().
|
377
|
+
if (p == NULL) {
|
378
|
+
CopyCapture(match_, t->capture);
|
379
|
+
match_[1] = p;
|
380
|
+
matched_ = true;
|
378
381
|
break;
|
382
|
+
}
|
379
383
|
|
380
384
|
if (endmatch_ && p-1 != etext_)
|
381
385
|
break;
|
@@ -401,8 +405,10 @@ int NFA::Step(Threadq* runq, Threadq* nextq, int c, const StringPiece& context,
|
|
401
405
|
// worse than the one we just found: don't run the
|
402
406
|
// rest of the current Threadq.
|
403
407
|
Decref(t);
|
404
|
-
for (++i; i != runq->end(); ++i)
|
405
|
-
|
408
|
+
for (++i; i != runq->end(); ++i) {
|
409
|
+
if (i->value() != NULL)
|
410
|
+
Decref(i->value());
|
411
|
+
}
|
406
412
|
runq->clear();
|
407
413
|
return 0;
|
408
414
|
}
|
@@ -419,13 +425,14 @@ std::string NFA::FormatCapture(const char** capture) {
|
|
419
425
|
std::string s;
|
420
426
|
for (int i = 0; i < ncapture_; i+=2) {
|
421
427
|
if (capture[i] == NULL)
|
422
|
-
|
428
|
+
s += "(?,?)";
|
423
429
|
else if (capture[i+1] == NULL)
|
424
|
-
|
430
|
+
s += StringPrintf("(%td,?)",
|
431
|
+
capture[i] - btext_);
|
425
432
|
else
|
426
|
-
|
427
|
-
|
428
|
-
|
433
|
+
s += StringPrintf("(%td,%td)",
|
434
|
+
capture[i] - btext_,
|
435
|
+
capture[i+1] - btext_);
|
429
436
|
}
|
430
437
|
return s;
|
431
438
|
}
|
@@ -437,24 +444,23 @@ bool NFA::Search(const StringPiece& text, const StringPiece& const_context,
|
|
437
444
|
return false;
|
438
445
|
|
439
446
|
StringPiece context = const_context;
|
440
|
-
if (context.
|
447
|
+
if (context.data() == NULL)
|
441
448
|
context = text;
|
442
449
|
|
443
450
|
// Sanity check: make sure that text lies within context.
|
444
|
-
if (text
|
451
|
+
if (BeginPtr(text) < BeginPtr(context) || EndPtr(text) > EndPtr(context)) {
|
445
452
|
LOG(DFATAL) << "context does not contain text";
|
446
453
|
return false;
|
447
454
|
}
|
448
455
|
|
449
|
-
if (prog_->anchor_start() && context
|
456
|
+
if (prog_->anchor_start() && BeginPtr(context) != BeginPtr(text))
|
450
457
|
return false;
|
451
|
-
if (prog_->anchor_end() && context
|
458
|
+
if (prog_->anchor_end() && EndPtr(context) != EndPtr(text))
|
452
459
|
return false;
|
453
460
|
anchored |= prog_->anchor_start();
|
454
461
|
if (prog_->anchor_end()) {
|
455
462
|
longest = true;
|
456
463
|
endmatch_ = true;
|
457
|
-
etext_ = text.end();
|
458
464
|
}
|
459
465
|
|
460
466
|
if (nsubmatch < 0) {
|
@@ -474,29 +480,31 @@ bool NFA::Search(const StringPiece& text, const StringPiece& const_context,
|
|
474
480
|
}
|
475
481
|
|
476
482
|
match_ = new const char*[ncapture_];
|
483
|
+
memset(match_, 0, ncapture_*sizeof match_[0]);
|
477
484
|
matched_ = false;
|
478
485
|
|
479
486
|
// For debugging prints.
|
480
|
-
btext_ = context.
|
487
|
+
btext_ = context.data();
|
488
|
+
// For convenience.
|
489
|
+
etext_ = text.data() + text.size();
|
481
490
|
|
482
491
|
// Set up search.
|
483
492
|
Threadq* runq = &q0_;
|
484
493
|
Threadq* nextq = &q1_;
|
485
494
|
runq->clear();
|
486
495
|
nextq->clear();
|
487
|
-
memset(&match_[0], 0, ncapture_*sizeof match_[0]);
|
488
496
|
|
489
497
|
// Loop over the text, stepping the machine.
|
490
|
-
for (const char* p = text.
|
498
|
+
for (const char* p = text.data();; p++) {
|
491
499
|
// This is a no-op the first time around the loop because runq is empty.
|
492
|
-
int id = Step(runq, nextq, p <
|
500
|
+
int id = Step(runq, nextq, p < etext_ ? p[0] & 0xFF : -1, context, p);
|
493
501
|
DCHECK_EQ(runq->size(), 0);
|
494
502
|
using std::swap;
|
495
503
|
swap(nextq, runq);
|
496
504
|
nextq->clear();
|
497
505
|
if (id != 0) {
|
498
506
|
// We're done: full match ahead.
|
499
|
-
p =
|
507
|
+
p = etext_;
|
500
508
|
for (;;) {
|
501
509
|
Prog::Inst* ip = prog_->inst(id);
|
502
510
|
switch (ip->opcode()) {
|
@@ -524,30 +532,28 @@ bool NFA::Search(const StringPiece& text, const StringPiece& const_context,
|
|
524
532
|
break;
|
525
533
|
}
|
526
534
|
|
527
|
-
if (p >
|
535
|
+
if (p > etext_)
|
528
536
|
break;
|
529
537
|
|
530
538
|
// Start a new thread if there have not been any matches.
|
531
539
|
// (No point in starting a new thread if there have been
|
532
540
|
// matches, since it would be to the right of the match
|
533
541
|
// we already found.)
|
534
|
-
if (!matched_ && (!anchored || p == text.
|
535
|
-
//
|
536
|
-
//
|
537
|
-
//
|
538
|
-
int fb = prog_->first_byte();
|
542
|
+
if (!matched_ && (!anchored || p == text.data())) {
|
543
|
+
// Try to use prefix accel (e.g. memchr) to skip ahead.
|
544
|
+
// The search must be unanchored and there must be zero
|
545
|
+
// possible matches already.
|
539
546
|
if (!anchored && runq->size() == 0 &&
|
540
|
-
|
541
|
-
p = reinterpret_cast<const char*>(
|
542
|
-
if (p == NULL)
|
543
|
-
p =
|
544
|
-
}
|
547
|
+
p < etext_ && prog_->can_prefix_accel()) {
|
548
|
+
p = reinterpret_cast<const char*>(prog_->PrefixAccel(p, etext_ - p));
|
549
|
+
if (p == NULL)
|
550
|
+
p = etext_;
|
545
551
|
}
|
546
552
|
|
547
553
|
Thread* t = AllocThread();
|
548
554
|
CopyCapture(t->capture, match_);
|
549
555
|
t->capture[0] = p;
|
550
|
-
AddToThreadq(runq, start_, p <
|
556
|
+
AddToThreadq(runq, start_, p < etext_ ? p[0] & 0xFF : -1, context, p,
|
551
557
|
t);
|
552
558
|
Decref(t);
|
553
559
|
}
|
@@ -556,10 +562,24 @@ bool NFA::Search(const StringPiece& text, const StringPiece& const_context,
|
|
556
562
|
if (runq->size() == 0) {
|
557
563
|
break;
|
558
564
|
}
|
565
|
+
|
566
|
+
// Avoid invoking undefined behavior (arithmetic on a null pointer)
|
567
|
+
// by simply not continuing the loop.
|
568
|
+
// This complements the special case in NFA::Step().
|
569
|
+
if (p == NULL) {
|
570
|
+
(void) Step(runq, nextq, -1, context, p);
|
571
|
+
DCHECK_EQ(runq->size(), 0);
|
572
|
+
using std::swap;
|
573
|
+
swap(nextq, runq);
|
574
|
+
nextq->clear();
|
575
|
+
break;
|
576
|
+
}
|
559
577
|
}
|
560
578
|
|
561
|
-
for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i)
|
562
|
-
|
579
|
+
for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i) {
|
580
|
+
if (i->value() != NULL)
|
581
|
+
Decref(i->value());
|
582
|
+
}
|
563
583
|
|
564
584
|
if (matched_) {
|
565
585
|
for (int i = 0; i < nsubmatch; i++)
|
@@ -571,71 +591,11 @@ bool NFA::Search(const StringPiece& text, const StringPiece& const_context,
|
|
571
591
|
return false;
|
572
592
|
}
|
573
593
|
|
574
|
-
// Computes whether all successful matches have a common first byte,
|
575
|
-
// and if so, returns that byte. If not, returns -1.
|
576
|
-
int Prog::ComputeFirstByte() {
|
577
|
-
int b = -1;
|
578
|
-
SparseSet q(size());
|
579
|
-
q.insert(start());
|
580
|
-
for (SparseSet::iterator it = q.begin(); it != q.end(); ++it) {
|
581
|
-
int id = *it;
|
582
|
-
Prog::Inst* ip = inst(id);
|
583
|
-
switch (ip->opcode()) {
|
584
|
-
default:
|
585
|
-
LOG(DFATAL) << "unhandled " << ip->opcode() << " in ComputeFirstByte";
|
586
|
-
break;
|
587
|
-
|
588
|
-
case kInstMatch:
|
589
|
-
// The empty string matches: no first byte.
|
590
|
-
return -1;
|
591
|
-
|
592
|
-
case kInstByteRange:
|
593
|
-
if (!ip->last())
|
594
|
-
q.insert(id+1);
|
595
|
-
|
596
|
-
// Must match only a single byte
|
597
|
-
if (ip->lo() != ip->hi())
|
598
|
-
return -1;
|
599
|
-
if (ip->foldcase() && 'a' <= ip->lo() && ip->lo() <= 'z')
|
600
|
-
return -1;
|
601
|
-
// If we haven't seen any bytes yet, record it;
|
602
|
-
// otherwise must match the one we saw before.
|
603
|
-
if (b == -1)
|
604
|
-
b = ip->lo();
|
605
|
-
else if (b != ip->lo())
|
606
|
-
return -1;
|
607
|
-
break;
|
608
|
-
|
609
|
-
case kInstNop:
|
610
|
-
case kInstCapture:
|
611
|
-
case kInstEmptyWidth:
|
612
|
-
if (!ip->last())
|
613
|
-
q.insert(id+1);
|
614
|
-
|
615
|
-
// Continue on.
|
616
|
-
// Ignore ip->empty() flags for kInstEmptyWidth
|
617
|
-
// in order to be as conservative as possible
|
618
|
-
// (assume all possible empty-width flags are true).
|
619
|
-
if (ip->out())
|
620
|
-
q.insert(ip->out());
|
621
|
-
break;
|
622
|
-
|
623
|
-
case kInstAltMatch:
|
624
|
-
DCHECK(!ip->last());
|
625
|
-
q.insert(id+1);
|
626
|
-
break;
|
627
|
-
|
628
|
-
case kInstFail:
|
629
|
-
break;
|
630
|
-
}
|
631
|
-
}
|
632
|
-
return b;
|
633
|
-
}
|
634
|
-
|
635
594
|
bool
|
636
595
|
Prog::SearchNFA(const StringPiece& text, const StringPiece& context,
|
637
596
|
Anchor anchor, MatchKind kind,
|
638
597
|
StringPiece* match, int nmatch) {
|
598
|
+
|
639
599
|
NFA nfa(this);
|
640
600
|
StringPiece sp;
|
641
601
|
if (kind == kFullMatch) {
|
@@ -647,7 +607,7 @@ Prog::SearchNFA(const StringPiece& text, const StringPiece& context,
|
|
647
607
|
}
|
648
608
|
if (!nfa.Search(text, context, anchor == kAnchored, kind != kFirstMatch, match, nmatch))
|
649
609
|
return false;
|
650
|
-
if (kind == kFullMatch && match[0]
|
610
|
+
if (kind == kFullMatch && EndPtr(match[0]) != EndPtr(text))
|
651
611
|
return false;
|
652
612
|
return true;
|
653
613
|
}
|
@@ -711,4 +671,4 @@ void Prog::Fanout(SparseArray<int>* fanout) {
|
|
711
671
|
}
|
712
672
|
}
|
713
673
|
|
714
|
-
} // namespace
|
674
|
+
} // namespace re2
|
@@ -59,16 +59,16 @@
|
|
59
59
|
|
60
60
|
#include "util/util.h"
|
61
61
|
#include "util/logging.h"
|
62
|
-
#include "util/pod_array.h"
|
63
|
-
#include "util/sparse_set.h"
|
64
62
|
#include "util/strutil.h"
|
65
63
|
#include "util/utf.h"
|
64
|
+
#include "re2/pod_array.h"
|
66
65
|
#include "re2/prog.h"
|
66
|
+
#include "re2/sparse_set.h"
|
67
67
|
#include "re2/stringpiece.h"
|
68
68
|
|
69
69
|
// Silence "zero-sized array in struct/union" warning for OneState::action.
|
70
70
|
#ifdef _MSC_VER
|
71
|
-
|
71
|
+
#pragma warning(disable: 4200)
|
72
72
|
#endif
|
73
73
|
|
74
74
|
namespace duckdb_re2 {
|
@@ -143,7 +143,7 @@ namespace duckdb_re2 {
|
|
143
143
|
// the memory footprint.)
|
144
144
|
struct OneState {
|
145
145
|
uint32_t matchcond; // conditions to match right now.
|
146
|
-
uint32_t action[
|
146
|
+
uint32_t action[];
|
147
147
|
};
|
148
148
|
|
149
149
|
// The uint32_t conditions in the action are a combination of
|
@@ -233,11 +233,11 @@ bool Prog::SearchOnePass(const StringPiece& text,
|
|
233
233
|
matchcap[i] = NULL;
|
234
234
|
|
235
235
|
StringPiece context = const_context;
|
236
|
-
if (context.
|
236
|
+
if (context.data() == NULL)
|
237
237
|
context = text;
|
238
|
-
if (anchor_start() && context
|
238
|
+
if (anchor_start() && BeginPtr(context) != BeginPtr(text))
|
239
239
|
return false;
|
240
|
-
if (anchor_end() && context
|
240
|
+
if (anchor_end() && EndPtr(context) != EndPtr(text))
|
241
241
|
return false;
|
242
242
|
if (anchor_end())
|
243
243
|
kind = kFullMatch;
|
@@ -247,8 +247,8 @@ bool Prog::SearchOnePass(const StringPiece& text,
|
|
247
247
|
// start() is always mapped to the zeroth OneState.
|
248
248
|
OneState* state = IndexToNode(nodes, statesize, 0);
|
249
249
|
uint8_t* bytemap = bytemap_;
|
250
|
-
const char* bp = text.
|
251
|
-
const char* ep = text.
|
250
|
+
const char* bp = text.data();
|
251
|
+
const char* ep = text.data() + text.size();
|
252
252
|
const char* p;
|
253
253
|
bool matched = false;
|
254
254
|
matchcap[0] = bp;
|
@@ -563,6 +563,7 @@ bool Prog::IsOnePass() {
|
|
563
563
|
}
|
564
564
|
}
|
565
565
|
}
|
566
|
+
|
566
567
|
dfa_mem_ -= nalloc*statesize;
|
567
568
|
onepass_nodes_ = PODArray<uint8_t>(nalloc*statesize);
|
568
569
|
memmove(onepass_nodes_.data(), nodes.data(), nalloc*statesize);
|
@@ -572,4 +573,4 @@ fail:
|
|
572
573
|
return false;
|
573
574
|
}
|
574
575
|
|
575
|
-
} // namespace
|
576
|
+
} // namespace re2
|